GUARDRAIL

A rule or check, in the instructions or in code, that keeps an AI system from doing what it should not.

Zero retention: everything you type stays in this browser. Verify it yourself in DevTools.
Plain-language definition

What Does Guardrail Mean?

A guardrail is any rule or check that keeps an AI system inside safe limits. Some guardrails are written instructions, such as "never run destructive commands without asking" in an agent instructions file. Others are enforced by software outside the model: a permission prompt before a command runs, a filter that blocks certain outputs, a sandbox with no network access, or a test suite that must pass before a change is merged. Instructions guide the model; software guardrails hold even when the model ignores or misreads the instructions. Good setups use both, and rely on the enforced kind for anything that really matters.

Why Does Guardrail Matter?

Models follow instructions most of the time, not all of the time, and they can be misled by injected text. If deleting a database or pushing to production would be a disaster, a sentence in a prompt is not enough protection. Guardrails let you give an agent real work while capping how badly a mistake can go, which is what makes it reasonable to let them run longer without watching every step.

What Does Guardrail Look Like in Practice?

An AGENTS.md file says "Never run git push --force." That is a written guardrail. The team also configures their agent to require approval for any git push and runs it in a container with no production credentials. Those are enforced guardrails. If the agent misreads the file, the approval prompt still stops it. And if a push does slip through, branch protection on the server refuses the force-push anyway.

What Do People Get Wrong About Guardrail?

Writing "never do X" in a prompt does not make X impossible. It makes it less likely. Anything with real consequences needs a technical control, such as permissions, sandboxing or review, behind the instruction.

Which Terms Are Related?

  • Prompt injection: An attack where instructions hidden in content an AI reads trick it into acting against its user.
  • Agent loop: The repeated cycle of decide, act with a tool, observe the result, and decide again that makes an AI an agent.
  • Agentic workflow: A setup where an AI takes multiple steps on its own, using tools and checking results, rather than giving one reply.
  • Eval: A repeatable test set with a scoring method, used to measure whether an AI system does its job and catch regressions.
  • System prompt: The standing instructions an application gives a model before the conversation, setting its role, rules and format.

All 28 terms are in the AI glossary. For models side by side, see frontier vs open-weight.

Frequently Asked Questions

What guardrails should a coding agent have?

At minimum: no secrets in its environment it does not need, approval before destructive or irreversible commands, no direct pushes to the main branch, and a test suite it must run. Write these in the instructions and enforce the critical ones.

Are guardrails the same as content filters?

Content filters are one kind of guardrail, aimed at harmful text. For coding agents, the more important guardrails are about actions: what files, commands, networks and credentials the agent can reach.

Do guardrails make agents less useful?

Some friction, yes, but well-placed guardrails let you safely give agents more work. A common pattern is wide freedom inside a sandbox and strict approval for anything that leaves it.

Was this helpful?