Registry / llm-agents / agent-framework-anthropic

agent-framework-anthropic

JSON →
library1.0.0b260604pypiunverified

The `agent-framework-anthropic` library provides seamless integration of Anthropic Claude models with the Microsoft Agent Framework. It enables developers to leverage Claude's advanced reasoning, context handling, and thoughtful responses within their AI agent applications. As part of the broader Microsoft Agent Framework ecosystem, it's under active development, with frequent updates given its current beta status.

pip install agent-framework --pre
INSTALL
IMPORT
SIG · AGENT-FRAMEWORK-AN
A
agent-framework-anthropic
llm-agentsenv1.0.0b260604
Install
20.6s avg
Import
2024ms
Disk
833MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.0b260604 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
2/4 runs
✓ 22.88s
py 3.11
2/4 runs
✓ 23.25s
py 3.12
2/4 runs
✓ 18.5s
py 3.13
2/4 runs
✓ 17.8s
py 3.9
✕ build_error
✕ build_error
833MB installed
● package 833MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AnthropicClient
from agent_framework.anthropic import AnthropicClient

This quickstart demonstrates how to initialize an `AnthropicClient` and create a basic AI agent. It assumes the `ANTHROPIC_API_KEY` environment variable is set for authentication with the Anthropic API. The agent is then used to answer a simple question.

import asyncio import os from agent_framework.anthropic import AnthropicClient async def main(): # Ensure ANTHROPIC_API_KEY is set in your environment variables. # For a quick test, you can uncomment and set it directly, but avoid in production. # os.environ['ANTHROPIC_API_KEY'] = 'your_anthropic_api_key_here' if not os.environ.get('ANTHROPIC_API_KEY'): print("Error: ANTHROPIC_API_KEY environment variable is not set.") print("Please set it before running the quickstart.") return client = AnthropicClient() # Create an agent using the Anthropic client agent = client.as_agent( name="HelpfulAssistant", instructions="You are a helpful assistant that answers questions accurately.", ) # Run the agent with a prompt response = await agent.run("What is the capital of France?") print(f"Assistant: {response}") if __name__ == "__main__": asyncio.run(main())
Debug
Known issues
breakingThe `agent-framework-anthropic` package is currently in a pre-release (beta) state. Breaking changes may occur frequently, especially as the broader Microsoft Agent Framework evolves towards stable releases.
fix
Refer to the official `microsoft/agent-framework` GitHub repository and documentation for specific migration guides and changelogs before upgrading. Test thoroughly.
affects: 1.0.0b* (all beta versions)
gotchaThe core `agent-framework` package often requires the `--pre` flag during `pip install` to get the latest compatible pre-release versions, as it is also under rapid development. Forgetting this can lead to version conflicts or outdated components.
fix
Always install `agent-framework` with `pip install agent-framework --pre` to ensure compatibility with the latest `agent-framework-anthropic` releases.
affects: All versions while `agent-framework` is in pre-release
gotchaAPI keys (e.g., `ANTHROPIC_API_KEY`) should never be hardcoded or committed to source control. They must be managed securely, preferably through environment variables or a dedicated secret management service.
fix
Set `ANTHROPIC_API_KEY` as an environment variable (e.g., `export ANTHROPIC_API_KEY='sk-ant-...'`). The `AnthropicClient` will automatically detect it.
affects: All versions
breakingA critical vulnerability has been identified in Anthropic's Model Context Protocol (MCP), which could allow arbitrary command execution on servers running MCP. Since Microsoft Agent Framework integrates with MCP, this is a significant security concern.
fix
Monitor official announcements from Anthropic and Microsoft regarding patches or mitigation strategies for the MCP vulnerability. Update dependencies as soon as fixes are available.
affects: Versions relying on affected MCP implementations (details TBD by Anthropic/Microsoft)
gotchaLong-running AI agents built with Claude models can face challenges with memory and context windows, potentially leading to agents 'forgetting' instructions or previous conversational turns over extended interactions.
fix
Implement explicit memory management strategies or leverage features like 'initializer agents' and 'coding agents' for incremental progress, as discussed by Anthropic for their SDK.
affects: All versions, inherent to LLM-based agents
gotchaIntegrating deeply with Anthropic's infrastructure or the Microsoft Agent Framework may lead to increased vendor lock-in, making it harder to switch underlying LLM providers or agent frameworks in the future.
fix
Evaluate the trade-offs between ease of integration and vendor flexibility. Design your agent architecture with modularity in mind where possible to abstract away provider-specific implementations.
affects: All versions
gotchaCosts for Anthropic models vary significantly by model (e.g., Claude Haiku vs. Opus) and token usage (input/output). Inefficient prompting or long contexts can lead to unexpectedly high costs.
fix
Follow Anthropic's best practices for prompt engineering, choose appropriate models for the task, monitor token usage, and optimize prompts for conciseness and clarity.
affects: All versions
Upgrade
Version history
1.0.0b260604latest on PyPI · released Jun 4, 2026
Audit
Dependencies
agent-frameworkrequiredCore dependency for the Microsoft Agent Framework.
anthropicoptionalRequired for direct Anthropic API access.
anthropic.foundryoptionalRequired for integrating Anthropic models via Azure AI Foundry.
azure.identityoptionalRequired for Azure-managed identity credentials with Azure AI Foundry.
Agent activity
76 hits · last 30 days
node
70
OpenAI (training)
1
Resources

No resource links recorded.

agent-framework-anthropic — pip install agent-framework-anthropic · libregistry