CrewAI integration

Secure your multi-agent CrewAI systems with AIM. Get complete visibility, audit trails, and trust scoring for your entire crew - from individual agents to complex multi-agent workflows.

What you'll get

  • Crew-level verification for multi-agent system executions
  • Task-level verification for individual agent tasks
  • Complete audit trail of all crew and task executions
  • Dynamic trust scoring for AI agent crews
  • Automatic compliance reporting (SOC 2, HIPAA, GDPR)

Integration time: 5 minutes

Code changes: 3-5 lines

Difficulty: Beginner

Quick start (5 minutes)

Step 1: download SDK from AIM dashboard

Important: There is NO pip package for the AIM SDK. You must download it from your AIM dashboard with pre-configured credentials.

  1. 1. Login to AIM Dashboard → Settings → SDK Download
  2. 2. Click "Download Python SDK" (contains your credentials)
  3. 3. Extract the downloaded ZIP file
  4. 4. Install dependencies: pip install crewai keyring PyNaCl

Step 2: register crew agent

In AIM dashboard (running on http://localhost:8080):

  1. Navigate to Agents → Register New Agent
  2. Name: research-crew
  3. Type: AI Agent
  4. Copy the generated credentials
export AIM_URL="http://localhost:8080"
export AIM_AGENT_ID="your-agent-id"
export AIM_PRIVATE_KEY="your-private-key"
export OPENAI_API_KEY="your-openai-key"

Step 3: add AIM to your CrewAI crew

Before (unsecured)

from crewai import Agent, Task, Crew

# Define agents
researcher = Agent(
    role="Researcher",
    goal="Find accurate information",
    backstory="Expert researcher"
)

writer = Agent(
    role="Writer",
    goal="Write engaging content",
    backstory="Professional writer"
)

# Define tasks
research_task = Task(
    description="Research AI safety best practices",
    agent=researcher
)

write_task = Task(
    description="Write blog post about AI safety",
    agent=writer
)

# Create crew and run (no security, no audit trail)
crew = Crew(agents=[researcher, writer], tasks=[research_task, write_task])
result = crew.kickoff()

After (secured with AIM)

from aim_sdk import secure  # ← Line 1: Import AIM
from aim_sdk.integrations.crewai import AIMCrewWrapper
from crewai import Agent, Task, Crew

# Register with AIM
aim_agent = secure("research-crew")  # ← Line 2: Secure your crew

# Define agents (unchanged)
researcher = Agent(
    role="Researcher",
    goal="Find accurate information",
    backstory="Expert researcher"
)

writer = Agent(
    role="Writer",
    goal="Write engaging content",
    backstory="Professional writer"
)

# Define tasks (unchanged)
research_task = Task(
    description="Research AI safety best practices",
    agent=researcher
)

write_task = Task(
    description="Write blog post about AI safety",
    agent=writer
)

# Create crew
crew = Crew(agents=[researcher, writer], tasks=[research_task, write_task])

# Wrap with AIM
secured_crew = AIMCrewWrapper(crew, aim_agent)  # ← Line 3: Wrap crew

# Run crew - now secured with full audit trail!
result = secured_crew.kickoff()

That's it. Your CrewAI crew is now secured with:

  • Complete audit trail of every crew execution
  • Task-level tracking for each agent
  • Dynamic trust scoring (0-100%)
  • Security alerts for anomalous behavior
  • Automatic compliance reporting

What gets logged

Every crew execution is logged to AIM with:

  • Crew name: Identifier for the multi-agent crew
  • Agent roster: Which agents participated
  • Tasks executed: All tasks and their outputs
  • Task assignments: Which agent performed which task
  • Execution timeline: Start/end times for each task
  • Trust score: Crew's trust score during execution
  • Verification status: Whether execution was approved/denied

View in AIM dashboard

After running your CrewAI crew, visit the AIM dashboard to see:

  • Activity feed: Stream of crew executions
  • Task timeline: Visualize task execution flow
  • Agent performance: Track individual agent contributions
  • Trust score evolution: How crew trust changes over time
  • Security alerts: Any anomalous behavior detected
  • Audit logs: Complete compliance-ready audit trail

Advanced: task-level verification

For sensitive tasks, you can require explicit verification before execution:

from aim_sdk.integrations.crewai import AIMVerifiedTask

# Wrap sensitive tasks with verification
sensitive_task = AIMVerifiedTask(
    task=research_task,
    aim_agent=aim_agent,
    require_verification=True  # Blocks until verified in AIM dashboard
)

# Add to crew
crew = Crew(
    agents=[researcher, writer],
    tasks=[sensitive_task, write_task]  # First task requires verification
)

Multi-crew orchestration

Managing multiple crews? AIM tracks them all independently:

# Register multiple crews
research_crew_agent = secure("research-crew")
writing_crew_agent = secure("writing-crew")
editing_crew_agent = secure("editing-crew")

# Each crew gets its own audit trail and trust score
research_crew = AIMCrewWrapper(research_crew, research_crew_agent)
writing_crew = AIMCrewWrapper(writing_crew, writing_crew_agent)
editing_crew = AIMCrewWrapper(editing_crew, editing_crew_agent)

# Run crews - each independently tracked
research_result = research_crew.kickoff()
writing_result = writing_crew.kickoff()
editing_result = editing_crew.kickoff()

Next steps

Need help?

Questions about integrating AIM with CrewAI? Reach out through any of the channels below.