feat(agents): implement Anthropic Managed Agents API (v1alpha)#5557
feat(agents): implement Anthropic Managed Agents API (v1alpha)#5557cdoern wants to merge 1 commit intoogx-ai:mainfrom
Conversation
Implement agent configuration CRUD API matching Anthropic's Managed Agents
API specification from platform.claude.com/docs/en/api/beta/agents.
Tool Types:
- agent_toolset_20260401: Built-in agent environment tools (bash, edit,
read, write, glob, grep, web_fetch, web_search) with per-tool
enable/disable and permission policies (always_allow vs always_ask)
- mcp_toolset: Tools from MCP servers with per-tool configuration
- custom: Custom function tools with JSON Schema input definitions
Agent Configuration:
- model (required): Model identifier
- name (required): Human-readable name (1-256 chars)
- system: System prompt (up to 100KB)
- description: Agent description (up to 2048 chars)
- mcp_servers: MCP server endpoint definitions
- tools: Tool configurations (max 128 tools total)
- skills: Anthropic-managed or custom skills (max 20)
- metadata: User-defined key-value pairs
Endpoints:
- POST /v1alpha/agents - Create agent
- GET /v1alpha/agents - List agents (with pagination and filters)
- GET /v1alpha/agents/{id} - Get agent by ID
- POST /v1alpha/agents/{id} - Update agent (increments version)
- POST /v1alpha/agents/{id}/archive - Archive agent
Implementation:
- In-memory storage with version tracking
- RFC 3339 timestamps (created_at, updated_at, archived_at)
- Proper integration tests in tests/integration/agents_anthropic/
- Anthropic SDK compatibility tests
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Charlie Doern <cdoern@redhat.com>
✱ Stainless preview buildsThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs. ✅ llama-stack-client-go studio · conflict
✅ llama-stack-client-node studio · conflict
✅ llama-stack-client-python studio · conflict
✅ llama-stack-client-openapi studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
|
The Anthropic Managed Agents API compatibility layer is useful for migration without code changes, and the immutable versioning (version increments on update) is the right design — agents should have auditable version histories, not mutable state. One dimension the current implementation leaves open: agent identity persistence across versions. When A few additions that would make the versioning model trust-aware: 1. Version field in agent card / trust attestation. When an agent registers with AgentFolio or SATP, the attestation should include the specific version it was evaluated at. Trust scores should be version-qualified: 2. Version change event on archive/update. When an agent is archived or updated, downstream systems that hold trust attestations for the old version should be notified that the attestation may be stale. The 3. RFC 3339 timestamps for temporal trust decay. The |
Summary
Implements the Anthropic Managed Agents API (v1alpha) for agent configuration management. This provides a compatibility layer allowing users to switch from Anthropic's hosted service to Llama Stack without changing their code.
What's Implemented
Agent Configuration CRUD API (
/v1alpha/agents)POST /agents- Create agent with model, name, system prompt, tools, skills, metadataGET /agents- List agents with pagination and filteringGET /agents/{id}- Retrieve agent by IDPOST /agents/{id}- Update agent (creates new version)POST /agents/{id}/archive- Archive agentAnthropic Tool Types Supported
agent_toolset_20260401- Built-in tools (bash, edit, read, write, glob, grep, web_fetch, web_search)mcp_toolset- Tools from MCP serverscustom- Custom function tools with JSON SchemaKey Features
Architecture: Responses API as Execution Backend
This implementation follows Anthropic's actual Managed Agents API specification from https://platform.claude.com/docs/en/api/beta/agents/create
Agent configs are stateless templates. The actual execution flow will work as follows:
previous_response_idagent_toolset_20260401.web_search→ Responses APIweb_search(uses brave/tavily tool_runtime)agent_toolset_20260401.bash/edit/read/write/etc→functiontools (client-executed)mcp_toolset→ Responses APImcptoolscustom→ Responses APIfunctiontoolsKey insight: By delegating to the Responses API, we leverage all existing Llama Stack infrastructure:
The Agents API is a compatibility and orchestration layer, not a reimplementation of agentic behavior.
Testing
Integration tests:
tests/integration/agents_anthropic/Run tests:
Future Work
To complete full Anthropic Agent SDK support:
Breaking Changes
None - this is a new v1alpha API.
Checklist