Say an internal agent is asked to tidy up a test project. It does exactly that. It also deletes the shared fixtures directory three other projects import, because the directory sits inside its working path and nothing says it is off limits.
There is no jailbreak, no injection and no bug, just a correctly executed action with a blast radius nobody had measured.
Narrow the tool before you narrow the prompt
Excessive agency is usually an interface problem. A generic run_sql or write_file tool inherits every capability of the system underneath it, and then a paragraph of prompt is asked to hold the line. That paragraph is guidance that happens to work most of the time.
Workflow-shaped tools beat general ones. Ship refund_order(order_id, amount) with a server-side cap rather than execute_transaction. The narrow signature is easier to log, easier to rate limit, and easier to argue about at review time, because its worst case can be written down in a sentence. The price is more tools to build, version and describe well enough that the model picks the right one.
For anything with real consequences, split the action in two. The agent produces a diff, a preview, a staged record. A separate call commits it. Staging turns an irreversible operation into a reviewable artefact, and it makes the approval question concrete: a human sees what will change rather than a description of intent. Make the commit check that the target has not changed since the preview, with a version number or an ETag, or the reviewer approves one diff and the system applies another.
Attach approval to properties of the request, evaluated in code. Amount over a threshold, records touched above a count, an external recipient, a first-time destination. Never attach it to the model's own assessment of how important the action is.
Containment gets built before you need it
Sandbox the execution environment as if the agent were untrusted code, because functionally it is. Explicit workspace root, no ambient credentials in the environment, an egress allowlist, and bounds on CPU and wall clock. That fixtures directory would have survived a workspace root one level tighter.
Rate limit per user, per workflow and per tool over a rolling window, then alert on the shape of the traffic rather than the totals. Repeated near-identical calls, a sudden widening of argument ranges, or a burst against a rarely used tool are the signals that arrive before the damage.
Two things stay ready. One is a kill switch per tool that operations can flip without a deployment, and that gets exercised on a schedule so nobody discovers it is broken during an incident. The other is a documented compensating action for every write path. Where an action genuinely cannot be undone, that is precisely the action that requires a human signature.
List the actions your agent can take today without a person seeing them first, and rank them by damage and by time to undo. Put the top one behind staging and approval before you add another tool.
Terms in this piece
About this explainer
- Format
- Explainer
- Level
- Practitioner
- Read
- 2 min read
- Published
- Aug 27, 2026
- Disciplines
Short mental models: one idea, why it matters, what to do about it.
More on these topics
Article · · 4 min read
Your AI feature, seen from the security reviewer's chair
A reviewer has an hour and a diagram. The five questions they ask about an assistant or agent, what they are really checking with each, and the answers that stall a review.
Decision note · · 1 min read
Sensitive data is cleaned at ingestion, with Presidio, before anything is indexed
Why our ingestion pipelines run Presidio over sensitive documents before chunking and embedding, and what that choice commits a team to: tuned detection, masking that is final for the index, and one more step for every document.
Checklist · · 18 checks
When to bring in a compliance review
The changes that should pull legal, privacy or compliance into an AI project early, and what to have ready when you do. Not legal advice; a way to ask at the right time.
Discussion