---
title: Python SDK
description: Python SDK for creating, signing, and verifying Agent Receipts.
---

The Python SDK (`agent-receipts`) provides tools for creating, signing, and verifying Agent Receipts in Python applications.

**Repository:** [agent-receipts/sdk-py](https://github.com/agent-receipts/ar/tree/main/sdk/py)

## Features

- Create and sign Agent Receipts with Ed25519
- Build and verify receipt chains
- Validate receipts against the JSON Schema
- Action taxonomy helpers and risk level utilities
- Full type annotations (PEP 484)

## Quick example

```python
from agent_receipts import (
    CreateReceiptInput,
    create_receipt,
    generate_key_pair,
    sign_receipt,
)

keys = generate_key_pair()

unsigned = create_receipt(
    CreateReceiptInput(
        issuer={"id": "did:agent:my-agent"},
        principal={"id": "did:user:alice"},
        action={
            "type": "filesystem.file.read",
            "risk_level": "low",
        },
        outcome={"status": "success"},
        chain={
            "sequence": 1,
            "previous_receipt_hash": None,
            "chain_id": "chain_session-1",
        },
    )
)

signed = sign_receipt(unsigned, keys.private_key, "did:agent:my-agent#key-1")
```

See [Installation](/sdk-py/installation/) to get started.
