Proposal: Governance Guardrails Plugin for CrewAI
Problem
CrewAI excels at multi-agent orchestration with roles and tasks, but currently lacks a built-in governance/guardrails layer for enforcing safety policies on agent actions. As agent autonomy grows, organizations need:
- Policy enforcement — Cap token usage, limit tool calls, block dangerous patterns (regex/glob-aware)
- Event hooks —
on(POLICY_VIOLATION, callback) for logging, alerting, circuit-breaking
- Trust-gated delegation — Verify agent trust scores before allowing inter-agent handoffs
- Audit trails — Tamper-evident logging with Merkle chain hashing
What we've built (Apache-2.0)
We've been developing AgentMesh and Agent-OS with production-grade governance features:
GovernancePolicy — Declarative policy with YAML import/export, validation, diff/comparison
PatternType enum — Blocked patterns with substring, regex, and glob matching (pre-compiled)
GovernanceEventType hooks — POLICY_CHECK, POLICY_VIOLATION, TOOL_CALL_BLOCKED, CHECKPOINT_CREATED
- Semantic intent classifier — Classifies actions into 9 threat categories (destructive, exfiltration, privilege escalation, etc.)
- Trust scoring engine — 5-dimension trust scores with decay modeling
- Merkle audit chains — Tamper-evident, offline-verifiable execution logs
Proposed integration
We'd contribute a crewai-guardrails plugin (or PR to core) that wraps CrewAI's task execution with governance hooks:
`python
from crewai import Crew, Agent, Task
from crewai_guardrails import GovernancePolicy, GuardedCrew
policy = GovernancePolicy.load("policy.yaml")
crew = GuardedCrew(
agents=[researcher, writer],
tasks=[research_task, write_task],
policy=policy, # Enforced on every agent action
)
crew.on("policy_violation", lambda e: alert(e))
result = crew.kickoff()
`
Why this matters for CrewAI
- Enterprises adopting CrewAI need governance before production deployment
- No existing CrewAI extension provides this
- Our code is Apache-2.0, battle-tested (700+ tests), and framework-agnostic
- Aligns with CSA's Agentic Trust Framework direction
Ask
Is there interest in this kind of contribution? Happy to:
- Start with a minimal
before_task_execute / after_task_execute hook PR
- Or build a standalone
crewai-guardrails package that integrates via CrewAI's existing callback system
Would love feedback from maintainers on the preferred approach.
Proposal: Governance Guardrails Plugin for CrewAI
Problem
CrewAI excels at multi-agent orchestration with roles and tasks, but currently lacks a built-in governance/guardrails layer for enforcing safety policies on agent actions. As agent autonomy grows, organizations need:
on(POLICY_VIOLATION, callback)for logging, alerting, circuit-breakingWhat we've built (Apache-2.0)
We've been developing AgentMesh and Agent-OS with production-grade governance features:
GovernancePolicy— Declarative policy with YAML import/export, validation, diff/comparisonPatternTypeenum — Blocked patterns with substring, regex, and glob matching (pre-compiled)GovernanceEventTypehooks —POLICY_CHECK,POLICY_VIOLATION,TOOL_CALL_BLOCKED,CHECKPOINT_CREATEDProposed integration
We'd contribute a
crewai-guardrailsplugin (or PR to core) that wraps CrewAI's task execution with governance hooks:`python
from crewai import Crew, Agent, Task
from crewai_guardrails import GovernancePolicy, GuardedCrew
policy = GovernancePolicy.load("policy.yaml")
crew = GuardedCrew(
agents=[researcher, writer],
tasks=[research_task, write_task],
policy=policy, # Enforced on every agent action
)
crew.on("policy_violation", lambda e: alert(e))
result = crew.kickoff()
`
Why this matters for CrewAI
Ask
Is there interest in this kind of contribution? Happy to:
before_task_execute/after_task_executehook PRcrewai-guardrailspackage that integrates via CrewAI's existing callback systemWould love feedback from maintainers on the preferred approach.