feat: add CrewAI + SidClaw governance integration
Summary
Adds a self-contained integration example showing how to wrap CrewAI agents with SidClaw — an open-source approval and audit layer for AI agents (Apache 2.0 SDK, PyPI: sidclaw).
The example is a DevOps crew with three governed tools, each demonstrating a different policy outcome:
| Tool | Classification | SidClaw decision |
|---|---|---|
check_service_health |
internal |
Allow — runs immediately, outcome traced |
deploy_to_production |
confidential |
Approval required — waits for human sign-off in dashboard |
run_db_migration |
restricted |
Deny — blocked by policy, tool never executes |
What's included
integrations/CrewAI-SidClaw/README.md— setup guide, expected output, how it workscrew.py— governed DevOps crew with three tools and different risk profilesmain.py— runnable entry pointrequirements.txt— crewai, sidclaw, python-dotenv.env.example— environment variable template
Integration pattern
from sidclaw import SidClaw
from sidclaw.middleware.crewai import govern_crewai_tool
client = SidClaw(api_key=os.environ["SIDCLAW_API_KEY"], agent_id="devops-crew")
governed_deploy = govern_crewai_tool(
DeployToProductionTool(),
client=client,
data_classification="confidential",
)
govern_crewai_tool() wraps BaseTool._run. Before execution: SidClaw policy engine evaluates the action (< 50ms). After: outcome is recorded to a hash-chain audit trace.
Why this is useful for CrewAI users
CrewAI agents that call deploy_to_production or run_db_migration take irreversible actions. This integration adds:
- Human approval checkpoints before high-risk tool calls
- Policy-based blocking (deny rules prevent restricted actions from running at all)
- Tamper-proof audit trail for every tool execution
The SDK is Apache 2.0. No credential changes required — SidClaw wraps existing tools in one line.
Testing
pip install -r requirements.txt
cp .env.example .env # add your keys
python main.py
Requires a SidClaw API key (free tier at app.sidclaw.com covers 5 agents).