# Replay

Replay shows an agent's decisions and outcomes in order, with their inputs and outputs. Each record is checked against its `content_hash`, the agent's signature and the service's receipt before it is shown, so what you see is what the agent saw.

```bash
signafaide replay --agent claims-bot --from 2026-11-01 --to 2026-11-13
signafaide replay --agent claims-bot --record 3fa2b1c9          # one record and its decision or outcome
signafaide replay --agent claims-bot --html replay.html         # also a self-contained page
```

The Python and TypeScript CLIs give the same result (`npx signafaide replay` for TypeScript). `--from` and `--to` take a date (`--to` includes that day) or a time like `2026-11-13T10:00:00.000Z`. The exit code is `0` when everything verifies and `1` when something fails.

```python
import signafaide

r = signafaide.replay(agent="claims-bot", since="2026-11-01")
print(r)                          # the terminal view
open("replay.html", "w").write(r.to_html())
assert r.ok
```

```ts
import { replay } from "signafaide";

const r = await replay({ agent: "claims-bot", since: "2026-11-01" });
console.log(String(r));
if (!r.ok) process.exit(1);
```

## Where the content comes from

Hash-only is the default: inputs and outputs stay in your `.signafaide/chain/<project>/<env>/<agent>.jsonl`, and the service holds only their hashes. Replay reads that file, so run it where the folder is.

Each record shows one of:

| status | meaning |
|---|---|
| `verified` | the content matches its hash, the signature verifies, and the receipt proves the service accepted it |
| `signed` | signed and chained, but not co-signed by the service yet (still in the outbox) |
| `FAIL` | something does not match; the reason is printed under the record |

If anyone edits a line of the chain file, for example an input, that record fails with "content hashes to ..., envelope says ...".

## In the console

**Review → Replay** shows one agent over a time window, verified by the service. Records whose content is stored with the service (Team plan) show their inputs and outputs inline. For hash-only records the page shows the exact command to run locally.

Replay never writes anything. It is on the Team and Enterprise plans in the console; the CLI works on every plan.
