Guardrails
Author the checks that inspect what reaches an agent, what it says, and what it sends to a tool — their kind, stage, action, and whether they are in force
A guardrail is one check: what it reads, what it does about a violation, and whether it is in force at all. Admin → Guardrails is where guardrails are defined. Open it with the Admin control in the top navigation bar, then choose Guardrails under Governance in the Admin sidebar.
Guardrails, Policies and Egress Allowlists are one plane: View policies, guardrails and egress opens all three read-only, and Manage policies, guardrails and egress changes them, tests a guardrail and attaches governance to an agent or a group. Platform Admin holds both, and a Member sees none of the three. Grant either through a role on the Access page.

Each row carries the guardrail's status, its kind, the stage it runs at, and what it does about a violation.
Two pages named Guardrails
The console also has a Guardrails page, and the two do different jobs:
| Page | What it is for |
|---|---|
| Console → Guardrails | The analytics — how often each guardrail fired, against what, and its false-positive rate. It also edits a guardrail's name, category and priority. |
| Admin → Governance → Guardrails (this page) | The definition — the kind of check, the stage it runs at, the action it takes, its per-kind configuration, and whether it is Active. |
Both list the same guardrails. The console page links here with Edit in Admin whenever you need to change what a control actually does.
What a guardrail is made of
Four choices decide a guardrail's behaviour. Everything else on the form is specific to the kind you chose.
Kind — what it looks for
The kind decides how the check is performed, and which configuration fields the form offers you.
| Kind | What it does |
|---|---|
| PII | Finds personal identifiers — email, phone, US Social Security number, payment card, IBAN. |
| Regex deny | Refuses anything matching your patterns. |
| Word deny | Refuses specific terms. |
| Secret scan | Finds API keys, tokens and private keys. |
| Link domain | Refuses a link unless every egress allowlist in force admits its host. |
| LLM judge | Asks a model your prompt about the payload. |
The five deterministic kinds cost no model call. LLM judge is the only kind that reaches a provider, which is why it is the only one that needs a model and a prompt.
Stage — which payload it reads
| Stage | What it inspects |
|---|---|
| Input | What reaches the agent — the user's question, or another agent's message. |
| Output | What the agent is about to say or record. |
| Tool call | The arguments the agent is about to send to a tool. |
Stage matters more than it looks. A guardrail named "mask contact details" that only ever reads the question fires on nothing and reports compliance — the shape this plane exists to remove. If the rule is about the answer, set the stage to Output.
Action — what it does about a violation
| Action | Effect |
|---|---|
| Block | Stops the turn. |
| Warn | Lets the turn continue and leaves a record. |
| Redact | Substitutes what it found and continues. |
Redact is offered only for the kinds that can return the spans to substitute — PII, Regex deny, Word deny and Secret scan. Link domain and LLM judge return a verdict, not spans, so the form hides Redact when one of those is selected, and steps a chosen Redact back to Block.
Status — whether it is in force
A guardrail is Draft or Active. Only an Active guardrail is evaluated: a draft can be authored, listed and attached to an agent while checking nothing. That is deliberate — it is how you stage a control before it governs anyone — but it also means a plane full of drafts reports coverage it does not have. The page states the count above the list when any guardrail on it is still a draft.
New guardrails are offered as Active.
Create a guardrail
Select New guardrail. The editor opens as a sheet on the right.
Give it a Name and a Description. The name is how the guardrail is identified in the guardrail analytics and in this list, so name it after the rule rather than the mechanism.
Choose the Kind, then the Stage and the Action. Each control shows a one-line explanation of the current choice beneath it.
Fill in the configuration the kind needs — the form offers only the fields that kind actually reads.

