Dev.to AI 🤖 Ai 👁 0 📖 7 min read

Ten rounds with a sharp reader: how approval memory ages in a single-user AI coding agent

Last month I wrote about trust engineering for a personal AI coding agent — cost ledgers, budget caps, and the memory-poisoning gate. A reader (Agentic Affairs — go follow them, this is what engaged reading looks like) c

Ten rounds with a sharp reader: how approval memory ages in a single-user AI coding agent

Last month I wrote about trust engineering for a personal AI coding agent — cost ledgers, budget caps, and the memory-poisoning gate. A reader (Agentic Affairs — go follow them, this is what engaged reading looks like) came back and spent ten rounds stress-testing the approval-memory design: the gate, the whitelist, its growth policy, the aging, the revocation, the review loop. Twice they came back with design proposals of their own.

Every answer in this post is a mechanism that ships in the tool — file paths and all — not a defense. This is the interview, reconstructed.

Ten rounds

Q1: Has the permission-softening gate caught anything in real repos, or is it insurance?

Insurance so far — no real-repo catch, and I checked rather than guessed: swept the retained trace corpus for the gate's runtime fingerprints, zero hits on both the hard-reject and confirm paths. Zero false positives too.

But I don't rate the gate by its strike record, because the gate isn't the control. The failure it guards — a softened rule surviving every future session — is permanent, and the gate's cost is a string check nothing legitimate trips. The real cap is underneath it:

The blast radius is the control

The gate is the tripwire; the whitelist is the blast radius. Expected-value math buys the gate even at a 0% observed catch rate.

Q2: Does the whitelist ever grow, or is anything new locked out?

Both, deliberately. The core is a fixed set in code — git_commit, worktree enter/exit, undo_restore — and growing it takes a commit and a release, so the scrutiny happens before the capability exists, not after an incident.

The one open dimension is MCP: connecting a server mints per-tool names (mcp__server__tool), so the surface grows only through the user's own config action — one concrete tool at a time, never a server-wide wildcard. Command executors can never earn blanket auto-allow at all: a bare-name rule for them is rejected outright, and the most a remembered approval can produce is a scoped pattern like run_command(npm test:*). External-content tools (resource reads, prompt fetches) are excluded entirely — every fetch is a fresh injection surface, so every fetch asks.

The growth channels are my commit history and your settings file — two places neither the agent nor a poisoned README can touch.

Q3: So no poisoned README has ever actually tried it on?

Quiet — with two honest caveats: retention is finite (old traces get cleaned), and my repo diet is mostly my own projects and mainstream OSS, exactly the low-threat regime. I also can only attest to what reached the memory-write boundary, not to whatever lurked inside fetched pages.

The one attack-shaped surface that did shape real code sits adjacent: repo-supplied scripts — package.json scripts, bare npx pulls — are fenced as the repo author's arbitrary code and forced through a first human approval no matter how read-only the command string looks. That fence also came from the threat model, not from a caught specimen. Same philosophy: build the fence from the failure mode, not from strike data.

Q4: Do you treat scripts in a repo you authored differently from dependency scripts?

Equally — the fence never asks who authored the repo, because authorship is a claim about the past, while the script text is resolved at execution time. In a repo you own, what actually runs is still whatever package.json contains that day: a stale branch, a rushed commit, an agent edit, or a dependency's lifecycle hook can all change it between approvals.

That's also why the same command re-asks when it points at a different subdirectory — in a monorepo the identical string resolves against a different package.json, so the thing you approved first isn't the thing that would run second. The approved object is (command string, resolution root), not a capability. Auto-distinguishing "mine" from "pulled in" would build on a spoofable signal — a poisoned repo is exactly the thing that wants to be judged on how it looks. The fence keys on the fact and leaves the claim to you.

Q5: Do remembered rules expire, or do they quietly become standing permissions?

They don't expire — no TTL, deliberately. What keeps that from being a silent standing army is where they live and who can touch them:

Consent lifecycle

Project-level rules persist to a settings file inside the repo — versioned and diffed like everything else. And .deepseeker-code/ is on the protected-write list: the agent can never edit its own permissions, refused regardless of approval state. The only hands on those rules are yours and PRs you review.

