CrewAI Guardrails
before_tool_call hook for multi-agent crew authorization
CrewAI orchestrates autonomous AI agent crews for complex tasks. APort integrates via CrewAI's native before_tool_call hook system, enforcing OAP policies before any tool in any crew member executes.
Quick Start
1. Create passport & config
npx @aporthq/aport-agent-guardrails crewai
2. Install guardrails package
pip install aport-agent-guardrails-crewai
3. Add to your code
from aport_guardrails_crewai import register_aport_guardrail register_aport_guardrail() crew.kickoff()
How It Works
Passport
Your agent gets an OAP passport declaring its identity, capabilities, and operational limits.
Evaluate
Before every tool call, the guardrail evaluates it against the passport's policy. Locally or via hosted API.
Decision
Allow or deny with structured OAP reason codes. Signed decisions create an auditable trail.
Frequently Asked Questions
How do CrewAI guardrails work?
APort registers a before_tool_call hook that runs before every tool execution across all agents in a crew. If the tool call violates the passport's policy, it's blocked before execution.
Does this work across all agents in a crew?
Yes. The hook is registered globally, so it applies to every agent in the crew regardless of role or task assignment.
Ready to secure your CrewAI agents?
Get started in under 2 minutes with a single command.