> ## Documentation Index
> Fetch the complete documentation index at: https://ctrlrun-release-0-10-0.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Receipt

> Portable evidence of one action that reached a terminal state (SPEC-v0.1 §6.1).

`ctrlrun.Receipt` — class, defined at `src/ctrlrun/receipt.py:399`

```python theme={null}
from ctrlrun import Receipt
```

```python theme={null}
class Receipt
    def __init__(receipt_id: str, action_id: str, action: str, action_hash: str, principal: Principal, resource: str | None, arguments: Mapping[str, Any], environment: str, decision: Decision, decision_reason: str, result: ReceiptResult, started_at: datetime, finished_at: datetime, approval_id: str | None = None, approver: str | None = None, effect_key: str | None = None, attempt: int = 1, error: str | None = None, execution: ReceiptResult | None = None, would_have: _WouldHave | None = None, seq: int | None = None, prev_hash: str | None = None, policy_hash: str | None = None, policy_version: str | None = None, controls: tuple[str, ...] = (), hash: str | None = None, precondition_at_request: str | None = None, precondition_at_recheck: str | None = None, approvers: tuple[VerifiedApprover, ...] = (), authority_grant_id: str | None = None, task: str | None = None, scope_hash: str | None = None, hop: str | None = None, budget_charges: tuple[Mapping[str, Any], ...] = (), schema: str = RECEIPT_SCHEMA)
```

Portable evidence of one action that reached a terminal state (SPEC-v0.1 §6.1).

`ctrlrun.receipt/v4` (SPEC-v0.7 §6.11) adds `precondition_at_request` and
`precondition_at_recheck`: the fingerprint the approval was requested with, and the one
computed on the presenting pass, each `None` where there was none. Hashes only, never the
state they were computed from. On a refusal they say which side moved or was missing; on a
committed action they are equal, and the receipt records that the world was compared
before the reservation. That comparison narrows the window between a human's decision and
the effect and does not close it (§6.7).

`schema` is the schema the receipt is written under. A receipt read from a store keeps the
one it was written with, renders under that schema's label and keys, and is hashed as the
document it was read from, so a `v3` receipt a released 0.6 wrote still rehashes to its
stored hash under a `v4` binary.

## Next

* [Python API index](/docs/reference/api/index).
* [Get started](/docs/get-started/quickstart) · [Why](/docs/why).
