Impraint
Integrations

Anthropic

Track the anthropic SDK (Claude). Coming after beta.

Not covered by beta support

The beta launch covers Gemini, LangChain and LangGraph. The Anthropic integration exists and works for the cases below, but it is not yet part of what we test and support for beta. Expect changes.

Install

pip install impraint-guard anthropic

Patch or wrap

import anthropic
from impraint_guard import Guard
from impraint_guard.integrations.anthropic import patch_anthropic

guard = Guard(agent_id="claude-agent", api_key="...")

# Option 1: process-wide
patch_anthropic(guard)
client = anthropic.Anthropic()

# Option 2: a single client
client = guard.wrap_anthropic(anthropic.Anthropic())

Both messages.create(...) (streaming or not) and the messages.stream(...) context manager are tracked.

Known gaps

  • Behaviour when Claude is called through LangChain's ChatAnthropic while the raw patch is active has not been verified yet.
  • Extended-thinking token accounting has not been verified yet.
  • Claude on cloud gateways (Vertex AI, Bedrock, Azure) is not yet supported.
  • Prompt checks (on_input) exist on guard.wrap_anthropic, but they are not tested or supported in beta. patch_anthropic has no prompt checks.

See Compatibility for the full matrix.

On this page