axiomatics-ai-sdk-python
Externalized attribute-based access control (ABAC) for AI applications.
Agents decide what to do; this SDK decides what they are allowed to do, by asking a Policy Decision Point (PDP) at every point where an agent turn touches something that matters: the prompt, the tool list, each tool call, each tool result, the final answer, agent-to-agent messages, and document retrieval. Policies live in the PDP, written once in a standard policy language, and apply the same way across LangChain, Google ADK, Strands, OpenAI Agents, the Claude Agent SDK, MCP servers, A2A agents, and your own code. No authorization logic in the application.
The SDK speaks XACML 3.0 JSON and OpenID AuthZEN, so it works with any PDP that implements either. It is developed and tested against Axiomatics ADS.
Where it fits
Every block below talks to the PDP through the SDK, which plays the Policy Enforcement Point (PEP): it builds the authorization request from the caller's identity and the thing being attempted, asks the PDP, and applies the answer.
When it intercepts
Along one agent turn the SDK can intercept at seven points. Each is a transformation of what flows through it; a Deny is the simplest case (block, hide, or filter).
| # | Point | Fires | On Deny | Decided by |
|---|---|---|---|---|
| ① | Input guard (BEFORE_MODEL) |
before the model sees the prompt | prompt blocked, refusal returned | policy over LLM-classified attributes |
| ② | Tool visibility (TOOL_VISIBILITY) |
before the model sees the tool list | tool hidden; the model never knows it exists | policy |
| ③ | Tool invocation (BEFORE_TOOL) |
before a tool call runs | call blocked; arguments are part of the decision; or paused for a human's approval | policy, optionally against the user's classified intent |
| ④ | Tool-output filter (AFTER_TOOL) |
after a tool returns | denied records dropped, or fields masked | policy, per record |
| ⑤ | Output guard (AFTER_MODEL) |
before the answer reaches the user | answer blocked, refusal returned | policy over LLM-classified attributes |
| ⑥ | A2A invocation (A2A_INVOCATION) |
on an agent-to-agent message | message blocked | policy |
| ⑦ | Retrieval filter (retrieval) |
on a vector-store search | only permitted documents returned; the filter is pushed into the store | policy, as a condition |
Quick start
pip install "axiomatics-ai-sdk[langchain-agents]" langchain-litellm # or: uv add ...
langchain-litellm is only the model this example uses; bring any LangChain chat model.
Wrap a LangChain agent. The context dict is the user's identity; the PDP decides which tools alice sees, which calls run, and which records come back.
from langchain.tools import tool
from langchain_litellm import ChatLiteLLM
from axiomatics_ai import AuthZConfig, PDPConnection, create_authorized_agent, standard_tool_enforcement
@tool
def search_docs(query: str) -> str:
"""Search internal documentation."""
return "..."
config = AuthZConfig(
connection=PDPConnection(base_url="http://localhost:8080"),
enforcement=standard_tool_enforcement(), # tool visibility + invocation + output filter
)
agent = create_authorized_agent(
model=ChatLiteLLM(model="openai/gpt-5.6-luna"),
tools=[search_docs],
config=config,
)
agent.invoke({"messages": [{"role": "user", "content": "Find docs on deployment"}]},
context={"username": "alice"})
No framework? Ask the PDP directly and enforce yourself (same config):
from axiomatics_ai import Authorizer
authz = Authorizer(config)
if not authz.is_permitted(action="read_document", resource="doc-42", context={"username": "alice"}):
raise PermissionError
Every other framework has a one-call equivalent; see Integrations. Full walkthrough, including running a PDP and writing the first policy: Getting started.
What it covers
Not every framework exposes a hook at every point. ✅ supported · — not expressible there.
| Integration | Input guard | Tool visibility | Tool invocation | Output filter | Output guard | Retrieval | A2A | Side |
|---|---|---|---|---|---|---|---|---|
| langchain_agents | ✅ | ✅ | ✅ | ✅ | ✅ | — | — | client |
| google_adk | ✅ | ✅ | ✅ | ✅ | ✅ | — | — | client |
| strands | ✅ | ✅ | ✅ | ✅ | ✅ | — | — | client |
| openai_agents | ✅ | ✅ | ✅ | ✅ | ✅ ¹ | — | — | client |
| claude_agent | ✅ ² | — | ✅ | ✅ | — ² | — | — | client |
| langchain_mcp | — | ✅ | — | — | — | — | — | client |
| rag | — | — | — | — | — | ✅ | — | client |
| fastmcp | — | ✅ | ✅ | ✅ | — | — | — | server |
| tool_decorator | — | — | — | ✅ | — | — | — | server |
| a2a | — | — | — | — | — | — | ✅ | both |
| gateway ³ | — | ✅ | ✅ | ✅ | — | — | ✅ | proxy |
| direct | any point you choose, as single or batch decisions | any |
¹ OpenAI's guards are SDK guardrails: a block raises a tripwire the caller catches. ² The Claude Agent SDK has no tool-list filter and no hook that sees the final answer; its input guard is a hard block. ³ Experimental: not production grade yet; the gateway will move to its own package.
PDP compatibility
| Feature | Needs | Works with |
|---|---|---|
Single decisions (①③⑤⑥, masking, Authorizer.is_permitted) |
XACML 3.0 JSON, or AuthZEN evaluation | any PDP speaking either |
Batch decisions (②, record filtering, Authorizer.is_permitted_batch) |
XACML Multiple Decision Profile, or AuthZEN evaluations | PDPs implementing the profile or the batch endpoint |
| Retrieval filter (⑦) | partial evaluation (reverse query) | Axiomatics ADS only; no standard equivalent |
Endpoint paths are configurable, so a PDP that mounts the same protocols elsewhere needs only a
PdpEndpoints override. Developed and tested against Axiomatics ADS 26.1.x over both protocols;
single and batch decisions have also been exercised against other open-source PDPs over AuthZEN
and XACML JSON. Details: Configuration.
Documentation
- Getting started → Configuration → Identity → Agent identity → Enforcement points → Content guards → Intent-based access control → Obligations and human approval → Post-invocation → Hooks → Security → Troubleshooting → Performance
- Integrations, one page per framework
- Architecture, Running Axiomatics ADS, Changelog
Examples and tests
Runnable examples for every integration are under examples/, each folder with a
README naming the policy it needs; the policies are in examples/policies/.
uv sync --extra all
uv run pytest tests/ # unit tests need no PDP; integration tests start ADS from examples/policies/
License
Apache 2.0. See LICENSE.
Metadata
Release files for axiomatics-ai-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| axiomatics_ai_sdk-0.1.0.tar.gz | 165.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| axiomatics_ai_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 359.5 kB
Release files / axiomatics_ai_sdk-0.1.0.tar.gz
| Download URL | axiomatics_ai_sdk-0.1.0.tar.gz |
|---|---|
| Size | 165.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
048c55f070dd9db9a1c76758c1ef80d4f10022b7b2b3579b027a3aa0c2d81b06
|
|
BLAKE2b-256 checksum How to use checksums |
76123a5d054904282e917062a8a9bd8105fdceb209685419108a59e856d6aad4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / axiomatics_ai_sdk-0.1.0-py3-none-any.whl
| Download URL | axiomatics_ai_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 194.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
210e010745644cdb701c3062c3daaad52e3499fb0fe7e86ea4ad2737bbcae806
|
|
BLAKE2b-256 checksum How to use checksums |
ced3b62042df4864e7f48f7a9e8a2bd22d9cdb94a1133fe9a36d3c5c5e484681
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for axiomatics-ai-sdk 0.1.0
Provenance
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
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.