Guide · Audit

See which programs read your secrets

A secret sitting in a file can be read by anything that can open the file, and nothing records it. When a key leaks, you want to know who read it.

In shortOpen Activity in the app or run lk log to see each read with the program chain, folder and command. Run lk log --verify to check that no entry was changed, removed or added.

Why plain files can't answer this

A .env file records nothing about who opened it. A leaked key could have come from your editor, a test run, a script, or an agent working in the folder. Without a record you rotate everything and guess.

With Latchkey, values are read through the app, and the app logs each read, change, grant, move, import and push. The log holds the program chain and the folder. It does not hold values.

Read the record

  1. Look in Activity

    In the app, Activity has search, and filters by event and project, grouped by day. An entry's detail shows the action, the items, the decision, who asked and through which programs, the folder and the command.

  2. Read the log from the terminal

    The same entries are available from the command line. --limit takes 0 through 1000.

    Terminal
    lk log --limit 20

    lk log prints one readable line per entry. The file behind it, ~/Library/Application Support/Latchkey/access.jsonl, holds one JSON object per line. The fields to read are op (what happened), names (which items), decision (allowed or approved, with why; or denied or refused), chain (the calling program's parent processes, nearest first), cwd and command. This one is an example:

    Example entry
    {"chain":["zsh","claude","Terminal"],"command":"latchkey run -- npm test","cwd":"/Users/you/Projects/shop","decision":"allowed (grant k3v9q2)","names":["shop/development/DATABASE_URL"],"op":"get","time":"2026-11-10T20:14:03Z"}

    Real entries also carry prev and mac, the hash chain that --verify checks.

  3. List what one program touched

    To ask what was released to programs started under a name, such as an agent, use touched. It reads the access log on this Mac, and counts reads that were allowed or approved.

    Terminal
    lk touched --since 24h --by claude
  4. Check the log wasn't edited

    Each entry carries a keyed hash of itself and the entry before it. The key lives in your keychain, where only Latchkey can read it. Verifying checks the whole chain.

    Terminal
    lk log --verify

    When every entry is as Latchkey wrote it, it prints intact: N signed entries and exits 0. Otherwise it exits 1 and names the first line that isn't, with the reason. It finds an entry that was changed, removed or added, and a log cut short.

  5. Check an item's earlier values

    For one item, history lists earlier values by when, why (changed, deleted or restored) and by whom. It never prints the values. Latchkey keeps the last 10 earlier values of each item.

    Terminal
    lk history shop/development/STRIPE_KEY

What this doesn't do

More detail is in the log, history and Security.

Related