agentgateway Jev guardrail example
An agentgateway example that scores prompts and responses for jailbreaks, harmful content and secret disclosure with Jev, rejecting anything scoring 2 or above with HTTP 403.
- Format
- Article
- Published by
- Community
- Last verified
- Oct 2026
Highlights
- Three scores run from 0 to 3, covering jailbreaks, harmful content and secret disclosure.
- guardrail.ts inspects the last request message and each response choice, calling Jev through agentgateway with the AI SDK.
- A score of 2 or higher is rejected with HTTP 403, and the demo proxies gpt-5.6-luna with a curl case that gets blocked.
- Jev runs against its native /v1/systemone API with passthrough: detect, so requests stay visible in the gateway.
Watch out
This is an example directory inside someone else's repository, not a maintained product, and it is three files: README.md, config.yaml and guardrail.ts. Running it means exporting both OPENAI_API_KEY and TYPESAFE_API_KEY, starting agentgateway -f config.yaml and then running ./guardrail.ts in a second terminal against a proxy on port 4000, so you need Bun, which installs dependencies automatically and needs --install=force if node_modules already exists, plus AI SDK 7.0.105 or later. Only the last request message and each response choice are inspected, so earlier turns are not re-checked, which matters for a jailbreak spread across a conversation. Evaluation errors block the request rather than failing open, so a Jev outage turns into 403s instead of passthrough. Questions and the threshold are edited by hand in guardrail.ts with no configuration surface, and the capture documents no false-positive rate for any threshold, no calibration data and no cost per request. Copy reviewed against the linked page on 2026-10-04.
Questions about this entry
More Jev resources like this
From the Jev guides
Original write-ups on what this entry is for.
From the Jev community
Posts from builders shipping with Jev right now.