ai newsMi., 25. Nov.
EilmeldungCan Claude’s storage webhooks miss an hour-long outage?

How to Stop an AI Agent From Deleting Your Production Database (Prompt Rules Won't)

This was not the first time In July 2025 a Replit agent deleted the production database of Jason Lemkin's SaaStr project more than 1,200 executive records, during an explicit code freeze. It had been told not to change anything without permission. It also said the data could not be restored which t

dev.toDienstag 09:47 · 24.11.5 Min. Lesezeit
Bild: dev.to

This was not the first time In July 2025 a Replit agent deleted the production database of Jason Lemkin's SaaStr project more than 1,200 executive records, during an explicit code freeze. It had been told not to change anything without permission. It also said the data could not be restored which turned out to be false. Both agents had rules. Both broke them. This post is about controls that do not depend on the agent following rules.

Disclosure: I build Provenza, an open-source, self-hosted control plane for AI agents. The examples below use it. The ideas behind them work with any tool, and the last section says honestly where Provenza does not help.

A rule in a system prompt, an AGENTS.md or a.cursorrules file is text the model reads. It shapes behavior most of the time But:

A database you can't afford to lose needs a control the model can't talk its way past: one that runs outside the model, before the call and that the agent cannot edit. Most write-ups after PocketOS give good hygiene advice: don't keep production tokens where an agent can read them,scope tokens, keep backups off the volume they protect Do all of that Below are three layers that still hold when the hygiene fails.

Layer 1: the agent may call only approved tools, with approved arguments

The first layer decides what an agent may call, and with what. You can build a basic version yourself: give the agent a wrapper tool instead of a raw database connection, and have the wrapper refuse or queue anything destructive. In Provenza, an agent reaches tools through an MCP gateway. It sees only the tools an administrator approved, and every call is checked against a policy before it runs. A policy is plain YAML. Here is one that lets an agent use a database tool but stops anything destructive until a person approves it:

version: 1 tools: allow: [ "db.*", "kb.*" ] deny: [ "shell.*" ] require_approval: [ "db.migrate" ] arguments: # any SQL with DROP, DELETE or TRUNCATE waits for a person - { tool: "db.query", arg: sql, op: not_matches, value: '(?i)\b(drop|delete|truncate)\b', effect: require_approval} # file tools stay inside the sandbox ("/sandbox/../etc" counts as "/etc") - { tool: "file.*", arg: path, op: starts_with, value: [ "/sandbox/" ] } Enter fullscreen mode Exit fullscreen mode When the agent tries DROP TABLE customers, the call does not run. It waits for a person, and the approval is signed with that person's passkey. A refusal names the rule that refused it, for example:

Blocked by policy 'organization policy': argument 'amount' must satisfy max 100 Enter fullscreen mode Exit fullscreen mode A few details matter here, because a gate that can be bypassed is worse than none:

Layer 2: a stolen token is useless if the network is closed

PocketOS was not lost through an approved tool. The agent found a token and called the infrastructure API directly. A tool gateway never sees that call.

Every control in Layer 1 is cooperative: it works only when the agent goes through it. So the second layer is the network. The agent's host gets one way out, and everything else is refused by the kernel.

Without any special tool, that is a firewall allow list (nftables, a security group) plus a forward proxy that holds the real credentials. Provenza does this in two ways. An egress proxy that holds the credentials.

The agent calls http://proxy:8443/<route>/..., not the API itself. The proxy checks the call with Provenza, adds the credential and records the result. The agent never holds the real token, so there is nothing for it to find in a file.

Its own Authorization header is not passed on. Routes limit methods and path prefixes, and you can require a person's approval for a whole route:

tools: require_approval: [ "proxy.railway" ] # every infrastructure call waits for a person Enter fullscreen mode Exit fullscreen mode (Railway's API is GraphQL on one endpoint, so a path rule can't tell a read from a delete. That's why the example gates the whole route.) An eBPF sensor that learns, then enforces. Since the latest release, every new agent gets its own network workload in observe mode.

On a Linux host with the sensor, you attach the agent to its systemd service or container with one click. You don't change anything on the host or restart the agent. The agent's page then lists every host it connected to, by name.

When the list looks right, "Allow the checked and enforce" turns it into an allow list. From then on, the kernel refuses every other connection. Observe first, enforce when a person decides.

A new agent is never blocked by a list nobody wrote, and an agent you have reviewed cannot reach an API it was never meant to touch, even with a valid token in hand.

Layer 3: an audit log you can check without trusting the server

After an incident, two questions matter: what happened, and who allowed it? If the agent, or whoever runs the server, can edit the log, the answer is worth little. The general idea: write every agent action to storage the agent and the operator cannot rewrite, such as an S3 bucket with Object Lock, and keep a copy of the log's hash somewhere else. Provenza's audit log is append-only and hash-chained. It is sealed under checkpoints signed with Ed25519 and ML-DSA-65, and those checkpoints are published to Sigstore Rekor, a public transparency log. Any action comes with a receipt that a standalone tool checks offline, without the Provenza server:

python3 provenza_audit.py receipt receipt-2.json --fingerprint SHA256:… # VERIFIED action 2 (…, denied) of agent 1: refused and witnessed by the Provenza mcp_gateway Enter fullscreen mode Exit fullscreen mode Change one character of the file and it says NOT VERIFIED. Proof of Authority goes one step further. For a single agent action, one file shows the whole chain behind it:

Try it Provenza is open source (Apache-2.0) and self-hosted. The quickstart goes from install to a refused tool call and a receipt verified offline. The policy and network examples above come from its policies and egress lockdown docs.

How do you keep agents away from production today: scoped tokens, separate accounts, approvals, or something else? I'd like to hear what works in practice.

Sources: Tom's Hardware, Computing, Fast Company, The Register on Replit, Slashdot / The Register summary.

Quelle: dev.to (dev.to). Original öffnen