Don't Give Your AI Agent the Database Keys
An old lesson about a friend, a lost virtual drive, and the controls that should sit between a capable agent and consequential changes.
When I hear about a coding agent deleting a database, I think of my old mate Gerald.
After a night out, I'd mentioned that my computer was running badly. Gerald kindly offered to have a look on the way home. A few mouse clicks and an unmounted virtual drive later, I'd lost about a year's worth of data, including photographs of my old band.
I don't blame Gerald. I gave him access after he'd had about eight pints. Alongside the obvious lesson about backups and recovery, I learned something quite specific: don't give Gerald, after eight pints, access to your data.
The more useful lesson took longer to unfold. Why was one person's judgement, at that moment, the thing protecting the data?
Make the safe route the normal route

As my career progressed, the question became less about which person I trusted and more about how changes should happen.
Putting a change into code gives other people something to inspect. Running it through a defined process creates places to test it, question it, and stop it. Access can be narrower than a person's general ability to improvise at a keyboard.
None of that means code is automatically safe or that every outcome is predictable. It means we can make the proposed change visible before it takes effect, and we can design controls around the consequences.
That reasoning applies when the person proposing the change is using an agent. An impressive ability to diagnose a problem doesn't, by itself, justify permission to make every possible repair.
I'd rather ask what the agent can do through the approved change process than give it broad access and hope it behaves carefully.
A request is different from a permission
“Please fix the database problem” describes an intention. It leaves a lot unresolved.
Can the system inspect production data? Can it change a schema? Can it remove records? Which environment is it connected to? Does the person asking understand what access has already been granted?
Those are design decisions. They need answers outside the conversation with the agent.
For a proposed database change, I'd want a reviewable account of what will change, why it's necessary, and how we'll check the result. The permissions should match the approved operation. A failure should leave us with enough information to understand what happened and decide how to recover.
That's a practical extension of the Gerald lesson. We shouldn't depend entirely on whoever happens to be holding the keys, whether they're human or an AI system.
Recovery belongs in the plan

My lost band photographs also make me wary of treating “we have a backup” as the end of the discussion.
Before a consequential change, I'd want to know what recovery would involve. Which data is covered? Who can initiate a restore? What would be lost between the backup and the failure? Has the relevant recovery path actually been checked?
The right level of assurance depends on the system and the consequence. A disposable development database and a customer service's production data deserve different decisions.
An agent can help prepare that evidence. It can inspect a proposed change, run permitted checks, or explain an error. Responsibility for deciding whether the evidence is sufficient still needs to be clear.
Review the system around the agent
When something goes wrong, it's tempting to ask whether the model was clever enough, or whether the operator wrote the prompt correctly.
I'd start a little wider. Why could that operation happen? Which control should have caught it? Was the approved route easy to follow? Did an exception quietly become normal practice?
The aim is to improve the system the next person or agent will work within.
Before giving an agent access to consequential data, I'd ask three questions:
- What is the smallest set of operations it needs to perform this job?
- What evidence must be reviewed before a change takes effect?
- If the change is wrong, how will we recognise that and recover?
Gerald meant well. So do plenty of people who make damaging changes. Good intentions deserve a process that helps them survive contact with reality.
Adapted from the Akermoor video about Gerald and database access. The story is my recollection; the change-control questions are practical recommendations, not a reconstruction of a third-party incident.