Skip to main content

AGLedger SDK — Accountability and audit infrastructure for agentic systems.

Project description

AGLedger Python SDK

The official Python SDK for AGLedger — accountability infrastructure for AI agents. Self-hosted. The Layer 3 accountability layer of the agent stack.

Learn more

  • agledger.ai — what AGLedger is and why Layer 3 accountability matters
  • How it works — the four-endpoint lifecycle: Record, Receipt, Verdict, fulfill
  • Glossary — canonical definitions of Record, Receipt, Verdict, Settlement Signal
  • Documentation — installation, integration guides, API reference
  • Protocol (AOAP) — the coordination language behind AGLedger

Install

pip install agledger

Quick Start

import os
from agledger import AgledgerClient

client = AgledgerClient(
    api_key=os.environ["AGLEDGER_API_KEY"],
    base_url=os.environ["AGLEDGER_EXTERNAL_URL"],  # your AGLedger instance URL
)

# Create a Record. An agent key defaults the principal to itself; an admin
# key names the principal explicitly via principal_agent_id.
record = client.records.create(
    type="ACH-PROC-v1",
    contract_version="1",
    platform="internal",
    performer_agent_id="agt-123",
    criteria={"item_spec": "widgets", "quantity": {"target": 100}},
)

# Activate it
client.records.transition(record.id, "activate")

# Submit a receipt
receipt = client.receipts.submit(
    record.id,
    evidence={"deliverable": "/out.pdf", "deliverable_type": "file_ref", "quantity_supplied": 95},
)

# Principal verdict
client.records.report_outcome(record.id, receipt_id=receipt.id, outcome="PASS")

Configuration

client = AgledgerClient(
    api_key="agl_agt_...",                              # or set AGLEDGER_API_KEY env var
    base_url="https://agledger.internal.example.com",   # your instance URL
    max_retries=2,                                      # default: 2
    timeout=30.0,                                       # default: 30s
)

Async Support

from agledger import AsyncAgledgerClient

async with AsyncAgledgerClient() as client:
    record = await client.records.get("rec-123")

Resources

records, receipts, verification, disputes, webhooks, reputation, events, schemas, compliance, health, admin (with admin.records + admin.vault sub-resources), a2a, agents, audit (with audit.tenant_reads_checkpoints), auth, capabilities, discovery, references, federation, federation_admin, verification_keys.

Offline Audit Export Verification

Verify a Record's hash-chained, Ed25519-signed audit export without calling the API:

from agledger.verify import verify_export

export_data = client.records.get_audit_export("rec-123")
result = verify_export(export_data.model_dump(by_alias=True))

if not result.valid:
    print(f"Broken at position {result.broken_at.position}: {result.broken_at.reason}")
# VerifyExportResult(valid=True, verified_entries=12, total_entries=12, ...)

Requires the cryptography package for Ed25519 verification:

pip install 'agledger[verify]'

Re-implements the vault's integrity check (RFC 8785 JCS → SHA-256 → Ed25519 over {position}:{payloadHash}:{previousHash}). Pass public_keys={...} to override the export's embedded keys, or require_key_id="key-id" to reject exports signed by an unexpected key.

Licensing

AGLedger is free for single-node deployments (Docker Compose with bundled database). An Enterprise License is required for external database connections, federation, and multi-node deployments.

Full details: agledger.ai/pricing | License Agreement

SDK License

Proprietary. Copyright (c) 2026 AGLedger LLC. All rights reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agledger-0.7.1.tar.gz (59.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agledger-0.7.1-py3-none-any.whl (57.7 kB view details)

Uploaded Python 3

File details

Details for the file agledger-0.7.1.tar.gz.

File metadata

  • Download URL: agledger-0.7.1.tar.gz
  • Upload date:
  • Size: 59.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for agledger-0.7.1.tar.gz
Algorithm Hash digest
SHA256 10727369f3ae729dfdda9b2fc3a311f829cf53e84ffb8546ca8f4a65f448b636
MD5 9f9d2a28a3b268bb2e6f5be624c20fd4
BLAKE2b-256 e47e190d482bf109aa4b3db7de1b2744cf6f1d274750e02d182cc2b9b6f4d27b

See more details on using hashes here.

File details

Details for the file agledger-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: agledger-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 57.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for agledger-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6211847a38ad64d89afce22b8ba3a8df3fbf930df5629a16ac53b56c0ad26e42
MD5 1003fbf579ace1a8e87b0c809d6a7e97
BLAKE2b-256 0f4e79c2ba98d5061d7489065afb1823d29897646723f99afd448e2a615c76dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page