Give the agent one job, and only the keys it needs

Prompt injection has no complete fix yet, so the safest agent is a narrow one. Here is what a well-scoped agent looks like, and how we decide which tools, data and actions it may touch.

By Nabil Ahmed7 minute read

The International Space Station's Canadarm2 robotic arm with the Dextre manipulator attached, against a solar array and black space
Canadarm2 with Dextre attached, photographed from the International Space Station during Expedition 66, November 17, 2021. Photo: NASA, via Wikimedia Commons.

The pitch for a general-purpose agent is easy to like: one assistant that reads the inbox, updates the CRM, issues the refund and emails the customer. In a demo, it works. In production, it's the version security reviewers stall and steering committees quietly stop funding.

Gartner expects over 40% of agentic AI projects to be canceled by the end of 2027, and it names inadequate risk controls among the reasons, next to escalating costs and unclear business value. The same release has a line we find more useful than the headline number: "Many use cases positioned as agentic today don't require agentic implementations."

Our view is simple. An agent should have one job, and only the access that job needs. Here is why, using the security guidance that now exists, and how we decide what an agent may touch.

The problem broad agents can't get around

Every agent that reads text it didn't write is open to prompt injection. The OWASP Top 10 for LLM Applications puts it first on the 2025 list. OWASP separates direct injection, where a user types something that changes the model's behavior, from indirect injection, where the instructions arrive inside content the model is asked to process, such as a web page, a file or an email. Its guidance is frank: given how these models work, "it is unclear if there are fool-proof methods of prevention for prompt injection."

Meta's security team says the same thing more directly. In describing its Agents Rule of Two, it calls prompt injection "a fundamental, unsolved weakness in all LLMs."

Simon Willison, who coined the term prompt injection, has described the combination that turns this weakness into data loss. He calls it the lethal trifecta: an agent with access to private data, exposure to untrusted content, and the ability to communicate externally. If an agent has all three, he writes, an attacker can easily trick it into accessing private data and sending it to the attacker. He lists exploits of this kind reported against products from Microsoft, GitHub, GitLab, Google and others.

Meta's Rule of Two turns this into a design rule. Until injection can be reliably detected and refused, an agent should have no more than two of these three properties in a session: it processes untrustworthy inputs, it has access to sensitive systems or private data, or it can change state or communicate externally. If a task really needs all three, Meta says the agent "should not be permitted to operate autonomously" and needs at least human-in-the-loop approval or another reliable means of validation.

The general-purpose assistant reads inbound email (untrusted), sees customer records (private), and can send mail and issue refunds (state changes and external communication). It has all three properties by design. You can add filters and stronger prompts, but Willison's point stands: vendors selling guardrails claim to catch something like 95% of attacks, and "in web application security 95% is very much a failing grade."

Where excessive agency comes from

OWASP's sixth entry, Excessive Agency, describes what happens when an agent is manipulated or simply wrong while holding more power than it needs. It traces the root cause to three things, and they're a useful checklist:

  • Excessive functionality. The agent has tools it doesn't need. OWASP's examples are ordinary: an extension chosen to read documents that can also modify and delete them, or a plugin tried during development and never removed.
  • Excessive permissions. The tools connect with more rights than the job needs. A read-only lookup that connects with an identity that also has UPDATE, INSERT and DELETE rights. A per-user feature that runs on a privileged service account that can see everyone's files.
  • Excessive autonomy. High-impact actions happen without anyone checking them, such as deleting documents without asking the user.

None of these is a model problem. They're scoping decisions, and they're much cheaper to get right before the first deployment than after the first incident.

Control console and T-shaped hand controller of the Apollo Lunar Roving Vehicle, with wire guards over the drive switches
Display, control console and hand controller of Lunar Roving Vehicle No. 2, June 1971. One vehicle, one job, and wire guards over the switches that matter. Photo: NASA Marshall Space Flight Center (MSFC-7021041), via Wikimedia Commons.

What a well-scoped agent looks like

