The Claude Agent SDK adapter runs AgentMark prompts as agentic tasks using Anthropic’s Claude Agent SDK — multi-turn tool use, budget controls, permission management, and tracing. This page covers the Python adapter; for TypeScript, see Claude Agent SDK (TypeScript).Documentation Index
Fetch the complete documentation index at: https://docs.agentmark.co/llms.txt
Use this file to discover all available pages before exploring further.
The Python adapter (
agentmark-claude-agent-sdk-v0) is in alpha. The API surface documented here is stable, but expect occasional changes ahead of the v1 release. For type-safe structured outputs across all major providers, Pydantic AI is the recommended general-purpose Python adapter — reach for Claude Agent SDK when you specifically need Claude’s agentic capabilities.Installation
Setup
Create your client with aClaudeAgentModelRegistry. There is no create_default() — you must register models or providers explicitly so the model names in your prompt frontmatter resolve.
The simplest setup registers a provider by prefix (anthropic/...):
agentmark_client.py
max_thinking_tokens, register models explicitly with a ModelConfig creator. The creator receives the model name and the run options:
agentmark_client.py
Running prompts
Usetraced_query — it accepts the output of prompt.format() directly, runs the Claude Agent SDK query internally, and yields messages as the agent works. (run_text_prompt / run_object_prompt belong to the Pydantic AI adapter and are not exported here.)
Adapter options
Adapter options are set at client construction time, not insideprompt.format():
agentmark_client.py
| Option | Type / values | Purpose |
|---|---|---|
permission_mode | 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan' | How the agent handles tool-permission prompts |
max_turns | int | Cap on agent turns |
cwd | str | Working directory for file/Bash tools |
max_budget_usd | float | Hard spend cap in USD |
allowed_tools | list[str] | Tool whitelist |
disallowed_tools | list[str] | Tool blacklist |
system_prompt_preset | bool (default False) | Use Claude Code’s built-in system prompt |
on_warning | Callable[[str], None] | Warning handler |
Object generation
For structured output, load an object prompt. The structured result arrives in the finalresult message:
Tools
The Claude Agent SDK adapter handles tools by name, not by registering executors. List tool names in your prompt frontmatter and the adapter passes them through asallowed_tools to the SDK. Tools can be the SDK’s built-ins (Read, Write, Bash, …) or tools served by MCP servers.
Configure MCP servers on the client (the Python field is mcp_servers, snake_case):
agentmark_client.py
task.prompt.mdx
Evals
Register evaluation functions to score prompt outputs during experiments. Score schemas live inagentmark.json; eval functions connect to them by name.
agentmark_client.py
Tracing
traced_query emits OpenTelemetry spans automatically when telemetry is enabled on prompt.format(). All tracing context — prompt name, model, system prompt, and props — is extracted from the adapted output:
Limitations
- No image generation — use the AI SDK adapter via a Node.js service.
- No speech generation — same as above.
- The aggregated final result is only available after all turns complete; intermediate state arrives as streamed messages.
Next steps
Pydantic AI
The general-purpose Python adapter
Tools and agents
Configure tools for your agents
Observability
Monitor your agents in production
Other integrations
Explore other AI frameworks
Have Questions?
We’re here to help! Choose the best way to reach us:
- Email us at hello@agentmark.co for support
- Schedule an Enterprise Demo to learn about our business solutions