CrewAI
pip install clausgap-crewaiPrivate beta. The SDK packages aren't on the public registries yet. Access comes with onboarding — email hello@clausgap.dev.
from crewai import Agent, Task, Crew
from clausgap_crewai import ClausgapHooks
hooks = ClausgapHooks(
control_url="http://localhost:8080",
api_key=os.environ["CLAUSGAP_API_KEY"],
)
crew = Crew(agents=[researcher, analyst], tasks=[research_task])
hooks.register(crew) # intercepts every tool call in the crew
result = crew.kickoff()ClausgapHooks maps each CrewAI agent's role field to agent_role in your policy. Denied calls return False from the before-hook, causing CrewAI to skip the tool and inform the agent.
Escrow holds
A policy's escrow rule works the same way here as everywhere else — see the escrow flow →
Use the agent's own key
Give the integration the agent's own key — registered with POST /v1/keyless/api-keys, the same key the proxy accepts — and set CLAUSGAP_TENANT_ID to your tenant ID. The key then fixes the agent's role and ID (the configured role must match it) and can only evaluate tool calls: it can't change policies or issue keys. A tenant API key also works, but lets the agent name any role, and Discovery Mode only lets calls through for agent keys. Set CLAUSGAP_ENVIRONMENT and CLAUSGAP_SCOPES to match your proxy's, if you use them. See agent keys →