Page languageFrançaisEnglish
Teacher area
Laurent PoupetClaude trainer and artificial intelligence architectStudent area

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 , 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

Where this is taught

Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.

See the full program

All glossary terms

Trial lesson · 30 min · $20

Book (new tab)