Skip to content

feat: add CrewAI + SidClaw governance integration#359

Open
VladUZH wants to merge 1 commit intocrewAIInc:mainfrom
VladUZH:feat/crewai-sidclaw-integration
Open

feat: add CrewAI + SidClaw governance integration#359
VladUZH wants to merge 1 commit intocrewAIInc:mainfrom
VladUZH:feat/crewai-sidclaw-integration

Conversation

@VladUZH
Copy link
Copy Markdown

@VladUZH VladUZH commented Mar 31, 2026

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 works
    • crew.py — governed DevOps crew with three tools and different risk profiles
    • main.py — runnable entry point
    • requirements.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).

Adds a self-contained example showing how to wrap CrewAI tools with
SidClaw — an open-source approval and audit layer for AI agents.

The DevOps crew demonstrates three governance outcomes:
- check_service_health → allow (runs immediately, outcome traced)
- deploy_to_production → approval_required (waits for human sign-off)
- run_db_migration     → deny (blocked by policy, never executes)

govern_crewai_tool() is a one-line wrapper around any BaseTool that
evaluates SidClaw policies before execution and records outcomes to
a hash-chain audit trail.

sidclaw (PyPI) is Apache 2.0. Platform self-hostable via Docker.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant