Problem
The proposal includes guardrails for input/output validation. This is a reusable AI
application concern and should not be tangled with a single chat implementation.
Solution
Create extensions/fastapi-ai-guardrails compatible with fastapi-backend.
Scope:
- Add typed guardrail hooks for input and output checks.
- Include simple defaults: max length, blocked patterns, structured response checks,
and extension points for project-specific policies.
- Add tests for allowed and blocked inputs/outputs.
- Add docs:
template/docs/AI_GUARDRAILS_GUIDE.md
template/docs/README.md.append
- Add partial
pyproject.toml only if runtime dependencies are truly needed.
Constraints:
- Do not claim this is complete AI safety coverage.
- Do not use prompt-only guardrails as the enforcement mechanism; code-level checks
must enforce behavior.
- Do not require external moderation APIs for default tests.
Acceptance criteria:
- Generated app exposes reusable guardrail functions/classes.
- Docs explain limitations and how to extend checks.
Problem
The proposal includes guardrails for input/output validation. This is a reusable AI
application concern and should not be tangled with a single chat implementation.
Solution
Create
extensions/fastapi-ai-guardrailscompatible withfastapi-backend.Scope:
and extension points for project-specific policies.
template/docs/AI_GUARDRAILS_GUIDE.mdtemplate/docs/README.md.appendpyproject.tomlonly if runtime dependencies are truly needed.Constraints:
must enforce behavior.
Acceptance criteria: