Explainer

What are AI guardrails?

AI guardrails are run-time controls that check what goes into and comes out of a model, and what an agent is allowed to do. They enforce policy in code.

By iFortis Worldwide ResearchPublished Updated 3 min read

On this page

SummaryAI guardrails are run-time controls placed around a model or agent that check inputs, outputs and actions against policy, and block, change or escalate anything outside it. They turn written rules into something the system enforces on every request.

Controls that run with every request

Guardrails are checks that sit around a model. They are separate from the model and from the prompt. A prompt asks the model to behave. A guardrail verifies that it did, and steps in when it did not.

That separation is the point. Models are probabilistic and can be misled. A control that depends on the model following instructions is weaker than one that inspects the result independently.

Where they sit

  • Input guardrails. Screen what reaches the model: personal data that should be masked, attempts at prompt injection, topics the system is not meant to handle.
  • Retrieval guardrails. Make sure the model only sees documents the requester is entitled to see.
  • Output guardrails. Check the response: format, banned content, leaked secrets, claims not supported by the sources.
  • Action guardrails. Check tool calls before they run: is this agent allowed to do this, for this amount, on this record.

For agents, the last category matters most. A poor sentence can be corrected. A wrong payment may not be recoverable.

How they are built

Guardrails use a mix of techniques. Rules and pattern matching catch fixed things such as account numbers. Schema validation rejects malformed output. Classifiers detect categories such as toxicity or injection attempts. A second model can act as a judge and assess whether an answer is grounded in its sources. Policy engines evaluate actions against authority limits.

Deterministic checks are preferable where they are possible. They are fast, cheap and predictable. Model-based checks cover what rules cannot express, and they carry their own error rate, which needs measuring.

What they cannot do

Guardrails reduce risk. They do not remove it. A classifier will miss some attacks and block some legitimate requests. A grounding check can pass an answer that is supported by a source that is itself wrong. Guardrails also cannot fix a poor design. If an agent holds more access than it needs, filters on its output are a thin defence. They work as one layer alongside least privilege, evaluation and human review.

Design errors to watch for

  • Relying on instructions in the system prompt and calling that a guardrail.
  • Setting filters so tight that users are blocked on normal work and find another tool.
  • Adding checks without measuring their false positive and false negative rates.
  • Guarding the chat interface and leaving the API and batch routes open.
  • Blocking silently, so the user gets no explanation and the team gets no log.
  • Forgetting latency. Five sequential checks can double the response time.

Putting the first set in place

List the specific harms for the use case: data exposure, wrong advice, unauthorised action. Write one control per harm and decide whether it blocks, rewrites or escalates. Implement the deterministic ones first. Build a test set of cases that should pass and cases that should fail, and run it on every change. Log every trigger and review the log weekly in the first months, since it shows both attacks and overblocking. The broader approach is under AI security, trust and governance.

Questions worth asking the delivery team

  • Which harms does each guardrail address, and which harms have none?
  • What share of legitimate requests is blocked?
  • Are actions checked before execution, or only reported after?
  • Who reviews guardrail triggers, and how often?
  • Do the same controls apply on every route into the system?

All insights RSS feed

Tell us the outcome you need

The first meeting is a working session about your situation, with an engagement lead, not a sales call.

Contact us Submit an RFQ