One safety layer for every agent's tools: approvals, budgets, cost and traces, in any framework or none.
pip install agent-adapter Copy PIP instructions
Build with any framework. Ship with one safety layer.
Write a tool once, as a plain Python function. Every call to it, from any model or agent framework, is approved, budgeted, priced and traced the same way.
LangChain, CrewAI or ADK help you build an agent. Agent Adapter makes every tool call that agent makes safe, priced and traced, in any framework or in none.
It turns your functions into LLM tools, checks their schemas once at startup, and runs every call through one executor that applies approval, budgets, guards, caching and cost tracking. The core depends only on pydantic. Every framework is an optional extra, imported lazily. No agent framework is needed: run_tool_loop with your own model is the agent loop, and Flow is the graph.
pip install agent-adapter # core (pydantic only) pip install "agent-adapter[openai]" # + the extras you need Quickstart import agent_adapter as aa @aa.tool def add(a: int, b: int) -> int: """Add two numbers.""" return a + b print(aa.call(add, a=1, b=2)) # 3: validated and guarded by the default executor @aa.tool registers the function; aa.call runs it through the default executor. From async code (FastAPI, ...) use await aa.acall(add, a=1, b=2).
A tool with side effects asks a person first, once, and the approval survives a restart:
@aa.tool(confirm=True) def refund(order_id: str, amount: float) -> str: """Refund an order.""" return f"refunded {amount} on {order_id}" executor = aa.configure(approval=aa.DeferredApproval.sqlite("approvals.db")) try: aa.call(refund, order_id="o-7", amount=500) except aa.ApprovalPending as pending: approval_id = pending.approval_id # show it to a reviewer # ... later, in any process that opens the same file: print(executor.resume_sync(approval_id, True, decided_by="ana").value) Why Agent Adapter Each framework has its own tool format, its own idea of approval and no shared view of cost. Change framework, or run two, and the rules are rewritten. Agent Adapter keeps them in one place.
Both files in this release have provenance metadata.
a2a adk ag-ui ag2 agent-framework agno all anthropic autogen camel claude-agent crewai dbos dev docs dspy dynamodb gemini graphiti haystack langchain langgraph llamaindex mcp mem0 nemo openai openai-agents openapi otel presidio pydantic-ai redis semantic-kernel server server-wsgi smolagents sqlalchemy strands temporal zep
agents approval function-calling guardrails llm mcp tools
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Both files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




