Skip to main content
The SDK integrates with major AI frameworks. Each integration captures tool calls automatically — no need to wrap every function with @quint.guard().

Anthropic Messages API

guarded_dispatch handles the full lifecycle:
  1. Emits a tool_call event with the tool name and arguments
  2. Evaluates the call against your YAML policy
  3. If blocked, raises ToolBlockedError (return this as a tool error to Claude)
  4. If allowed, executes the function and emits a tool_result event

LangChain

The callback handler hooks into LangChain’s event system:
  • on_tool_start → emits tool_call + runs policy check
  • on_tool_end → emits tool_result
  • on_tool_error → emits tool_error

MCP (Model Context Protocol)

QuintMCPClient wraps the MCP session and intercepts call_tool:
  • Captures the tool name and arguments
  • Runs policy evaluation
  • Delegates to the underlying MCP session if allowed

OpenAI Function Calling

Using without a framework

If you’re building a custom agent loop, use @quint.guard() directly:
The @guard() decorator works with both sync and async functions.