Skip to main content

AGLedger SDK — Accountability and audit infrastructure for agentic systems.

Project description

AGLedger Python SDK

Accountability and audit infrastructure for agentic systems. Self-hosted.

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 mandate
mandate = client.mandates.create(
    enterprise_id="ent_123",
    contract_type="ACH-PROC-v1",
    contract_version="1",
    platform="internal",
    criteria={"item": "widgets", "max_quantity": 100},
)

# Activate it
client.mandates.transition(mandate.id, "activate")

# Submit a receipt
receipt = client.receipts.submit(mandate.id, evidence={"quantity": 95, "vendor": "acme"})

# Verify
result = client.verification.verify(mandate.id)

Configuration

client = AgledgerClient(
    api_key="ach_ent_...",                              # 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:
    mandate = await client.mandates.get("mnd-123")

Resources

23 resource sub-clients: mandates, receipts, verification, disputes, webhooks, reputation, events, schemas, dashboard, compliance, registration, health, admin, a2a, capabilities, notarize, enterprises, projects, proxy, federation, federation_admin, agents, references.

Offline Audit Export Verification

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

from agledger.verify import verify_export

export_data = client.compliance.export_mandate("MND_123")
result = verify_export(export_data)

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.5.1.tar.gz (53.7 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.5.1-py3-none-any.whl (54.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agledger-0.5.1.tar.gz
Algorithm Hash digest
SHA256 1c25f6ddcba2a7d71c0918d294ee4bc563c4102e1f7b14b984ad364bcf6238ac
MD5 c714f43823c5b0209b0aa87a07859b2f
BLAKE2b-256 486be4c06ca1fb6b56a94dbee1e7303b2a65f42aa28cffc4aa75add5b21eb614

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agledger-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 54.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.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7bb57846b755d9322f1dd64580cb694cef8f097aa876b20bb155e693677d5122
MD5 48a4539373759942f9e57ad1702f1f7d
BLAKE2b-256 294bedad6194d57fb6d1417e15f6285dbdc37e82ec00e1a11cdad44e0b589870

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