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.2.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

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

manifest_sdk-0.2.2-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: manifest_sdk-0.2.2.tar.gz
  • Upload date:
  • Size: 17.8 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.2.tar.gz
Algorithm Hash digest
SHA256 19ac657a8f7da63e569089f121eadaa5b121e2c13519fa7df8ec1eec8f9bbdc7
MD5 bea49d9c1856ae3eb2a49dd876937d02
BLAKE2b-256 914b8146c81bbd052b65f7e2d3fc092a3b0ba6c7a17aa5e848c4bf89d134682b

See more details on using hashes here.

File details

Details for the file manifest_sdk-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: manifest_sdk-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for manifest_sdk-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a5b39a32deb7f09d05a2afc1f7df7a4141d72da9491b92033d6e700b76ce6aae
MD5 a9b1cb7ee40fc8805eeb0015bf7e4a60
BLAKE2b-256 c5404b231f0fe42f6405d17eaaeab3385206caf769d6c91e939062f0a0304fed

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