Integration Guide

CrewAI

Connect CrewAI to OSuite and get your first governed action into /decisions in under 20 minutes.

Instance URL detected: https://studio.osuite.ai

Governance context

Runtime class

Code-First Single-Agent Runtime

A self-built agent where the customer owns the orchestration code and can add guard calls directly.

Recommended surfaces

Embedded Runtime SDK / Package

Instrument customer-controlled runtimes, tools, and orchestrators from inside the code.

Control Plane

Run policy, approvals, replay, and evidence management as the operator system of record.

Typical governance range

Advisory Governance -> Approval-Orchestrated Governance -> Runtime-Enforced Governance

Self-host and future SaaS are deployment model choices for the OSuite control plane. They do not determine governance level by themselves.

1

Deploy OSuite

Get a running instance. Click the Vercel deploy button or run locally.

Already have an instance? Skip to Step 2.

2

Install the OSuite Python SDK and CrewAI

Create a virtual environment and install the required packages. Requires Python 3.10+ (Python 3.14+ is not supported by CrewAI).

Terminal

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install osuite==2.6.0 crewai==1.11.0 python-dotenv
3

Set environment variables

Create a .env file with your OSuite connection details. No LLM API key required for the example.

.env

OSUITE_BASE_URL=https://studio.osuite.ai
OSUITE_API_KEY=<your-workspace-api-key>
4

Create a governed CrewAI tool with the @tool decorator

The @tool decorator creates a CrewAI tool. Inside the function, call OSuite guard before executing, then record the action and outcome.

main.py

from crewai.tools import tool
from osuite import Osuite
import os

claw = OSuite(
    base_url=os.environ["OSUITE_BASE_URL"],
    api_key=os.environ["OSUITE_API_KEY"],
    agent_id="crewai-analyst-agent",
)

@tool("Analyze Customer Data")
def analyze_customer_data(query: str) -> str:
    """Analyze customer data. Governed by OSuite policies."""

    # 1. GUARD: Check policy before executing
    result = claw.guard({
        "action_type": "data_analysis",
        "declared_goal": f"Analyze customer data: {query}",
        "risk_score": 40,
        "systems_touched": ["customer_database"],
    })

    if result.get("decision") == "block":
        reasons = result.get("reasons", [])
        return f"Blocked by governance policy: {', '.join(reasons)}"

    # 2. RECORD: Declare intent
    action = claw.create_action(
        "data_analysis",
        f"Analyze customer data: {query}",
        risk_score=40,
    )
    action_id = action["action_id"]

    # 3. EXECUTE: Your tool logic here
    analysis_result = f"Analysis of '{query}': 42 segments, avg satisfaction 4.2/5."

    # 4. OUTCOME: Report result
    claw.update_outcome(action_id, status="completed", output_summary=analysis_result)

    return analysis_result

The guard check runs before each tool execution. If the policy blocks, the tool returns early with the block reason. Otherwise it records the action, executes, and reports the outcome.

5

Run the governed CrewAI tool

Execute the example and watch the governance flow.

Terminal

python main.py

No LLM API key needed — the example calls the tool directly. Only the OSuite SDK calls are real.

6

See the result in OSuite

Open your OSuite dashboard to confirm the action was recorded.

Go to /decisions — you should see your action in the ledger with action_type 'data_analysis', agent_id 'crewai-analyst-agent', and status 'completed'.

7

Clone the full example

The complete runnable example is in the OSuite repo.

Terminal

git clone https://github.com/ucsandman/OSuite.git osuite
cd osuite/examples/crewai-governed
pip install -r requirements.txt
python main.py

For production CrewAI integrations, the Python SDK also includes a OSuiteCrewIntegration class (sdk-python/osuite/integrations/crewai.py) that provides automatic task callbacks for governing entire crews.

What success looks like

Go to /decisions — you should see your action in the ledger with action_type 'data_analysis', agent_id 'crewai-analyst-agent', and status 'completed'.

Navigate to /decisions in your OSuite instance. Your action should appear in the ledger within seconds of the agent run.

Governance as Code

Drop a guardrails.yml in your project root to enforce policies without code changes. OSuite evaluates these rules at the guard step before any action executes.

guardrails.yml

version: 1
project: my-crewai-agent
description: >
  Governance policy for a CrewAI data analysis crew.
  Customer data analysis requires audit trail.
  External API calls require approval.

policies:
  - id: audit_data_analysis
    description: All data analysis tools must record an audit trail
    applies_to:
      tools:
        - Analyze Customer Data
        - Generate Report
    rule:
      allow: true

  - id: approve_external_calls
    description: External API calls require human approval
    applies_to:
      tools:
        - Send Email
        - Post to Slack
    rule:
      require: approval