Skip to main content

Cryptographic receipts for AI agent tool calls

Project description

manifest-sdk

Cryptographic receipts for AI agent tool calls — Python SDK.

Pure Python implementation of the manifest receipt format. Generates receipts that are byte-for-byte verifiable by the Rust CLI.

Install

pip install manifest-sdk

Quick Start

from manifest_sdk import Manifest

m = Manifest(identity="my-agent", db="receipts.db")

receipt = m.record(
    tool="send_email",
    input={"to": "bob@example.com", "subject": "Hello"},
    output={"status": "sent"}
)

print(receipt.id)                    # urn:uuid:...
print(receipt.proof.signature)       # ed25519:...
print(receipt.content_hash())        # sha256:...

Features

  • Ed25519 signing — Key generation, signing, verification (32-byte seed files)
  • Merkle tree — Append-only tree matching the Rust implementation
  • Policy evaluation — Tool allowlists, spending limits, PII detection
  • SQLite storage — Same schema as the Rust CLI (cross-readable)
  • Receipt chaining — Each receipt links to the previous via content hash
  • JSON-LD receipts — Same format as the MCP proxy

Advanced Usage

from manifest_sdk import (
    AgentIdentity, IdentitySource, Action, Delta,
    ReceiptBuilder, Signer, MerkleTree, Storage, PolicyConfig,
)

# Manual control over each component
signer = Signer.generate()
merkle = MerkleTree()
storage = Storage.open("receipts.db")

identity = AgentIdentity(
    name="procurement-bot",
    deployer="acme-corp",
    environment="production",
    source=IdentitySource.CONFIG,
)

receipt = (
    ReceiptBuilder()
    .agent(identity)
    .action(Action(tool="db_query", input={"sql": "SELECT 1"}, output={"rows": 1}))
    .delta(Delta(authorized=True))
    .build(signer, merkle)
)

storage.insert_receipt(receipt, session_id="session-1")

# Verify the signature
canonical = receipt.canonical_bytes()
assert signer.verify(canonical, receipt.proof.signature)

License

Apache 2.0

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

manifest_sdk-0.2.11.tar.gz (52.0 kB view details)

Uploaded Source

File details

Details for the file manifest_sdk-0.2.11.tar.gz.

File metadata

  • Download URL: manifest_sdk-0.2.11.tar.gz
  • Upload date:
  • Size: 52.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for manifest_sdk-0.2.11.tar.gz
Algorithm Hash digest
SHA256 7999d3f32fa901b1d39932da3a8e93126a372394dd1e9f562139ee0b544c724c
MD5 327639887f145c2c6d94ce11c4c2934f
BLAKE2b-256 82ed10a1dd7ffd9b5ea9bd1006946e3408e6ab17b22ad0cabfd84aceed3839d5

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