Input and output guardrails

Input and output guardrails are the checks on either side of a model call. Input guardrails screen what goes in, output guardrails screen what comes back, and agents add a third check on tool calls.

Input guardrails

They run before the model call, on the user's message and on anything else that goes into the prompt, such as retrieved documents and files. They look for:

A request blocked here never reaches the model.

Output guardrails

They run after the model writes and before the reply reaches the user. They look for:

  • Leaks: the system prompt, secrets, another user's data.
  • Fabricated facts (hallucination).
  • Unsafe content.

An input check cannot replace this one: a harmless prompt can still produce a harmful answer.

Tool calls

An agent's output is often an action: a shell command, a piece of code, an API call. The call is checked with its arguments before it runs, because afterwards is too late. See guardrails for tool calls.

With White Circle

Control analyzes every input and output in real time, detects PII before the model call, and checks tool calls before they run.

Train your own models

Post-train any Hugging Face model with Halo. Up to 4× faster than TRL