# Evidence ledger

Every local decision is recorded in a hash-chained ledger you can verify, browse and export.

Source: https://usezn.com/docs/zn-gate/evidence/

zn-gate appends each security decision to `~/.zn/evidence.jsonl`. Records are chained with SHA-256, so any edit or deletion breaks the chain and is detected on verification.

## Commands

```bash
# Verify the chain from the first record to the last
npx -y zn-gate evidence --verify

# Open the local audit dashboard in your browser
npx -y zn-gate evidence --ui

# Export for auditors (JSONL by default, or CSV)
npx -y zn-gate evidence --export --format csv --output audit-report.csv
```

## From Python

```python
from zn_gate import verify_evidence_ledger, get_evidence_stats

report = verify_evidence_ledger()
print(report["valid"], report["verified"], "/", report["total"])
print(get_evidence_stats())
```

## Cloud evidence

Requests to the [Cloud API](https://usezn.com/docs/api/) return an `evidence_id`. Look it up in the dashboard evidence vault; retention depends on your plan (see [pricing](https://usezn.com/pricing/) and the [privacy policy](https://usezn.com/privacy/)).
