Skip to main content
Deploy the integrations/verra FastAPI wrapper on any public HTTPS host — TrueFoundry, Docker, Render, ECS, Cloud Run, or on-prem. The gateway calls it at llm_input / llm_output via the Custom Guardrail contract; the wrapper forwards traffic to Verra and returns verdict JSON on HTTP 200.
Source repository: truefoundry/integrations-custom-guardrails/integrations/verra/. It contains the Dockerfile, deploy script, and tests referenced below.

What is Verra?

Verra is a managed AI governance product for regulated industries (healthcare, finance, insurance). Every request gets scanned by Verra’s detection pipeline — prompt injection, jailbreak, PII, secrets, exfiltration, policy violations — and recorded in a SOC 2 / HIPAA / EU AI Act compliant audit trail. This integration is a FastAPI proxy. It forwards every TF guardrail request to api.helloverra.com/v1/truefoundry/* authenticated with your Verra API key. Detection runs in Verra’s backend; the wrapper translates the TF contract so you can deploy it inside your own infrastructure.
If you don’t want to deploy a wrapper at all, you can point the gateway directly at https://api.helloverra.com/v1/truefoundry/* with your Verra bearer in Custom Bearer Auth.

Key features on TrueFoundry

  1. Input validation — blocks prompt injection, jailbreak, exfiltration attempts, and policy violations before the model runs.
  2. Input mutation — masks PII and secrets in the prompt before it reaches the model.
  3. Output validation — blocks secrets and policy violations in the model response.
  4. Output mutation — masks PII and secrets in the model response.
  5. Audit trail — every guardrail decision is recorded in your Verra dashboard with TF user and metadata mapped to Verra receipts.
Wire all four rails in the gateway for full coverage. If you wire only scan-input, secrets and PII in prompts will pass through unmasked.

Architecture

Receipts appear in your Verra dashboard at app.helloverra.com/admin/receipts tagged event_type='truefoundry_guardrail', with the TF user mapped to end_user_id and TF metadata namespaced under findings.truefoundry.*. The wrapper always returns HTTP 200 and signals the policy decision in the JSON body. Infrastructure failures return HTTP 5xx. See Custom guardrail response contract.

Response contract

A policy deny is never a 4xx — it’s a 2xx with verdict: false. Verra’s backend honors this; the wrapper passes it through unchanged.

Wrapper endpoints

GET / and GET /health — open health checks. GET /debug/loaded-config — bearer-gated diagnostics. All POST routes expect Authorization: Bearer <WRAPPER_API_KEY>.

Prerequisites

  • VERRA_KEY — your Verra TrueFoundry integration token. Email support@helloverra.com to request one.
  • WRAPPER_API_KEY — a random string you generate; the gateway sends it as Authorization: Bearer … when calling the wrapper. Independent from VERRA_KEY.
  • Public HTTPS URL for the deployed wrapper (any host the gateway can reach).

Setup

1

Clone and configure

.env
Generate WRAPPER_API_KEY with python -c "import secrets; print(secrets.token_urlsafe(32))". The gateway will send this value as Authorization: Bearer … when calling the wrapper.
2

Deploy the wrapper

Local:
Smoke test:
Docker or any cloud host:Build and run the container on ECS, Cloud Run, Kubernetes, Render, or any platform with a public HTTPS URL. Put TLS in front of the service; the gateway must reach paths such as https://<host>/scan-input.
Set TFY_WORKSPACE_FQN, TFY_PUBLIC_HOST, TFY_PUBLIC_PATH, and secret FQNs in .env. Create secrets verra-key and wrapper-api-key under group verra-guardrails-tfy in Platform → Secrets, then:
3

Register Custom Guardrail configs

AI Gateway → Guardrails → + Add New Guardrails Group → type Custom.
  • Group name: verra
  • Add four configs — one per wrapper path (or start with input validate only).
Input validate example:
TrueFoundry custom guardrail form: Validate, Request target, /scan-input URL, Authorization Bearer header

Verra Custom Guardrail configuration (input validate)

Register the remaining configs:Auth Data → Custom Bearer Auth works the same as Headers if you prefer not to set headers manually.
4

Attach to traffic

Model pin: AI Gateway → Models → <model> → Guardrails → attach group verra.Per requestX-TFY-GUARDRAILS header, selector format <group>/<config-name>:
For hard blocks only (no PII masking), omit the redact-* configs. For full coverage including PII/secrets masking, wire all four.
5

Verify

Call the wrapper directly:
Expect {"verdict": false, "message": "..."} when Verra blocks, or {"verdict": true} when allowed (depends on your Verra org-level enforcement mode).
Confirm loaded routes and configuration.

Custom config (optional)

The config field the gateway passes to the wrapper is forwarded to Verra unchanged. Recognized keys (all optional; redact rails default both to true):
Verra’s org-level enforcement mode (observe / govern / enforce) is the source of truth and cannot be overridden by config.

Troubleshooting

The Authorization: Bearer … value the gateway sends doesn’t match the wrapper’s WRAPPER_API_KEY env var. Three places must agree:
  1. The secret or env var on the deployed wrapper.
  2. The Custom Guardrail Config’s Headers or Auth Data → Custom Bearer Auth field value.
  3. Any platform secret FQN referenced at deploy time.
If the dashboard value drifts from the deployed secret, re-paste the current value into the guardrail config.
The wrapper signals rail decisions via {"verdict": false} on HTTP 200. If the gateway returns a normal completion when the wrapper reported a block, your tenant gateway may not be honoring the verdict field. Confirm by curling the wrapper directly — if you get 200 + {"verdict": false} but the gateway still returns a completion, the gateway is the issue.Workaround: switch the Custom Guardrail Configs’ Enforcing Strategy to Enforce. See Enforcing Strategy.
You likely registered only validate rails. Add /redact-input and /redact-output as Mutate configs and attach them to your model or per-request selectors.
Check wrapper logs for upstream errors to api.helloverra.com. Verify VERRA_KEY is valid and not expired. With Enforce But Ignore On Error, transient outages pass through; use Enforce for fail-closed behavior.

Reference