Skip to content

Proposal: Governance Guardrails Plugin for CrewAI #4502

@imran-siddique

Description

@imran-siddique

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 hookson(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:

  1. GovernancePolicy — Declarative policy with YAML import/export, validation, diff/comparison
  2. PatternType enum — Blocked patterns with substring, regex, and glob matching (pre-compiled)
  3. GovernanceEventType hooksPOLICY_CHECK, POLICY_VIOLATION, TOOL_CALL_BLOCKED, CHECKPOINT_CREATED
  4. Semantic intent classifier — Classifies actions into 9 threat categories (destructive, exfiltration, privilege escalation, etc.)
  5. Trust scoring engine — 5-dimension trust scores with decay modeling
  6. 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:

  1. Start with a minimal before_task_execute / after_task_execute hook PR
  2. Or build a standalone crewai-guardrails package that integrates via CrewAI's existing callback system

Would love feedback from maintainers on the preferred approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions