You wrote 'max 10 guests' in the prompt. The agent booked 15. LLMs treat rules as suggestions. Learn how to enforce business rules at the code level using Python hooks.
Developer Advocate
Hard guardrails with hooks that the LLM cannot override
Soft guardrails that guide the agent to self-correct
Version en espanol del blog de guardrails
Codigo completo con dataclasses + hooks
If you find it useful, give it a ⭐!
Research: combining symbolic and neural approaches
Research: how LLMs bypass instruction constraints