CL
Clausgap
/Docs

Anthropic Agent SDK

bash
pip install clausgap-anthropic
ℹ

Private beta. The SDK packages aren't on the public registries yet. Access comes with onboarding — email hello@clausgap.dev.

python
from claude_agent_sdk import Agent, Runner
from clausgap_anthropic import ClausgapRunHooks

hooks = ClausgapRunHooks(
    control_url="http://localhost:8080",
    api_key=os.environ["CLAUSGAP_API_KEY"],
    agent_role="hr_assistant",
)

runner = Runner(agent=agent)
result = runner.run("Who works in Engineering?", run_hooks=hooks)

ClausgapRunHooks plugs into the Claude Agent SDK's run_hooks lifecycle, evaluating each tool call the model makes against your policies before it executes.

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 →