Skip to content

Open-source readiness: license, decoupled identity, README, security docs - #1

Merged
saadamjad merged 1 commit into
masterfrom
chore/open-source-readiness-audit
Aug 22, 2026
Merged

saadamjad merged 1 commit into
masterfrom
chore/open-source-readiness-audit

Conversation

@saadamjad

Copy link
Copy Markdown
Owner

Summary

Follow-up from a full production-readiness / security / open-source audit of this repo. Everything found (moderation, rate limiting, redacted logging, locked CORS, error handling, timeouts, budget caps, existing docs) was already in good shape — this PR closes the remaining gaps to make the repo genuinely fork-and-run for another developer.

  • Add LICENSE (MIT).
  • Decouple owner identity from source: new AGENT_OWNER_NAME / AGENT_CONTACT_EMAIL settings drive the system prompt (app/prompts/system_prompt.py, now templated functions) and the LLM-unavailable fallback reply (app/services/chat_service.py) instead of hardcoded "Saad"/email strings. Forking now only requires editing .env + app/knowledge/, no Python source changes.
  • Rewrite README.md: purpose, audience, mermaid architecture diagram, features, quick start, provider configuration, step-by-step personalization guide, full API contract, Docker, Railway deploy walkthrough, security summary, testing, troubleshooting, contributing, license.
  • SECURITY.md: explicit "CORS is not authentication" + "Website → Agent API" sections explaining the threat model and why there's no frontend-held API key; also documents that per-session rate limiting is bypassable via client-chosen session IDs (bounded by the per-IP limiter and the daily LLM-call budget regardless).
  • app/core/middleware.py / app/main.py: add SecurityHeadersMiddleware (X-Content-Type-Options, Referrer-Policy) as low-cost defense-in-depth.
  • Add GitHub issue templates (bug/feature) and a PR template.

No changes to the API contract, CrewAI orchestration, storage, or deployment model — the live website integration and current Railway deployment are unaffected. Note: the live Railway deployment should get AGENT_OWNER_NAME=Saad and AGENT_CONTACT_EMAIL=saad.amjad434@gmail.com set (the owner-name default already covers "Saad", but the contact email needs to be set explicitly to preserve current fallback-reply wording).

Test plan

  • ruff check . passes
  • mypy app passes (strict mode)
  • pytest -q — 43/43 passing
  • Verified app boots and _build_fallback_reply() / build_qa_agent_goal() render correctly with env-driven identity
  • Set AGENT_OWNER_NAME / AGENT_CONTACT_EMAIL in Railway before/at merge

🤖 Generated with Claude Code

…security docs

- Add LICENSE (MIT)
- Extract owner identity out of source into AGENT_OWNER_NAME/AGENT_CONTACT_EMAIL
  settings (app/core/config.py) so forking means editing .env + app/knowledge/,
  not Python source
- Rewrite README.md with architecture diagram, provider config, personalization
  guide, API contract, Docker/Railway walkthroughs, and troubleshooting
- Document that CORS is not authentication and add baseline security response
  headers (SecurityHeadersMiddleware) and a documented note on session-id
  rate-limit bypass in SECURITY.md
- Add GitHub issue/PR templates

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@saadamjad saadamjad self-assigned this Aug 22, 2026
@saadamjad
saadamjad merged commit fe40c09 into master Aug 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant