Govern CrewAI autonomous teams with AISentinel’s SDKs.
pip install aisentinel crewai
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()
crew_guard = SentinelCrewGuard(rulepack="rulepacks/hipaa.yml", tenant_id="healthcare")
criticalcrew_guard = SentinelCrewGuard(rulepack="rulepacks/finra.yml", tenant_id="finance")
from aisentinel.testing import benchmark
stats = benchmark(crew, cases="./benchmarks/crewai.jsonl", guard=crew_guard)
print(stats.latency_p95)
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.