Registry /
llm-agents / agent-framework-anthropic
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
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.fixRefer 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.fixAlways 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.fixSet `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.fixMonitor 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.fixImplement 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.fixEvaluate 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.fixFollow 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.
Resources
No resource links recorded.