Why bulk writes slip past existing controls
An agent connected to a system of record through APIs, tool calls, or Model Context Protocol (MCP) servers can change thousands of records in one run. The causes are usually ordinary:
- A misinterpreted instruction.
- Faulty reasoning about which records match.
- A loop that retries without converging.
- Prompt injection that redirects the task.
- Credentials broader than the task needs.
Conventional controls were not built for this. API rate limits bound requests over time, not the cumulative number of records changed. A slow loop can stay under any rate limit for hours, and a single call with a broad filter can touch thousands of rows. Role-based access answers whether an identity may update a resource. It does not answer how many updates are reasonable for one task.
Where write limits can be enforced
Limits belong at the tool-call layer, outside the agent and the prompt. A gateway, an MCP server, or a policy enforcement point can count creates, updates, and deletes cumulatively and decide whether each call proceeds, so the agent cannot bypass the limit. The table compares what each common control does and where it falls short for bulk writes.
| Control | What it does | Gap for bulk writes |
|---|---|---|
| API rate limit | Bounds requests over time. | Does not bound the cumulative number of records changed. A slow loop can stay under it for hours, and one broad call can touch thousands of rows. |
| Role-based access | Answers whether an identity may update a resource. | Does not answer how many updates are reasonable for one task. |
| Prompt instruction | Gives guidance to a probabilistic system. | Not enforcement. The agent can misread, ignore, or be manipulated out of it. |
| Gateway, MCP server, or policy enforcement point | Enforces cumulative per-run and per-window caps on create, update, and delete operations at the tool-call layer. | Applied where the tool call is executed, by a component the agent cannot reason its way around. |
Designing the layered control set
No single control is enough. Combine scoped credentials, per-run and per-window caps, batch sizing, dry-run previews, threshold-based human approval, circuit breakers, rollback paths, and audit logging. Each layer covers a different failure.
| Layer | Role in the control set |
|---|---|
| Scope | Least-privilege credentials limit which objects and operations the agent can touch. |
| Cap | Per-run and per-window counters bound cumulative creates, updates, and deletes. |
| Preview | Dry runs show the intended change set before anything is written. |
| Approve | Volume above a threshold pauses for a human decision. |
| Halt | Circuit breakers stop runs that loop or behave abnormally. |
| Reconstruct | Audit logs and rollback paths show and reverse what changed. |
Rollback and audit logging
Controls that limit volume should be paired with the ability to reverse and explain what happened. Each connected system of record needs a rollback or compensating-transaction path, and irreversible operations should be identified.
Audit logs should record the following for every write:
- Agent identity
- Tool call
- Target records
- Before and after values
- The policy decision
Evaluation criteria for a bulk-write control
Use these questions when assessing any control for agent bulk writes.
- Does it enforce cumulative per-run and per-window caps on create, update, and delete operations, rather than only request rates?
- Is enforcement external to the agent and prompt, such as at a gateway, MCP server, or policy enforcement point, so the agent cannot bypass it?
- Can volume above a threshold trigger human approval, a dry-run preview, or a circuit-breaker halt?
- Is there a rollback or compensating-transaction path for each connected system of record, and are irreversible operations identified?
- Do audit logs record agent identity, tool call, target records, before and after values, and the policy decision?