Metadata-Version: 2.4
Name: traceseal-verify
Version: 1.1.0
Summary: Verify Traceseal Execution Receipts — cryptographic proof of what your AI agent did
License: Apache-2.0
Project-URL: Homepage, https://traceseal.io
Project-URL: Specification, https://traceseal.io/spec
Project-URL: Source, https://github.com/traceseal/traceseal-verify
Keywords: ai,agents,trust,verification,receipts,ed25519,traceseal
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cryptography>=41.0
Dynamic: license-file

# traceseal-verify

Verify [Traceseal Execution Receipts](https://traceseal.io/spec) — cryptographic proof of what your AI agent did.

## What is an Execution Receipt?

Every AI agent framework can make agents *do things*. None of them can *prove what the agent did* to a third party. A Traceseal Execution Receipt is a signed JSON document that proves:

- **What code ran** — manifest hash over every source file
- **Who authorized it** — publisher's ed25519 signature in a transparency log
- **What sandbox it ran in** — hash of the kernel-namespace configuration
- **What it produced** — SHA-256 of inputs and outputs (not the values — privacy preserving)
- **Who vouches for it** — operator's ed25519 signature over everything above

Third parties verify the receipt with one command. No access to the operator's machine needed.

## Install

```bash
pip install traceseal-verify
```

## Verify a receipt

```bash
traceseal-verify receipt.json
```

```
[OK] receipt.json
  skill:     agentmail v1.2.0
  operator:  ed25519:f19bc125dcfdb2eb91e98da98d45bb7a
  publisher: ed25519:a07c7eb5f20f6b99d1914d7ec5221a25
```

Every receipt type in the v1 envelope verifies: skill, model, tool,
data_flow, orchestration, outcome, oversight, policy_decision, incident,
erasure, evidence_pack, chain_key_rotation and the model-provenance
profiles. The output names the type and a few key facts:

```
[OK] receipts/02-oversight.json
  type:      oversight (decision=approved, review_seconds=30, chain=support-agent#2, agent=support-bot, reviewer_signed=true)
  operator:  ed25519:56475aa75463474c0285df5dbf2bcab7
```

## Verify a chain of receipts

Give several chained receipts at once and traceseal-verify also checks
the hash links between them:

```bash
traceseal-verify receipts/*.json
```

```
[FAIL] chain support-agent: seq 1..42, 40 receipt(s), from genesis: True
  GAP: seq 17..18 missing
```

It reports:
- missing positions (gaps);
- two different receipts at one position (forks);
- broken `chain_prev_hash` links;
- signing-key changes that didn't go through a valid, dual-signed
  `chain_key_rotation`.

Use `--allow-gaps` to report gaps without failing, and `--no-chain` to
skip these checks.

Checkpoints, inclusion proofs, RFC 3161 timestamps, time windows,
causality and human-oversight checks live in
[`traceseal-observe`](https://github.com/traceseal/traceseal-observe)
(`traceseal-chain`, `traceseal-trace`, `traceseal-report`).

## Python API

```python
from traceseal_verify import verify_receipt_file, check_chains

result = verify_receipt_file("receipt.json")
if result.ok:
    print(result.receipt_type, result.summary, result.operator_fingerprint)
```

## What verification checks

1. **Structure**: required sections present, recognised version.
2. **Consistency**: for skill receipts, execution and provenance agree on
   which code was signed.
3. **Fingerprint**: the displayed `operator_fingerprint` is derived from
   the embedded public key (spec §4 Step 3). It sits outside the
   signature, so without this check a valid receipt could be relabelled
   with someone else's identity.
4. **Signature**: the operator's Ed25519 signature is valid over the
   execution and provenance data.
5. **Chain links**: across multiple receipts, as above.

## What verification does NOT check

- Whether the operator's key is trusted. That's your policy decision. An
  organisation can publish its keys at
  `https://<domain>/.well-known/traceseal/operator-keys.json`; check them
  with `traceseal-keys verify` from traceseal-observe.
- Whether the publisher's key is trusted (your policy decision).
- Whether specific inputs or outputs match expected values (your
  application logic).
- Domain-profile semantics beyond the envelope, such as signed-time
  profile 1.1 rules. Those are checked by the profile's own tools.

## Generating receipts

Receipts are generated by [traceseal-observe](https://github.com/traceseal/traceseal-observe) (AI agent actions) and [Traceseal](https://traceseal.io) (sandboxed skills). This package is the verification side only, kept deliberately minimal (one dependency) so anyone can verify without installing the full toolchain.

## Spec

[Traceseal Execution Receipt Specification](https://traceseal.io/spec)

## License

Apache 2.0 — no barriers to verification in any context.
