Skip to main content

aisley

Sign tamper-evident receipts for AI agent actions. Each receipt records a specific model call, tool call, policy decision, and approval state as signed, hash-only evidence (no raw prompts, model outputs, or tool arguments are stored). Anyone can later verify a receipt — schema, canonical hash, Ed25519 signature, key trust, and timestamp — with no Aisley account.

The SDK's canonicalization is byte-identical to the Aisley server, CLI, verifier, and the TypeScript aisley package, so a receipt re-derives the same hash anywhere, in any language.

Aisley records the policy decision your system made as evidence. It does not run a policy engine and does not decide whether an action is allowed or block execution — your application makes and enforces those decisions.

Install

pip install aisley

Requires Python ≥ 3.10. Pure standard library — no third-party dependencies. Typed (py.typed).

Quick start

import os

from aisley import AisleySdk, create_http_receipt_creator

aisley = AisleySdk(
    agent={"name": "RefundAgent", "version": "v1.0.0"},
    model={"provider": "OpenAI", "name": "gpt-4.1", "version": "2026-06-01"},
    receipt_creator=create_http_receipt_creator(
        endpoint="https://app.aisley.example/api/receipts",
        organization_id="org_123",
        api_key=os.environ["AISLEY_RECEIPT_API_KEY"],
    ),
)

# 1. Wrap the model call — captures hash-only evidence of the prompt/input/output.
model_call = aisley.call_model(
    prompt={"system_prompt": system_prompt, "template_version": "refund-agent-v3"},
    input=customer_request,
    call=lambda input: call_model_provider(input),
)

# 2. Wrap the tool call — builds, signs, submits, and returns the receipt.
tool_call = aisley.call_tool(
    model_call=model_call,
    tool={"name": "stripe.refunds.create", "version": "2026-05-18"},
    action_name="refund.create",
    args=refund_args,
    risk_level="high",
    call=lambda args: stripe_refunds_create(**args),
)

print(tool_call.receipt["receipt_id"])  # the signed receipt id
print(tool_call.output)                 # your tool's real return value

Open the receipt in the dashboard, or paste it into the /verify page to confirm it independently.

Fail-open by default

Receipt submission is decoupled from your action. If recording a receipt fails (outage, 5xx, timeout), the SDK still runs your real business action and returns a result with receipt=None and receipt_error set — the audit logger can never take down your production path. Pass on_receipt_error="fail-closed" to gate execution on a durable receipt instead.

Key exports

Export Purpose
AisleySdk / create_aisley_sdk Wrap model and tool calls; build, sign, and submit receipts.
create_http_receipt_creator Submit receipts to an Aisley server over HTTP (deterministic idempotency key, timeout).
build_receipt_input Build a receipt input without executing a call.
create_evidence_hash The canonical, cross-language evidence hash.
canonicalize_json The canonical JSON form used for hashing and signing.
AisleyReceiptApiError / AisleyReceiptTimeoutError / AisleyReceiptTransportError Typed errors.

License

MIT — see LICENSE.

Metadata

Release files for aisley 0.1.0

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

Source distribution (sdist)

Source distribution for aisley 0.1.0
File Size Uploaded Provenance Actions
aisley-0.1.0.tar.gz 18.6 kB Without provenance Details for aisley-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 30.9 kB

Release files / aisley-0.1.0.tar.gz

Download URL aisley-0.1.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0a4633bee478324e00c9c5c64f03f18d98746d874f2b2f5461e9771b1c8c8476
BLAKE2b-256 checksum
How to use checksums
a642507516cdd30acdbf0dfcdb9d4dad12bba2f0c94017fd103de771d8571e17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / aisley-0.1.0-py3-none-any.whl

Download URL aisley-0.1.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49b61ae11dea5929bb85ea91e78f0b8d06fe65e3ec804d3adda08aa7b5277207
BLAKE2b-256 checksum
How to use checksums
1a3d1da423f01bc55eec3fb0df302362ed7502413317ed575ce52534a7088ee0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Security for aisley 0.1.0

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.1.0 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