Take an agent that triages inbound support cases in a CRM. A well-scoped version looks like this:

  • A one-sentence job. "Read new cases in the support queue, look up the account and its open orders, and set the queue, priority and a draft first reply for an agent to review." If the sentence needs the word "and" more than twice, it's probably two agents.
  • A short, named tool list. get_case, lookup_account, list_open_orders, set_triage_fields, save_draft_reply. Not a generic CRM connector, not "run any query", not "send email". OWASP recommends exactly this: avoid open-ended tools like shell commands or URL fetchers.
  • Its own identity, with matching rights. A dedicated integration user whose profile can read cases, accounts and orders, and edit only the three triage fields and the draft. The limits live in the CRM's permissions, not in the prompt.
  • No path out. The case text is untrusted and the account data is private, so the agent gets no way to communicate externally. It can't send email, call arbitrary URLs or post to chat. That keeps it at two of Meta's three properties. A person sends the reply.
  • A stop switch someone owns. A named person who can turn it off, and a documented fallback, such as the case queue going back to manual triage.

This agent is less impressive in a demo. It's also something a security team can approve in one meeting, because the answer to "what's the worst it can do?" fits on one line: set the wrong queue on a case.

How we decide what it may touch

When we scope an agent, we work through the same steps and write the result down for the client's security and platform owners.

  1. List every action the job requires, and nothing else. Anything that's only "nice to have" waits for a later version.
  2. Label each action. Does it read private data? Does it bring in content someone outside the company could have written? Does it change state, or reach anything outside the system? If one agent ends up with all three labels, we split the work or put a person in the middle.
  3. Enforce it below the model. Prompts describe intent, and permissions enforce it. OWASP calls this complete mediation: authorization is checked in the downstream system, not left to the model. Its prompt injection guidance adds that the application should hold its own API tokens and handle privileged functions in code, rather than handing them to the model.
  4. Act as the user where a user is involved. Use that person's access with the narrowest scope, such as read-only OAuth, not a shared admin account.
  5. Mark the consequential actions. Anything that moves money, contacts a customer, deletes data or changes access gets an approval step or doesn't get built.

Approval that means something

OWASP recommends human approval for high-impact actions in both entries, and Meta's rule requires it when an agent can't avoid all three properties. But approval only helps if the approver is actually deciding. NIST's Generative AI Profile, a companion to its AI Risk Management Framework, lists "Human-AI Configuration" as a risk in its own right, including automation bias and over-reliance. A reviewer who sees forty prompts an hour learns to click yes.

So we keep approvals few and specific. The approver sees exactly what will change: the record, the field, the old and new values, and the source text that led there. If approvals are frequent, that's a sign the agent's job is drawn too wide, not that the approver needs a faster button.

Logs a person can read

OWASP is careful to say that logging and rate limits won't prevent excessive agency, but they limit the damage, because undesirable actions can be found and stopped. The NIST profile asks for related things: protocols so that generative AI systems "are able to be deactivated when necessary," records of when people override the system's decisions, and logging and version history that help when an incident needs to be understood.

For each run, we record:

  • the triggering event and the record it concerned
  • each tool call with its arguments and result, including calls that were refused
  • every proposed change, who approved or rejected it, and when
  • the model version, a hash of the prompt and the tool definitions in use

The test is whether someone in operations, not the engineer who built it, can open one record and explain why the agent did what it did. These same records feed the evaluation set, so an incident becomes a test case.

Questions to ask before an agent goes live

  • Can you state the agent's job in one sentence, and does the business owner agree with it?
  • Is there a tool on its list it doesn't need?
  • Which identity does it use, and what could that identity do if the agent asked for the wrong thing?
  • Does it read untrusted content, see private data and have a way to send data out, all at once?
  • Which actions need a person's approval, and what does the approver actually see?
  • Could someone outside the build team read the log for a single run and follow it?
  • Who can switch it off, and what happens to the work when they do?

If those answers are clear, the agent is probably small enough to trust. If they aren't, the fix is usually to give it less to do.


Sources

Start a conversation.

A short paragraph is enough. A principal reads every message and replies within one working day.

Or email hello@farside.works. We use what you send only to reply. Privacy