Choosing PII replaces the configuration area with the entity checkboxes; choosing another kind replaces it again.
Leave Status on Active and select Create guardrail.
Switching kind mid-edit clears the fields the new kind does not read. The server refuses a field its kind does not use, so the form drops them rather than letting you submit a request that would be rejected for naming a control the form has stopped showing.
Configuration by kind
| Kind | Fields the form offers |
|---|---|
| PII | Entities to look for — any of Email address, Phone number, US Social Security number, Payment card, IBAN. An active PII guardrail needs at least one. Plus Replacement, when the action is Redact. |
| Regex deny | Patterns — Python regular expressions, at most 25, each at most 200 characters. Plus Replacement, when the action is Redact. |
| Word deny | Words — at most 500, each at most 100 characters. Match case exactly. Where a word may appear. Plus Replacement, when the action is Redact. |
| Secret scan | Replacement, when the action is Redact. Nothing else — the detectors are built in. |
| Link domain | None. It compares links against the egress allowlists in force on whatever it is attached to. |
| LLM judge | Judge model — a chat model or a decision model your tenant has connected — and Prompt. With a decision model, also Acts at, Review model and Review from (below). |
Word matching
Where a word may appear has two settings, and neither is free:
- Whole words only (the default) does not match inflections. A list containing
refunddoes not catchrefundsorrefunding. Add the forms you mean. - Anywhere inside a word catches inflections, and also matches inside unrelated words — a list containing
classthen refuses an answer that mentions classical or classify. Profanity lists are where this bites hardest, because so many short offensive words are substrings of ordinary ones.
Which error is cheaper depends on your own vocabulary.
Regular expressions
Patterns are Python regular expressions, so Python's syntax works, such as (?i) for case-insensitive matching and (?P<name>…) for a named group. They are checked when you save: a pattern that does not compile, or that repeats a group without a bound (the shape that can stall a turn on a crafted input), is refused on the Patterns field with a reason naming the pattern, and nothing is saved: (?:all |any |your )* will not save.
A counted repeat is written out in full when a pattern runs, so x{2000000}, ten characters long, would build two million elements. A pattern may build at most 1,000. A repeat counts one for itself, and its body once more than it must repeat at the least, so x{998} builds exactly 1,000. Nested counts multiply, and repeats side by side add up. Under full case folding ((?fi)), a wide character class counts as the many strings it folds into. [A-Z0-9]{10,30} builds a few dozen, and x{1000}y{1000} will not save. Lower the count, or use + or *. The same check applies when you Test a guardrail or Duplicate & edit one.
Link domain needs an allowlist
A Link domain guardrail carries no hosts of its own. Attach it to a subject that also carries an egress allowlist. With no allowlist in force it cannot be evaluated at all, and it stops the turn under its own name rather than passing quietly.
An LLM judge on an agent needs its own judge model
An LLM judge with no Judge model falls back to your tenant's guardrail routing stage, and only a person's question is routed. An agent's beat is not, so there such a judge cannot be evaluated: every beat stops, or, at the Tool call stage, every tool call is refused. It therefore cannot be attached to an agent, directly on the agent's Guardrails tab or through a policy the agent carries. Adding one to a policy an agent carries, or leaving a guardrail an agent carries as a judge with no Judge model, is refused the same way, naming the agents. Choose a Judge model first.
An agent that already carries one keeps it, and the history of each of its runs names the guardrail. Choose that guardrail a Judge model here, or detach it from the agent.
An LLM judge on a decision model
A Judge model can be a decision model, such as TypeSafe's Jev. It writes no verdict or reasoning. It answers how likely it is that the payload breaks your Prompt, as a probability from 0 to 1, and that probability decides:
- At or above Acts at (0.7 unless you set it), the guardrail acts: it blocks or warns.
- From Review from up to Acts at (Review from is 0.3 unless you set it), the Review model judges the payload as a chat judge would, and its verdict decides. This band exists only when you choose a Review model.
- Below that, the guardrail passes. Without a Review model, everything below Acts at passes.
The Review model is one of your chat models. It also judges a decision judge whose model gives no answer, whether from an error, a timeout or a payload too long for it. Without a Review model, or when it fails as well, the guardrail cannot be evaluated and stops the turn under its own name, as any judge does.
Every decision judge of one stage that names the same model is asked in one request, which keeps the check fast. A decision model answers each rule separately, so batching changes no answer.
Text written to steer a decision model can move its answer. A decision judge is not a defence against an attacker. For a judge that blocks, choose a Review model, so an uncertain answer is judged a second time by a chat model.
What a decision judge reads is processed under your own agreement with TypeSafe. The audit record of each verdict names the probability, the Acts at it was measured against, the versioned model that answered and, when one decided, the Review model. In an agent's run history, a decision judge that fired names its probability and model. Its calls in a beat are charged to the project's budget at the model's own rates.
Test a guardrail before it governs anything
Every row has a flask icon, and the editor has a Test button. Both open a drawer that runs a sample payload through that one guardrail exactly as a live turn would. The definition travels by value, so you can test a draft you have not saved yet.

The drawer reports the verdict, why it fired, and what the agent would actually see.
The result has three parts:
- The verdict — Allowed or Blocked, the action taken, and how many spans were redacted.
- Why — every span the detector matched, and every near miss: a candidate that had the right shape and failed the check behind it, such as a card-shaped number that fails its checksum. This is the only place that answers "I pasted something that looks like a card number and it says Allowed".
- What the agent would see — the payload after redaction, the note that nothing changed, or the statement that the turn is refused.
For a judge on a decision model, Why also shows the probability, the thresholds, and which band decided: acted, passed, or handed to the Review model.
Nothing in the test drawer is stored or audited. The excerpts are sliced out of the sample you typed, and they locate exactly the content a Redact guardrail exists to keep out of the audit trail.
If the guardrail cannot be evaluated at all, the drawer says Could not be evaluated rather than reporting a pass. An unevaluable control is not a clean payload, and a live turn stops there too.
Guardrails that ship with AskRAI
Every tenant is seeded with a catalog of platform guardrails, marked with a Platform badge. They are read-only here: the server refuses an edit or a delete, so the editor shows the fields for inspection and offers no Save.

