· 6 min read
The check I run before an agent touches anything live
A practical, no-hype walkthrough of the pre-flight check I run every time an AI agent is about to touch a live system, not a sandbox.
I run AI agents against real infrastructure most days. They write files, push commits, hit APIs, touch databases, send messages. None of that is theoretical for me, and none of it is scary once you build one habit: you stop and check before the agent is allowed to do anything that can’t be undone with a click.
This isn’t a philosophical piece about AI safety in the abstract. It’s the concrete checklist I actually run, in order, before letting an agent operate on something live instead of a sandbox. If you’re wiring agents into real tools through MCP, shell access, or API keys, this is the boring part that keeps you out of trouble.
What “live” actually means here
Before the checklist makes sense, you need a clear line between “sandbox” and “live.” Live means: a production database, a deployed site, a real inbox, a real payment flow, a shared repo other people pull from, anything with a customer or a follower on the other end.
Sandbox means: a local branch nobody else reads, a test database seeded with fake rows, a staging environment that resets nightly. The agent can do whatever it wants in a sandbox. That’s the point of having one. The check below only applies the moment you’re about to point an agent at something that isn’t.
A lot of people skip this distinction because it feels like extra plumbing. It isn’t. It’s the single cheapest thing you can set up, and it’s what makes everything after it low-stakes.
Check one: what can this agent actually reach
Before I look at what the agent is about to do, I look at what it’s able to do. Most agent setups give a model tool access, not task access. If you hand an agent a shell, it can run any shell command, not just the ones related to the task in front of it. If you hand it a database credential, it can read and write every table that credential covers, not just the one row you’re thinking about.
So the first question is always: given the credentials and tools this agent currently has, what’s the worst single command it could run right now? If the answer includes things like dropping a table, force-pushing over a shared branch, or deleting files outside the working directory, that’s a scoping problem, not a prompting problem. No system prompt reliably prevents a capability that the tool layer allows. I fix this by narrowing the credential or the tool, not by asking the agent nicely to be careful.
Check two: is the working directory clean
This is the one I skip least often, because it’s saved me the most times. Before any agent runs a command that could discard or overwrite work, I check the state of what’s there. In a git repo that means running a status check before anything that could touch history or the working tree, git checkout, restore, reset, or clean, and stashing or committing anything uncommitted first. Outside git, it means checking for files that look mid-edit, half-written, or otherwise not mine to overwrite.
The reason this matters more with agents than with a human collaborator is speed. A person pauses naturally before running something destructive because typing the command takes a few seconds and gives them a moment to notice a file they don’t recognize. An agent doesn’t have that pause built in. It’ll run the command in the same breath it decided to. So I build the pause in manually, as a step that happens before the risky action, not as something I trust the agent to remember on its own.
Check three: read-only first, write second
Whenever the task allows it, I have the agent do a read-only pass before a write pass. Look at the file before editing it. Query the row before updating it. List the messages in the channel before posting to it. This does two things. It gives the agent actual context instead of assumptions, which cuts down on it acting on stale information. And it gives me a checkpoint where I can look at what it found and decide whether the plan for the write step still makes sense.
This is also where I catch scope creep. An agent asked to fix one broken link will sometimes decide, on its own initiative, that three other things nearby also need fixing. That instinct isn’t wrong in a sandbox. On a live system it means the agent is now touching more surface area than the task called for, and every extra thing it touches is something I now have to verify. The read pass is where I see that expansion happening and can pull it back to the original scope before any write happens.
Check four: is this reversible, and how
For everything the agent is about to do live, I ask what it would take to undo it. Some things are trivially reversible: editing a text file, pushing a commit you can revert, updating a database row you have the old value for. Some things are not: sending an email, posting publicly, deleting a branch nobody else has a copy of, force-pushing over history, running a migration that drops a column.
The irreversible category isn’t off-limits, but it gets a different rule: the agent proposes, I confirm, then it acts. Not a blanket “yes go ahead for the rest of the session,” a specific confirmation for that specific action. This is the same instinct behind not letting a script auto-confirm a production deploy. The cost of typing “yes” one more time is nothing. The cost of an agent sending the wrong message to a real customer, or force-pushing over three days of a collaborator’s work, is not nothing.
For the reversible category, I’m much looser. If an edit is one git revert away from gone, I let the agent move faster and I review the diff after, not before every single change.
Check five: what does the audit trail look like after
Last thing I check, before the agent runs, is whether I’ll be able to reconstruct what it did if something goes sideways an hour later. That means: does the tool call log anywhere, does the commit have a message that explains itself, does the action leave a timestamp somewhere I can find it. Agents that operate silently, where the only record of what happened is the end state, make debugging much harder than it needs to be, because you’re left diffing before-and-after with no idea what steps got you there.
This isn’t about distrust of the agent specifically. It’s the same reason you want good logs on any automated system, human-triggered or not. When something breaks in production, “what changed and when” is the first question, and if the answer is “I don’t know, the agent did something,” you’ve lost time you didn’t need to lose.
What this checklist is not
It’s not a guarantee. No amount of scoping, dry-running, or confirming turns an agent into something that never makes a mistake. Models still misread instructions, still occasionally do something confidently wrong, still sometimes need a human to catch it. This checklist doesn’t fix that. What it does is shrink the blast radius of the mistakes that do happen, so a wrong call costs you a revert instead of a real incident.
It’s also not a reason to slow every task down to a crawl. Most of what an agent does day to day, in a sandbox or on a low-stakes reversible task, doesn’t need this much ceremony. The checklist is specifically for the moment before something live and hard to undo is about to happen. Reserve the caution for where it’s earned, and let the agent move fast everywhere else. That balance is the whole point of running agents in production instead of just admiring them in a demo.
If you want more of this, the concrete, run-it-yourself side of putting AI agents to work rather than the hype around them, you can find the rest of what I write and record over on the home page.
Get new guides and videos first — join the Telegram channel.