Read the audit trail
Optional: hand this page to your coding agentThe steps work by hand too.Show the whole prompt
Read https://intentius.io/terragucci/guides/read-the-audit-trail/.
Download audit.jsonl from the top of my reports prefix with a read-only identity and tell me, for the project and wave I name,
who approved it, which digest, when it applied, and any override or refusal, each with its evidence link.
Read only: do not run `terragucci audit` without `--check`, and write nothing to the bucket.
Never apply, approve (a pull request review or `terragucci approve`), override a policy denial (`terragucci override`), use `--mode apply`, or merge; never touch `.chant/allowed_signers` or `chant/lifecycle`.Result
Section titled “Result”Each approval, apply and override in your projects, traced to the person behind it and linked to its evidence, and each state version something other than a wave or a migration wrote.
Prerequisites
Section titled “Prerequisites”| You need | Why |
|---|---|
| Reports in a bucket | the record and the wave reports it reads live there |
A terragucci audit step in the estate job, before terragucci estate |
the step writes the record (Write it) |
On the audit job’s identity, list access to the versions of each state bucket: s3:ListBucketVersions on S3, storage.objects.list on GCS, list on an Azure container |
the step compares each root’s state versions with the ones terragucci recorded; it lists ids and times and reads no state |
Optional: audit_log_group, the CloudWatch Logs group your CloudTrail trail delivers the state buckets’ S3 data events to, logs:FilterLogEvents on it, and the aws CLI in the job |
to name who wrote a version no wave recorded |
A read-only identity on the bucket, and jq |
to fetch and query the record |
Storage
Section titled “Storage”The record is three objects at the top of your reports prefix, beside estate.html:
| Object | Holds |
|---|---|
audit.jsonl |
one entry per line: every approval, apply, override, refusal, lock release, state export and migration, and every state version no wave or migration wrote |
audit.html |
counts by kind, each project’s ledger state, and the newest 1000 entries with their evidence links |
audit.json |
the summary the estate page reads to link audit.html |
terragucci builds it from sources it does not hold itself: the approval ledger on each repo’s chant/lifecycle branch, the tf-apply wave reports in the bucket, and the versions each state bucket lists.
-
Open the page, or fetch the record. The
terragucci auditstep’s log ends with a signed link toaudit.html; for the lines, use the store’s own CLI:Terminal window aws s3 cp s3://acme-terragucci/reports/audit.jsonl . -
Find the approvals of a wave. On an
approvalentry,whonames the approver anddigestthe plan digest it binds;resultsays how it was signed:Terminal window jq -c 'select(.project == "github.com/acme/network" and .what == "wave-2") | {at, kind, who, digest, result}' audit.jsonl{"at":"2026-10-08T09:12:44.000Z","kind":"approval","who":"dana","digest":"sha256:4be1...","result":"unsigned"}{"at":"2026-10-08T09:20:03.000Z","kind":"apply","who":"dana","digest":"sha256:4be1...","result":"applied"}Under
approval: ledger,whois the name the approver gave anddetail.committed_byis who pushed the line. Undersealed,detail.signeris the key’s owner, checked against the signers file at base (what each mode proves). -
Match the apply to its approval. On the
applyentry,detail.approvalholds theidof the approval it applied under:Terminal window jq -c 'select(.kind == "apply") | {at, project, what, who, digest, approval: .detail.approval, commit: .detail.commit}' audit.jsonlevidence.urlon each entry opens the commit onchant/lifecyclethat added the approval, or the wave’sreport.html. -
List the overrides.
whois the person who let the plan through, anddetail.reasonwhy:Terminal window jq -r 'select(.kind == "override") | [.at, .project, .what, .who, (.detail.rules | join(",")), .detail.reason] | @tsv' audit.jsonlThe wave that applied under it lists the root in
detail.overrideson itsapplyentry. -
List what did not go out:
Terminal window jq -r 'select(.kind == "refused" or .result == "failed") | [.at, .project, .what, .result, .evidence.url // .evidence.key] | @tsv' audit.jsonlOn a
refusedentry,resultgives the reason, such aschanged-after-approval;detailnames the roots that moved or the rules that denied. -
List the state versions written outside terragucci:
Terminal window jq -r 'select(.kind == "unrecorded-write") | [.at, .project, .what, .detail.recorded_version, .detail.current_version, (.who // "unknown"), .detail.who_source] | @tsv' audit.jsonl2026-10-09T14:02:11.000Z github.com/acme/network envs/prod/vpc 3HL4kqtJlcpXroDTDmJ.rmSpXd3dIbrHY Ox6LTnNaF7lxBz8JmbUJ1rTsr0e0v7qa unknown audit_log_group is not set, and CloudTrail's event history keeps no S3 object writesEach entry is one version the root’s state bucket lists that no wave or migration recorded:
recorded_versionis the version terragucci recorded before it, andcurrent_versionthe one written. Bring the code in line with the state, or put back the version terragucci recorded; a version put back by hand is a write outside a wave too, and gets an entry of its own. The entries stay in the record. The estate page shows the same writes beside each root’s state versions.
Check the record
Section titled “Check the record”--check rebuilds the entries from the ledgers and reports and writes nothing. It exits 1 naming each entry the record lacks:
npx --yes @intentius/terragucci audit --checkA removed ledger line shows as approval-revoked or override-revoked, with the commit that removed it; the record keeps the line it revoked.
- The audit trail lists every kind, field and retention rule.
- Query the estate answers questions over the reports and the audit trail, one filtered table at a time.
terragucciHelp setting it up: Intentius
These docs count page views and clicks with PostHog. They set no cookies, store nothing in your browser, and send nothing when your browser asks not to be tracked.