Agents & tools
Guardrails
Definition
Guardrails are the constraints that keep an AI system inside acceptable behaviour — input validation, output filtering, topic restrictions, action limits and human approval gates.
Guardrails operate at several layers. Input guardrails screen prompts for injection attempts and disallowed requests. Output guardrails check responses before they reach a user or a downstream system. Action guardrails restrict what tools an agent may invoke and under what conditions.
Prompt-level instructions alone are not guardrails. They are advisory, and determined users route around them. Real guardrails are enforced in code outside the model: validating arguments, checking permissions, requiring approval for irreversible actions.
The design question worth asking for any autonomous system: what is the worst action it can take unsupervised, and is that acceptable?
Related terms
Prompt injection
Prompt injection is an attack where malicious instructions hidden in content the model processes override the developer's intended behaviour. It is the most serious unsolved security issue in LLM applications.
AI agent
An AI agent is a system where a model plans and takes actions through tools in a loop, rather than producing a single response. It decides what to do next, does it, observes the result, and continues until the goal is met.
System prompt
A system prompt is a standing instruction that shapes a model's behaviour across an entire conversation, separate from individual user messages. It typically defines persona, rules, tone and output format.
Human in the loop
Human in the loop means inserting a person at decision points in an automated workflow — typically to approve consequential actions or review low-confidence outputs before they take effect.
ReAct pattern
ReAct (Reason + Act) is the core agent loop: the model reasons about what to do, takes an action via a tool, observes the result, then reasons again. It repeats until it can answer.
MCP (Model Context Protocol)
MCP is an open standard for connecting AI models to external tools and data sources. It replaces bespoke per-integration code with one protocol any compatible client can use.
Put this into practice
Understanding the term is step one. Our free courses and tools let you actually use it.