Category · Security and compliance
What is a guardrail?
A guardrail is a check placed in the code that stops an agent from taking an unwanted action. It can be a list of allowed actions, a filter or a mandatory approval. Wrongful refusals are monitored too.
By Laurent Poupet, Claude trainer and artificial intelligence architect · Updated
How it works
- There are input guardrails, which filter the request, action guardrails, which allow or block a tool, and output guardrails, which check the answer.
- The most reliable ones are deterministic, written in code, such as a list of allowed actions; a model-based filter complements them without replacing them.
- On Azure, the content filters and prompt attack detection of Azure AI Content Safety provide ready-made guardrails for inputs and outputs.
The trap to avoid
The trap is a guardrail that is too strict and blocks legitimate requests; false refusals are therefore measured too, not only the attacks stopped.
Related terms
- PromptModels and how they work
- Prompt injectionSecurity and compliance
- Human approval (human in the loop)Security and compliance
Where this is taught
Track 3 · Skills, agents and connectors
Evaluate and harden an agentlesson 10 · 1 hourTrack 0 · Preamble: Claude on your computer
Discover Computer Control (Computer Use) and Its Safeguardslesson 5 · 1 hour
Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.