Skip to main content

UATP Python SDK

Cryptographic proof that AI made a decision, with this reasoning, at this time.

Installation

pip install uatp

Or from source:

git clone https://github.com/KayronCalloway/uatp
cd uatp/sdk/python
pip install -e .

Quick Start

from uatp import UATP

client = UATP()

# Create proof
capsule = client.certify(
    decision="Loan approved: $50,000 at 5.2% APR",
    reasoning=[
        {"step": 1, "thought": "Credit score 720 (excellent)"},
        {"step": 2, "thought": "Debt-to-income 0.28 (acceptable)"}
    ]
)

# Verify proof
assert capsule.verify() == True

# Tamper detection
capsule.decision = "Loan approved: $500,000"
assert capsule.verify() == False  # Signature invalid

What This Does

UATP creates independently verifiable proof that:

  • A decision existed in this form
  • At this specific time
  • Tampering breaks verification

Features

Feature Status
Ed25519 signatures Shipped
User-sovereign keys Shipped
RFC 3161 timestamps Beta
Standalone verification Shipped

API Reference

UATP(base_url="http://localhost:8000")

Initialize client.

client = UATP()  # Local development
client = UATP(base_url="https://your-server.com")  # Production

client.certify(decision, reasoning, task=None, confidence=None, metadata=None)

Create cryptographically signed capsule.

result = client.certify(
    task="Approve loan",
    decision="Approved for $50,000",
    reasoning=[
        {"step": 1, "thought": "Good credit", "confidence": 0.95}
    ],
    confidence=0.87,
    metadata={"model": "gpt-4"}
)

Returns: CertificationResult with capsule_id, proof_url, signature, timestamp

client.get_proof(capsule_id)

Retrieve full proof.

proof = client.get_proof("cap_abc123")
print(proof.decision)
print(proof.verify())  # True or False

client.list_capsules(limit=10)

List capsules.

capsules = client.list_capsules(limit=10)
for c in capsules:
    print(f"{c.capsule_id}: {c.task}")

Local Signing (Recommended)

For maximum security, sign locally without sending content to server:

from uatp import UATP

client = UATP()

# Sign locally - private key never leaves your device
result = client.certify_local(
    decision="Sensitive decision",
    reasoning=[...],
    passphrase="your-secure-passphrase"
)

# Only hash sent to server for timestamping
# Content stays local

Running the Backend

cd uatp
./scripts/dev/start_backend_dev.sh
# Server runs on http://localhost:8000

Integration Examples

With OpenAI

from openai import OpenAI
from uatp import UATP

openai = OpenAI()
uatp = UATP()

response = openai.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Should I invest in stocks?"}]
)

result = uatp.certify(
    task="Investment advice",
    decision=response.choices[0].message.content,
    reasoning=[{"step": 1, "thought": "Analyzed request"}],
    metadata={"model": "gpt-4"}
)

print(result.proof_url)

With Anthropic

from anthropic import Anthropic
from uatp import UATP

claude = Anthropic()
uatp = UATP()

message = claude.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Review this contract"}]
)

result = uatp.certify(
    task="Contract review",
    decision=message.content[0].text,
    reasoning=[{"step": 1, "thought": "Analyzed contract"}]
)

Error Handling

try:
    result = client.certify(...)
except ValueError as e:
    print(f"Invalid parameters: {e}")
except ConnectionError as e:
    print(f"Server unavailable: {e}")

Status

See STATUS.md for what's shipped vs beta vs experimental.

Support

License

MIT

Metadata

Release files for uatp 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uatp 0.2.1
File Size Uploaded Provenance Actions
uatp-0.2.1.tar.gz 19.5 kB Without provenance Details for uatp-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uatp 0.2.1
File Interpreter ABI Platform Actions
uatp-0.2.1-py3-none-any.whl Python 3 none any Details for uatp-0.2.1-py3-none-any.whl

Total release size: 39.7 kB

Release files / uatp-0.2.1.tar.gz

Download URL uatp-0.2.1.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
27ce2fc343a73893418d649fdca84543b30763a4c4566d3bdac48a91845b82bf
BLAKE2b-256 checksum
How to use checksums
eb542fb3c3ba7f72d734d6a7c9bc63fba22b239d6229c5e59c4a0c61b5a89d68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / uatp-0.2.1-py3-none-any.whl

Download URL uatp-0.2.1-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec44e985f5da6c40931a6f3a6d3935d6e157209f8c8d517d82d6b080fc5c1e1f
BLAKE2b-256 checksum
How to use checksums
cf221a7520c88b808303f00cc20ee66818210686009e6c54a14e9ed9d436aef6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for uatp 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page