Outside guardrails
Ask your own screening service about each model request, beside Intertrace's checks: a signed webhook you run, or Lakera Guard. Its answer can add a flag or a block; Intertrace still decides.
What it does
For every model request an agent sends through the gateway, Intertrace asks each outside guardrail you saved (up to three) at the same time as it runs its own request checks, and waits at most the time you set (300 ms by default, 1,000 ms at most). Its answer is one more signal, and it only ever adds:
| It answers | What happens |
|---|---|
| Clean | Nothing changes: the request is decided by Intertrace's checks as before. |
| Flag | The request goes through and is recorded as a flag (EXTERNAL_GUARDRAIL_FLAG), or is blocked (EXTERNAL_GUARDRAIL_BLOCK) when you chose to block on its flag. |
| Nothing in time (or an error, a redirect, an answer it can't read) | With block the request (the default) it is blocked with EXTERNAL_GUARDRAIL_UNAVAILABLE; with let it through it is decided as before and recorded unavailable. |
A clean answer never lets through anything Intertrace stopped or masked. An agent in Monitor records what a block would have been instead of blocking. Each decision record carries, per guardrail, its id, service, answer, time and whether it answered (external_guardrail), never the messages. Only owners and admins can choose to let requests through when a guardrail can't answer.
Set one up
- 1
Open Data & attacks
Open Policies → Data & attacks, then Advanced, and find Outside guardrails. - 2
Add a guardrail
Choose the service, its address, how long to wait, what a flag does and what to do when it can't answer. Save. - 3
Save its key
Paste the Lakera API key or your webhook's signing secret. It is sealed and never shown again; a guardrail without a key isn't called. - 4
Test connection
Sends one harmless message exactly as the gateway would and shows the answer and the time it took.
The signed webhook
Intertrace sends a POST with a JSON body:
POST https://guard.example.com/check
Content-Type: application/json
X-Intertrace-Timestamp: 1767225600
X-Intertrace-Signature: v1=<hex HMAC-SHA256 of "<timestamp>.<body>" with your signing secret>
X-Intertrace-Guardrail-Id: g-1a2b3c4d
{"version":"intertrace.external-guardrail.v1","phase":"request","request_id":"req-…","messages":[{"role":"user","content":"…"}]}Check the signature over the exact body bytes and refuse a timestamp more than five minutes old. Answer HTTP 200 with {"verdict":"flag"} or {"verdict":"clean"}. Anything else (another status, a redirect, another verdict, no answer in time) counts as unavailable.
Lakera Guard
Intertrace calls Lakera Guard's POST /v2/guard (by default https://api.lakera.ai/v2/guard) with your API key as a bearer token, the request's messages (roles Lakera doesn't list are sent as user), your project_id when you set one, and breakdown: false. It reads flagged. Lakera answers flagged only for a project in Enforce mode; in Detect mode it always answers false, so set the project to Enforce for its answers to count.