Kong / Kong/developer.konghq.com
(ai-gateway): Create how-to for guarding LLM responses using the OpenAI Moderation API
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 28
- Forks
- 121
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 313
Description
The AI Custom Guardrail plugin currently has one how-to guide covering the Mistral AI Moderation API. The plugin supports any HTTP-based guardrail service, single-direction guarding, and metrics logging, none of which are covered by a dedicated guide. This issue tracks three guides to fill that gap.
What it covers:
- Configure the AI Custom Guardrail plugin with
guarding_mode: OUTPUTto inspect only LLM responses - this might need some testing or changing, as guarding for responses proved to be not fully reliable for other guardrail plkugins - Use the OpenAI Moderation API (
/v1/moderations) as the guardrail service - Write a
check_responsefunction that evaluatesresults[0].flaggedand usesresults[0].category_scoresto identify which categories triggered - Validate that a clean request passes and a response containing harmful content is blocked
- Add logging plugin to the how-to to show how blocked responses are logged
Size: S
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing Mistral AI Moderation API how-to and the AI Custom Guardrail plugin documentation. Test OUTPUT guarding with a clean request and harmful response, then document the OpenAI /v1/moderations call, check_response behavior, category logging, and blocked-response logging. Done means the three guides cover configuration, validation, and logging.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, documentation, security
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100