Guardrails

Guardrails check what is said to AI: every prompt, reply, tool result and tool call that passes through a Secure60 AI Protector. A guardrail policy sets what is checked in each direction and what happens to a finding: record it, mask it or block the call.

In the portal: Integrations → Secure60 Protector → Guardrail Policies

What a policy checks

Check Page
Personal data: names, email addresses, phone numbers, card numbers and other entity types Personal data and secrets
Secrets: API keys, tokens, private keys, connection strings, password assignments Personal data and secrets
Prompt injection and jailbreak attempts Prompt injection

A backend picks one policy, and a policy can guard many backends. A backend with no policy is proxied and recorded, not filtered. Backends are described in Applications and SDKs.

Monitor and Protect

Enforcement sets what a policy does with a finding:

Start every policy in Monitor. Review the findings on AI → AI Activity over a representative period, then switch one policy at a time to Protect. Every container in the Protector group applies the change on its next configuration poll, within 60 seconds.

The policy panel

A policy defines what is checked on the request and on the reply, and the action taken. A backend picks one policy; a policy can guard many backends.

Integrations with Guardrail Policies selected: two policies with type, enforcement, input and output filters, capture mode and the number of backends using each

A template fills every section of the policy with a known-good starting point; Monitor everything is the recommended starting point. The type matches the API the application calls (Anthropic, OpenAI or generic) and determines how the prompt and reply are read. Enforcement selects the behaviour: Monitor records the decision and lets the call through, Protect acts on it.

The Guardrail Policy panel: template picker, name, value, type and the Monitor/Protect enforcement toggle

Input is the prompt on its way to the model: personal data (mode, entities, score threshold), secrets, and prompt-injection detection with its phrase list and optional classifier, plus which parts of the request are scanned (user messages, tool results, earlier tool calls, the system prompt).

The Input section of the Guardrail Policy panel with PII mode, the entity checklist and score threshold

Output is the reply on its way back: personal data, secrets, whether tool calls the model emits are scanned, and how streamed replies are handled.

The Output section of the Guardrail Policy panel with PII, secrets, what is scanned and the streaming mode table

Audit is the policy’s capture mode — what the audit trail may carry — the number of characters of prompt and reply each audit event keeps (Max content characters, default 4,000), and whether token usage is recorded.

The Audit section of the Guardrail Policy panel: capture mode with the full, masked and summary table, max content characters, and the Record token usage switch

What is scanned

The Protector guards the whole exchange, not only the user’s prompt. Every turn of the conversation is checked and masked in place, so a long history stays protected turn by turn. Per policy and per direction:

Guardrails read more than the prompt. Per policy, per direction:

Rail Segment Default Why
Input user messages always what the person typed
Input tool results on data a tool returned that is now being sent to the model — it leaves for the third party too
Input earlier tool calls in the history off they were scanned when the model emitted them; re-scanning every turn repeats the finding
Input system prompt off your own text, rarely changes — turn it on if you worry about what was pasted into it (customer records, keys) or about an instruction planted in a prompt loaded from a store
Output reply text always what the model said
Output tool calls the model emits on the arguments of the action an agent is about to take — send_email(body=…), run("curl …") — the most direct way data leaves

Every violation row says which segment it was found in (violation_segment).

Streamed replies

Input guardrails always run on the complete prompt. For a reply the model streams token by token, each policy chooses how the output rail behaves:

Mode What happens Guardrails on the reply First token
passthrough-audit tokens forwarded as they arrive; the reply is assembled on the side and judged when the stream ends reported — never blocked or masked immediate
buffer the whole reply is fetched, guarded, masked or blocked, then replayed to your client as a stream fully enforced when the last token would have arrived
windowed text is guarded every 240 characters and released with the last 48 held back until more arrives; a block ends the stream with an error event masking enforced; a block stops the stream — what was already released stays released after the first window

auto (the default) picks buffer when the policy can block or mask on the output rail in protect mode, and passthrough-audit otherwise. A backend can override the mode for one route. Measured on a 300-word reply: windowed adds ~20 ms of inspection per window at ~7% CPU with no change to the time to first token; buffer’s cost is the model’s full generation time.

Try it

With the policy in Monitor, send one call with an email address through the Protector and read the decision headers:

curl -sk https://<protector>/proxy/<backend>/v1/chat/completions \
  -H "Content-Type: application/json" -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{"model":"gpt-4","messages":[{"role":"user","content":"escalate to a@bank.com"}]}' -D-

x-s60-decision: modified with x-s60-enforcement-mode: monitor means Protect would have masked the address. The call appears on AI → AI Activity → AI Audit Trail with its finding.

Back to top