reload.wtf
← Blog
#agents#git#ops#ai

Give the agent a sandbox, not production

Worktrees, branch policies, and human gates — how to use agents without torching the monorepo.

Agents fail loudly in files and quietly in state. The difference between a useful session and a disaster is usually isolation.

Blast radius checklist

Before tools are enabled, decide:

SurfaceDefault for agents
Branchdedicated, never main
Working treegit worktree or clean clone
Secretsnone in shell env you paste
Networkallowlist if you can
Deploy / pushhuman approval
rm, migrate, force-pushhard deny or explicit confirm

If the agent can git push --force to default, you do not have a coding agent. You have a chaos monkey with a language model.

Worktrees beat “stash and pray”

git worktree add ../app-agentic -b agent/foo
cd ../app-agentic
# agent works here

Benefits:

Human gates that actually help

Not every step needs a human. These do:

  1. First plan on ambiguous product work
  2. Schema / migration changes
  3. Auth, billing, permissions
  4. Anything that leaves the machine (push, publish, email, prod API)
  5. Dependency major bumps

Autonomous inside the fence. Stateful outside it.

Context is a resource

Agents do not “know the repo.” They see what you (or the tool layer) stuffed into the window.

Prefer:

Dumping the whole monorepo into context is how you get confident edits to the wrong package.

Decision rule

Autonomy scales with reversibility.

Reversible?Autonomy
Local branch, tests onlyhigh
Shared stagingmedium + logs
Production data / customerslow / pair only

Agentic development is powerful because it multiplies action rate. Your controls must multiply undo at least as fast.

get new posts

Occasional notes on agentic development. No spam.