ajshedivy/agno-cookbook/agno-guardrails
Claude Code and agent skill by ajshedivy/agno-cookbook
- community
Checking that the SKILL.md file is still in the repository.
Add input and output guardrails to Agno agents. Covers built-in guardrails (PII detection, prompt injection), custom guardrails, output validation, and moderation. Trigger this skill when: importing agno.guardrails, creating guardrail classes, adding pre_hooks or post_hooks, or asking "how do I add safety checks to my agent?"
Install
npx vskill@latest install ajshedivy/agno-cookbook/agno-guardrailsSKILL.md
The same SKILL.md was published earlier as ajshedivy/agno-cookbook/agno-guardrails.
Add Guardrails to Agno Agents
Use pre_hooks and post_hooks to validate inputs and outputs. Install with pip install agno.
Quick Start
Input Guardrails (pre_hooks)
Run before the agent processes a message. Raise InputCheckError to block:
Output Guardrails (post_hooks)
Run after the agent generates a response. Validate or transform output:
Built-in Guardrails
PII Detection
Prompt Injection Detection
Combining Multiple Guardrails
Custom Guardrail with Model-Based Checking
Use an LLM to classify inputs:
Handling Guardrail Errors
Anti-Patterns
- Don't forget `async_check` — both sync and async methods must be implemented
- Don't use expensive guardrails for every message — balance safety with latency
- Don't silently swallow errors — raise
InputCheckErrororOutputCheckErrorto block - Don't put business logic in guardrails — they're for safety and validation only
- Don't rely solely on guardrails — they complement, not replace, proper prompt engineering
Further Reading
For OpenAI moderation integration and advanced patterns, read references/api-patterns.md.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/agno-framework/skills/agno-guardrails/SKILL.md
Popularity
- Repository stars
- 4
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ajshedivy/agno-cookbook/agno-guardrails)