Skip to content

feat(guardrails): Add header decorator functionality - #1135

Open
Prajna1999 wants to merge 2 commits into
mainfrom
feat/guardrails-readiness
Open

feat(guardrails): Add header decorator functionality#1135
Prajna1999 wants to merge 2 commits into
mainfrom
feat/guardrails-readiness

Conversation

@Prajna1999

@Prajna1999 Prajna1999 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Issue

Closes #PLEASE_TYPE_ISSUE_NUMBER

Summary

  • Before: Existing flow did not have a header decorator for /guardrails.
  • Now: The new flow includes a header decorator for the /guardrails endpoint.
  • Implemented the header decorator.
  • Ensured compatibility with existing guardrail functionalities.

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

Notes

Please add here if any other information is required for the reviewer.

Original PR description

Issue

Closes #PLEASE_TYPE_ISSUE_NUMBER

Summary

Explain the motivation for making this change. What existing problem does the pull request solve?

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

Notes

Please add here if any other information is required for the reviewer.

@github-actions github-actions Bot changed the title feat: add header decorator to /guardrails feat(guardrails): Add header decorator functionality Aug 18, 2026
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ready-for-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f96a6d8-8505-4a9d-b769-083fb18f5646

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

OpenAPI changes   🟢 16 non-breaking changes

Tip

Safe to merge from an API-contract perspective.

Full changelog  ·  16
Method Path Change
🟢 GET /api/v1/guardrails endpoint added
🟢 GET /api/v1/guardrails/ban_lists endpoint added
🟢 POST /api/v1/guardrails/ban_lists endpoint added
🟢 DELETE /api/v1/guardrails/ban_lists/{ban_list_id} endpoint added
🟢 GET /api/v1/guardrails/ban_lists/{ban_list_id} endpoint added
🟢 PATCH /api/v1/guardrails/ban_lists/{ban_list_id} endpoint added
🟢 GET /api/v1/guardrails/llm_prompt_configs endpoint added
🟢 POST /api/v1/guardrails/llm_prompt_configs endpoint added
🟢 DELETE /api/v1/guardrails/llm_prompt_configs/{prompt_config_id} endpoint added
🟢 GET /api/v1/guardrails/llm_prompt_configs/{prompt_config_id} endpoint added
🟢 PATCH /api/v1/guardrails/llm_prompt_configs/{prompt_config_id} endpoint added
🟢 GET /api/v1/guardrails/validators/configs endpoint added
🟢 POST /api/v1/guardrails/validators/configs endpoint added
🟢 DELETE /api/v1/guardrails/validators/configs/{config_id} endpoint added
🟢 GET /api/v1/guardrails/validators/configs/{config_id} endpoint added
🟢 PATCH /api/v1/guardrails/validators/configs/{config_id} endpoint added

main173381b7 · generated by oasdiff

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.14876% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
backend/app/api/routes/guardrails.py 76.00% 18 Missing ⚠️
backend/app/services/llm/guardrails.py 97.77% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Expose the internal kaapi-guardrails management API (validator catalogue,
ban lists, LLM prompt configs, validator configs) through 16 passthrough
routes behind project auth. Tenant travels only in X-ORGANIZATION-ID /
X-PROJECT-ID headers set from the auth context; 401/403/422 from the
service fail the job instead of bypassing, with client-visible errors
sanitized to status codes only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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