AgentLedger Adapters
One-liner audit trails and policy enforcement for the most popular Python agent frameworks.
from agent_ledger_adapters import build_ledger
from agent_ledger_adapters.langchain import AgentLedgerCallbackHandler
ledger = build_ledger("agent_ledger.db", policy_path="policy.json")
chain.run(question, callbacks=[AgentLedgerCallbackHandler(ledger, agent_id="my-agent", enforce=True)])
Built on AgentLedger (vendored, zero dependencies). Every agent action lands in a tamper-proof SHA-256 chain; with enforce=True, policy violations raise and stop the offending action.
Supported frameworks
| Framework | Adapter | How to attach |
|---|---|---|
| LangChain / LangGraph | agent_ledger_adapters.langchain.AgentLedgerCallbackHandler |
callbacks=[handler] |
| LlamaIndex | agent_ledger_adapters.llamaindex.AgentLedgerCallbackHandler |
CallbackManager([handler]) |
| OpenAI Agents SDK | agent_ledger_adapters.openai_agents.AgentLedgerRunHooks |
Runner.run(agent, input, hooks=hooks) |
No framework is required to install this package — imports are lazy, so only the adapter you use pulls in its framework.
What gets logged
chain_start/end, agent_action, tool_call, tool_result, tool_error, llm_start/end/error, agent_start/end, run_start/end, handoff — with run IDs, inputs, outputs, and error messages (truncated).
Policy enforcement
{
"version": 1,
"default": "deny",
"policies": [
{"agent": "my-agent", "action": "delete_*", "target": "*", "decision": "deny"},
{"agent": "my-agent", "action": "deploy", "target": "production", "decision": "require_approval"}
]
}
deny→PolicyViolationraised (witherrors="raise"), violation loggedrequire_approval→ logged withpolicy_status: pending_approvalerrors="ignore"(default) → auditing never breaks your agent
Run the tests
cd tests && python3 test_adapters.py # mock framework objects, no frameworks needed
MIT
Metadata
Release files for agent-ledger-adapters 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 | |
|---|---|---|---|---|
| agent_ledger_adapters-0.1.0.tar.gz | 6.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agent_ledger_adapters-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.5 kB
Release files / agent_ledger_adapters-0.1.0.tar.gz
| Download URL | agent_ledger_adapters-0.1.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8825ad5b289d7dda3296f7ee8817339ec932ca75376639d285f92ac1b3f95223
|
|
BLAKE2b-256 checksum How to use checksums |
64856cef45bd90b7a104778be83e5224b75d1e2693579a516622d1440df67cae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Release files / agent_ledger_adapters-0.1.0-py3-none-any.whl
| Download URL | agent_ledger_adapters-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a6529353424ade3340ffb1264b1c7d47bdcf5fbc99c77e53bd5363530e895e7
|
|
BLAKE2b-256 checksum How to use checksums |
afda95b2fdccdd24d085efd9ea0d932220d82c82ce9ca32fc307fb1c1a0de2e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Security for agent-ledger-adapters 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.