Field Notes · November 2026 · Kalun · Security

My own audit trail leaked secrets

I built Kalun to log what a coding session did, then ran Cloudflare's security audit skill on it. My redaction had real gaps, including a private key that leaked past its first line. Here's what I changed and what the audit cost.

I built Kalun to give me a receipt for each Claude Code session. It reads the transcript afterward and writes a flight log. I wanted to be able to share that receipt, so every line goes through a function that hides secrets.

I thought it worked. I never tried to break it.

Letting a second pass attack the first

Cloudflare put out security-audit-skill, from their post on building your own vulnerability harness. Hunters look for bugs. Separate verifiers then try to knock each one down. I pointed it at Kalun on the quick profile, source only.

Three hunters found about 25 candidates. The verifiers checked 18 root causes. 14 held up, 3 held up in part, and 1 mostly fell apart. Several the hunters called high came back medium or low. That's why you want the second pass. It cost 6 of 10 agent calls and about 450K subagent tokens.

Audit flow: Kalun source goes to 3 hunters who found about 25 candidates, then 18 root causes were verified. 14 held up, 3 held up in part and 1 mostly fell apart.
Quick profile: 6 of 10 agent calls, about 450K subagent tokens.

What it found

The repo and all 21 commits were clean. The output wasn't. The scrub had real gaps:

  • A private key was redacted on its first line only. The body went straight into the receipt.
  • One spot scrubbed after cutting the text. A token cut in half no longer matched, so a prefix leaked.
  • It missed common shapes: AWS secret keys, Stripe keys, npm tokens, Slack webhooks, cookie headers, and the password flags on mysql and sshpass.
  • My Windows username showed up in file paths.

The receipt wasn't honest in places either. A claim with the word "not" earlier in the sentence got dropped with no trace. A missing tool result counted as a success. That's worse for a tool whose whole job is to be trusted.

The fix

Before: the text is cut, which splits a fake token, so the scrub misses it and a prefix leaks. After: the whole report is scrubbed once at the end and the token becomes REDACTED.
The token here is a made-up fixture, the same kind the hygiene test uses.

I scrub once now, at the very end, over the whole report, after every cut. I also added a test that feeds in fake tokens of each real shape and fails if any survive. Scrubbing field by field was the bug. One choke point fixes it.

The fixes are merged and 38 tests pass. I ran the new shapes through it myself before I trusted that.

Here's what that looks like in a receipt. A session claims it pushed, the push was denied, and the secret in the final message is gone.

A sample Kalun receipt. The session said it deployed and pushed to origin, but the push was denied, so the claim is marked unverified and the password in the final message shows as REDACTED.
Made-up transcript. No real session data.

Do this on yours

Audit the tool that handles your secrets, not just the app that uses them. Scrub last, never before a cut. Test redaction with fake tokens of each real shape. And expect the first pass to overrate severity, which is the verifier's job to fix.

One caveat: this was a quick profile, source only, with nothing run in a sandbox on Windows. It's partial coverage, not a clean bill of health.

Lone Herd badge: a longhorn steer head in a ring
Lone Herd

Gather it. Connect it. Move it.