examples/crewai.mdRaw

CrewAI Integration Playbook

Govern CrewAI autonomous teams with AISentinel’s SDKs.

Installation

pip install aisentinel crewai

Basic Integration

from crewai import Crew, Agent, Task
from aisentinel.integrations.crewai import SentinelCrewGuard

crew_guard = SentinelCrewGuard.from_env()

researcher = crew_guard.wrap_agent(
    Agent(role="Researcher", goal="Compile safe executive summaries", backstory="Compliance analyst"),
)

summary_task = crew_guard.wrap_task(
    Task(description="Generate executive briefing", expected_output="Cited summary without PII"),
)

crew = Crew(agents=[researcher], tasks=[summary_task])
crew.kickoff()

Industry Templates

Healthcare

crew_guard = SentinelCrewGuard(rulepack="rulepacks/hipaa.yml", tenant_id="healthcare")
  • Blocks disclosure of PHI and triggers manual review if severity critical

Finance Automation

crew_guard = SentinelCrewGuard(rulepack="rulepacks/finra.yml", tenant_id="finance")
  • Prevents outbound wire instructions without two-factor confirmation

Performance Benchmarks

from aisentinel.testing import benchmark

stats = benchmark(crew, cases="./benchmarks/crewai.jsonl", guard=crew_guard)
print(stats.latency_p95)

Multi-Tenant Crews

crew_guard = SentinelCrewGuard.from_pool([
    {"tenant_id": "research", "rulepack": "rulepacks/research.yml"},
    {"tenant_id": "automation", "rulepack": "rulepacks/automation.yml"},
])

Assign tenant per crew to ensure compliance segregation.