Research Careers Contact

GlossaryGuardrails

Guardrails

Guardrails are the checks, limits and policies placed around an AI system to keep its inputs, outputs and actions within acceptable bounds. They block harmful or invalid results, restrict what the system can do and route risky cases to people.

How it works

Guardrails sit at several points in a system:

  • Input checks screen what goes into the model, such as filtering prompt injection attempts hidden in documents or web pages, removing sensitive data, or rejecting out-of-scope requests.
  • Output checks inspect what comes out, such as validating that a response matches a required schema, checking numbers against allowed ranges, confirming claims against source documents or filtering unsafe content.
  • Action limits control what an agent can do, such as which tools it can call, what data it can read or change, spending limits and step budgets.
  • Approval gates require human review before high-impact actions, such as placing orders or releasing a design.
  • Monitoring and logging record inputs, outputs and actions so problems can be found and traced.

Checks can be rules, such as regular expressions and schema validation, or models, such as classifiers that detect unsafe content. The OWASP Top 10 for LLM applications lists common risks guardrails address, including prompt injection, sensitive information disclosure, excessive agency and improper output handling. OWASP's separate Top 10 for agentic applications, published for 2026, covers risks specific to agents, such as goal hijacking, tool misuse and memory poisoning. NIST's Generative AI Profile and AI RMF Playbook describe related controls.

Guardrails vs model alignment

Alignment and safety training shape the model itself, so it behaves safely in more cases on its own. Guardrails are outside the model, in the software around it. Alignment reduces how often a model does something wrong. Guardrails catch and contain it when it does. A production system needs both, because no model behaves perfectly.

Why it matters

An AI system that can act, such as one that edits files, sends messages or changes production data, can cause real harm when it errs or is manipulated. Prompt injection, where instructions are hidden in content the model reads, is a known way to make a system misbehave. Guardrails limit the damage of any single mistake and make the system's behavior predictable enough to trust.

In engineering and manufacturing, many errors are checkable: a pin number that does not exist on the part, a quantity outside the order, a tolerance tighter than the process allows. Guardrails that run those checks automatically stop a model's error before it reaches a board. They are most effective when they use the same rules engineers already trust, such as design rule checks, approved parts lists and process limits.

How to get it right

  • Grant least privilege. Give each system only the tools and permissions its task needs.
  • Treat outside content as data. Never let text from documents, emails or web pages act as instructions.
  • Validate outputs. Check structure, ranges and references with deterministic code before using results.
  • Gate irreversible actions. Require approval for actions that cost money, change released data or leave the organization.
  • Log everything. Keep a record of inputs, outputs, tool calls and decisions, so any blocked or allowed action can be traced and the rule behind it reviewed.
  • Test the guardrails. Try to break them with adversarial inputs, and update them as new failure modes appear.

Guardrails in robotics and drone hardware

In manufacturing and design software, guardrails turn the engineering rules a team already uses into automatic checks: design rule checks before release, BOM checks against approved parts, limits on machine parameters and approvals for orders and changes. Robots running AI models in the field need guardrails too, such as speed and force limits, geofences, battery reserves and safety stops that act independently of the model.

Learn more