A platform guardrail is inspectable but not editable — Duplicate & edit is how you change one.
To change a platform guardrail, select Duplicate & edit. The server clones it as an editable tenant copy, and the editor stays open on the copy. The copy is created as a Draft, so review it and set it Active to put it in force.
Seeding a tenant changes no traffic on its own. A platform guardrail governs a turn only once something attaches it — directly, or through a policy.
Find a guardrail
The list shows ten guardrails per page. The search box searches the whole tenant on the server, not just the page you are looking at, so a guardrail on page three is reachable by name. Use the pagination control beneath the list to move between pages.
Edit or delete a guardrail
Select any row to open it. Change what you need and select Save changes; the editor warns you before discarding unsaved edits.
Delete is on the left of the editor footer and asks for confirmation. Deleting is permanent, and the confirmation states the consequence plainly: the guardrail stops governing every agent and group it is attached to.
What the editor refuses
The editor checks a definition before the round trip and names the reason, rather than surfacing an error you have to re-read the form to interpret. Most of these are also refused by the server; the judge-model rule is the editor's own.
| Refusal | Why |
|---|---|
| A non-judge guardrail with a prompt | Only LLM judge reads a prompt. Leave it empty, or change the kind. |
| Redact on Link domain or LLM judge | Those kinds return a verdict, not the spans to replace. |
| An active LLM judge with no prompt | The prompt is the whole of what the model is asked. |
| An active LLM judge with no Judge model | Choose one. The server would accept the row and fall back to your tenant's guardrail routing stage on a person's question, but no agent could carry it (why), and the editor asks you to be explicit. Connect a provider first on Model Providers if the list is empty. |
| An active PII guardrail with no entity | There is nothing for it to look for. |
| An active Regex deny or Word deny with an empty list | There is nothing for it to match. |
| A blank entry in a pattern or word list | A blank entry matches everything. |
| Acts at, Review model or Review from on a judge whose model is not a decision model | They decide nothing there. Changing the Judge model to a chat model clears them. |
| Acts at outside 0 to 1, or 0 | A judge that acts at 0 acts on everything. |
| Review from above Acts at, or without a Review model | There would be no band for a Review model to judge. |
| An active judge whose Review model your tenant cannot reach | It would fail on the first uncertain answer. |
An incomplete definition cannot be tested whatever its status: the Test button checks the definition as though it were Active, because a test of a control that could not run answers nothing. A draft may still be saved incomplete — that is what a draft is for.
Field reference
| Field | Notes |
|---|---|
| Name | Required. Up to 120 characters. |
| Description | Optional. Up to 500 characters. |
| Kind | One of the six kinds above. Defaults to PII on a new guardrail. |
| Stage | Input, Output or Tool call. Defaults to Input. |
| Action | Block, Warn or Redact. Defaults to Block. Redact is offered only for redactable kinds. |
| Judge model | LLM judge only. A chat model or a decision model your tenant has connected. |
| Acts at | Decision judge only. From above 0 up to 1. Defaults to 0.7. |
| Review model | Decision judge only, optional. One of your chat models. |
| Review from | Decision judge with a Review model only. From 0 up to Acts at. Defaults to 0.3. |
| Prompt | LLM judge only. What the model is asked about the payload, up to 10,000 characters. |
| Entities to look for | PII only. |
| Patterns | Regex deny only. At most 25, each at most 200 characters. |
| Words | Word deny only. At most 500, each at most 100 characters. |
| Match case exactly | Word deny only. Off by default. |
| Where a word may appear | Word deny only. Whole words only, or anywhere inside a word. |
| Replacement | Redactable kinds, action Redact only. The text substituted for what was found, at most 40 characters. |
| Status | Draft or Active. Only Active is evaluated. |
Category and priority are not set here. They belong to the analytics view and are edited on the console Guardrails page.
Guardrails created before the governance plane
A guardrail written before this plane existed carries none of these fields, so it keeps the original behaviour: an LLM judge running at the Input stage that Blocks, and is Active. Those rows appear in this list alongside the rest and can be opened and given a kind, a stage and an action like any other — with one extra step, because an active judge carries no Judge model either: choose one before Save changes will enable. Until it has one it cannot be attached to an agent, and an agent that already carries it cannot evaluate it on any beat (why).
Related pages
Policies
Bundle guardrails with the ceilings an agent runs under, and attach the result.
Console Guardrails
Fire rates, compliance trend and false positives for the guardrails defined here.
Guardrails concept
Where guardrails sit in the query pipeline, and what they can and cannot enforce.
Model Providers
Connect the provider an LLM judge needs before it can be set Active.
Egress Allowlists
The host list a Link domain guardrail compares against.
Policies
Bundle guardrails with the ceilings an agent runs under — autonomy, actions per beat, tool calls per beat and approval requirements — and attach the result to an agent, or to a group to guard its members' queries
Egress Allowlists
Write down the hosts an agent's tools may be dialled at, check a host against the list before saving, and attach the result to an agent or a policy