Skip to content

[ENHANCEMENT] Secure chatbot backend#49

Merged
omroy07 merged 1 commit into
omroy07:mainfrom
Aditya8369:46
Jun 9, 2026
Merged

[ENHANCEMENT] Secure chatbot backend#49
omroy07 merged 1 commit into
omroy07:mainfrom
Aditya8369:46

Conversation

@Aditya8369

Copy link
Copy Markdown
Contributor

Secure chatbot backend

Step 1: Understand current chatbot implementation

  • Read chatbot.py to identify security gaps (input validation, rate limiting, unsafe formatting).

Step 2: Implement fixes

  • Update chatbot.py:
    • Keep API key from GEMINI_API_KEY env var (no hardcoding)
    • Add request validation (type + max length)
    • Add rate limiting per IP (in-memory sliding window)
    • Add basic abuse/prompt-injection guardrails (keyword heuristics + educational scope)
    • Make output escaping safe (remove unsafe HTML tag conversion)
    • Improve robustness when reading Gemini response parts

closes #46

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

@Aditya8369 is attempting to deploy a commit to the Om Roy's projects Team on Vercel.

A member of the Team first needs to authorize it.

@omroy07 omroy07 merged commit 98982c5 into omroy07:main Jun 9, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Secure chatbot backend

2 participants