Aging by version control, not by timer. The bet behind skipping expiry: a timer re-prompts you with no fresh context, doesn't make the content safer — re-approving the same string blind after N months is exactly as blind as living with the rule — but it does restart the approval-fatigue loop that trains rubber-stamping.

Q6: Is the settings diff reviewed with code changes, or separately?

Same review — one file in one repo, and since rules are one-liners, the diff costs seconds. But the honest nuance: most rules never see a PR at mint time. They're created at the click of "always allow" in the approval dialog — and that click is the actual review: the prompt shows the exact rule that will be remembered. Review at the front door, audit trail at the back. The commit-time diff is a re-check that nothing entered the ledger you didn't click — which means it isn't hunting intruders, it's catching your own drift: rules that made sense in February and are just ballast in November.

Q7: Do you prune proactively, or only when a diff reminds you?

Only reactively, honestly — and the design knows it. The session layer prunes itself: most remembered approvals are session-scoped and evaporate when the session ends. The persistent residue is quiet — a stale rule doesn't misfire, it sits there as an exact string.

The reason there's no sweeper is the same expected-value math: pruning well needs a usage signal (last-fired stamps per rule), and that's real machinery for an estate of a dozen one-line rules. The trigger I'd watch for is the review getting slow — the moment /permissions stops being scannable in seconds. Machinery on demand, not pre-emptively.

Q8: Is there ever a re-confirmation moment, or does the click count as consent in perpetuity?

In perpetuity — but the consent is pinned to a context, and the structure watches the shape, not the clock:

Event-driven re-confirmation

Re-confirmation does exist; it's event-driven, not time-driven. The structure re-asks when the world the rule points at changes shape, and stays silent only when the world is byte-identical to what you already said yes to. A timer does the exact opposite: it re-asks when nothing has changed, and stays silent no matter what did.

Q9: Does the review loop run on a schedule, or what triggers a human eye?

Neither — no schedule, no automatic trigger, because review without context is theater. And the deeper reason the missing schedule is survivable: content drift has no spontaneous origin. A script can't change itself. Every path by which content drifts under a pinned rule — your own commit, a merged PR, an agent edit that went through a write approval — is already a human-in-the-loop moment:

Drift has no spontaneous origin

The review isn't scheduled; it's distributed. The drift and the review travel on the same channel, by construction. The remaining failure is a human skipping the review at those moments — no schedule fixes that: someone who rubber-stamps PR diffs will rubber-stamp a monthly audit twice as fast. Review quality over review frequency is the last layer.

Q10: Would a lightweight nudge help — surfacing untouched rules at commit time?

This was the one proposal I declined, and the decline has a mechanism behind it. We already run a nudge system for in-loop corrections (repeated reads, budget overrun), with one rule it taught us: nudges fire on anomalies, never on calendars. A "rules untouched for months" reminder is a calendar — it fires at zero-signal moments, reliably enough to become furniture.

And the ride-along it asks for already exists, on a different line: when the content under a pinned rule drifts, the drift arrives through a reviewed change, and the script's changed lines are in the very diff being reviewed. The drift check rides along with the diff of the script, not of the settings file. A settings nudge that fires when nothing changed taxes every commit to catch a failure that announces itself in that same commit.

Where the instinct is right is the polarity: if the rule estate ever grows past scannable-in-seconds, the aging data (last-fired stamps) should surface on demand at /permissions — pull when curious, not push when due.

The through-line

Ten rounds, one posture: the system never pretends to do the human's part automatically — the whitelist grows by commit, rules mint by click, pruning happens by reminder. What it does is keep the human's part cheap: one-line diffs, a scannable list, seconds per review.

Nothing here is sophisticated. It's mostly the refusal to add machinery that flatters the design diagram but does nothing the review loop doesn't already do better — the same bookkeeping-with-a-grudge spirit as the cost ledger from the first post.

If this kind of thing is useful, the cost ledger post and the cache-granularity post are the earlier chapters. The tool itself is deepseeker-code — a single-user local coding agent, source in the open.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.