Bound the run before you start it
An agent session is a production job the moment it can
spend money, touch a repo, or talk to a vendor API. The
laptop does not make it a scratchpad. Yesterday’s review
problem was volume. Today’s operations problem is the
uncapped loop: cheaper models, longer tool traces, and a
human who walks away. Three controls belong on the session
object, not in a later postmortem.
First, a spend bound. A session budget is not a polite
suggestion. It is a number the runtime checks before the
next model request. Size it with a one-request overshoot
in mind, and decide in advance whether hitting the cap
means pause-and-ask or abort. If your harness cannot idle
with a named stop reason, you do not have a budget—you
have a hope. Confirmation prompts do not substitute;
people click through them, and auto modes will keep
clicking for you.
Second, a transcript you can actually retrieve. Local
Claude Code sessions now show the pattern clearly:
compliance sees the API conversation, not the disk.
Thinking is stripped. System prompts are a marker. Files
never sent do not exist in the record. That is still
enough to answer “what did we ask it to do?” and “which
tools fired?” It is not enough to reconstruct a leak that
never left the machine. Write the coverage down. If you
need device evidence, collect it yourself—tool logs,
command transcripts, screenshots—because the vendor
transcript will not grow those fields later.
Third, a smoke that cannot inherit the author’s desk.
Hidden dependencies, extra groups, and a warm virtualenv
are how agent-written packaging lies. The sqlite-utils
crash is the smallest version of a harness bug: the
check ran in the same environment that wrote the code.
Isolated, no-default-groups, or a clean container is the
cheapest honest test you can add today.
Put together: create the session with a cap, know what
the audit log will contain, and refuse to call a tool
shipped until it runs somewhere that is not your laptop’s
leftovers. The human job is to choose those bounds. The
agent’s job is to work inside them.
Checklist
-
Before the first prompt: set a dollar or token cap and
a named stop when it hits.
-
Prefer pause-and-idle over silent continuation; require
a human to raise the cap.
-
Write what your transcript includes and omits (API
text vs device activity, thinking, files never sent).
-
Store or export the session id with the PR or ticket so
a later audit is a fetch, not a memory.
-
Smoke the shipped CLI or package with
--isolated / no dev groups / a clean
container—not the author’s venv.
-
If the model got cheaper this week, shrink the default
cap or the default timeout; do not grow the leash.
This week: pick one standing agent job, give it a session
budget and an isolated smoke, and do not start the next
run until both exist.