Skip to content
Leashr

An audit journal for what your coding agent was allowed to do

Record every allow, ask and deny decision of a coding agent in a local file, then read it back as a table. Real output, and the honest limit: the file is not tamper-proof.

Thomas Devulder · Published · Updated

Journal motif: a page of horizontal rows with one highlighted green row and small status dots.

When an agent works for an hour, you want to know afterwards what it tried and what it was allowed to do. Not a summary written by the agent, but a record written by the program that decided. That is an audit journal.

Leashr writes one line per decision into a local journal, inside the project. Each line has the time, the type of event, the decision, the rule that fired, the tool and its target, and the session, agent and mission it belongs to. This article shows the real journal of a short throwaway session, and says plainly what the journal cannot prove.

How a decision becomes a line

  1. agent

    proposes a call

  2. hook

    applies the rules

  3. journal

    one line per decision

  4. audit

    reads the lines back

The hook that decides is the one that writes. Reading the journal later needs no model.

A real session, read back

The session below ran a mix of calls through the real rules: a force push, a test run, a package publish and a few reads of secret files. The command that follows lists the most recent decisions as a table.

node .leashr/bin/audit.js --limit 20
Journal: <project>/.mission/events (15 events)
time                  type            decision  rule                     tool  target                                           session  agent  mission
2026-11-28T23:48:35Z  guard.denied    deny      deny-git-force-push      Bash  git push --force origin main                     s1       main   checkout-fix
2026-11-28T23:48:35Z  guard.deferred  defer     default                  Bash  git push --force-with-lease origin feature/demo  s1       main   checkout-fix
2026-11-28T23:48:35Z  guard.denied    deny      deny-git-force-push      Bash  git push --force origin main                     s1       main   checkout-fix
2026-11-28T23:48:35Z  guard.allowed   allow     allow-read-only-shell    Bash  npm test                                         s1       main   checkout-fix
2026-11-28T23:48:36Z  guard.asked     ask       ask-publish              Bash  npm publish                                      s1       main   checkout-fix
2026-11-28T23:48:36Z  guard.denied    deny      deny-secret-files-tools  Read  .env                                             s1       main   checkout-fix
2026-11-28T23:48:36Z  guard.denied    deny      deny-secret-files-shell  Bash  cat .env                                         s1       main   checkout-fix
2026-11-28T23:48:36Z  guard.deferred  defer     default                  Read  .env.example                                     s1       main   checkout-fix
2026-11-28T23:48:36Z  guard.denied    deny      deny-secret-files-shell  Bash  cat ~/.kube/config                               s1       main   checkout-fix
2026-11-28T23:48:36Z  cap.set                                                                                                            main   checkout-fix
2026-11-28T23:48:36Z  cap.kill_on                                                                                                        main   checkout-fix
2026-11-28T23:48:36Z  cap.denied      deny      kill_switch              Bash  ls                                               s1       main   checkout-fix
2026-11-28T23:48:36Z  cap.kill_off                                                                                                       main   checkout-fix

exit 0

Real output, replayed by tools/blog-outputs.mjs on 2026-11-28 in a throwaway project with the published rules (14c37dc Leashr 0.1.0).

Read it from the left. The decision column says deny, allow, ask or defer. A deferred decision means no rule had an opinion and Claude Code's own permissions applied. The rule column names the rule that fired, so a surprise refusal can be traced to one line of one file.

  • deny

    git push --force origin main

    Rule deny-git-force-push

  • allow

    npm test

    Rule allow-read-only-shell

  • ask

    npm publish

    Rule ask-publish

  • deny

    Read .env

    Rule deny-secret-files-tools

  • no opinion

    Read .env.example

    No rule matched

Five of the decisions in the journal, as cards. Source: content/data/blog-outputs.json, replayed with the real evaluate.js of the published rules (14c37dc Leashr 0.1.0).

Why record deferred calls too

It is tempting to log only the refusals. The deferred lines matter just as much. The call that read an example environment file was deferred because no rule objects to it, and the journal shows that this was a choice of the rules and not a gap in the logging. When you tighten a rule later, the old journal tells you what it would have changed.

Filtering, summarising, exporting

The audit command reads the journal and can filter by mission, session, decision or rule, summarise, or export as JSON, JSONL or CSV. Secrets are masked in every output. The journal is a set of plain files, one per day, so you can also read it with the tools you already have.

Read the last decisions
node .leashr/bin/audit.js --limit 20

What this journal cannot prove

The journal is a plain file without a hash chain. Anyone who can write to the project can edit it, so it is a record for you and your team, not evidence against a determined person. It also records calls that reached the hook. A call that the hook never saw leaves no line, which is why the next article, on what a hook cannot catch, matters.

Questions the journal answers in a minute

  • Which rule refused the call that stopped my agent, and what did the rule say?
  • Did the agent try anything I would have refused, even once, during the night?
  • Which calls were left to Claude Code's own permissions because no rule had an opinion?
  • Which mission did a session belong to, so that the decisions can be grouped with its cost?

The last question is why the mission appears on every line. A mission is a name you give to a piece of work before you start the agent. The decisions, the cost and the journal all carry it, so the same name joins the three views of one task. Without it you would be matching timestamps by eye.

A journal also changes how you write rules. A rule that fires too often shows up as a column of identical lines, and you can see at once whether to loosen it or to explain it to the team. A rule that never fires may be dead weight or may be waiting for the one day it matters. The file will not decide for you, but it gives you the evidence.

Keep it as what it is. A local, honest log of decisions beats a memory of what the agent probably did, and it costs nothing to read.

Try the rules on your own project

The code is public. Install from a clone, or as a Claude Code plugin, and read each skill with a replayed example.