Guardrails

Enforce safety rules and measure quality on what goes into and comes out of your agents.

Guardrails are the safety layer around an agent. The page has two parts: processors enforce rules on messages (moderation, PII, prompt injection), and scorers measure quality (toxicity, bias, hallucination) so you can see what happened.

Create a processor

  1. In the sidebar, open Content & memory → Safety.
  2. In the Guardrail processors card, click Create processor.
  3. Enter a Name, an optional Description, and a Processor kind (e.g. Moderation, PII detection, Prompt injection) — each kind's help text says whether it runs on input, output, or both.
  4. On the detail page, edit the draft version: set the Strategy, Threshold, and a Judge model if the kind needs one.
  5. Click Save draft, then Activate version to make it live.

Add a scorer

In the Scorers card, click Create scorer, give it a Name and a Built-in metric, then activate its version. Bind a scorer to a processor to log scores and reasons alongside enforcement.

Apply to an agent

Assign an active processor version to an agent version at the input or output stage; it then runs on every message at that stage.

Tip: Active versions are read-only. To change a live guardrail, use New draft from latest, edit the draft, and activate it — the previous version keeps running until you do.