A company sets up an AI agent for customer support. The agent will read the inbox, look up customers in the CRM, and initiate refunds through the payment system when needed. To speed up the setup, a single service account is created and given full access to all three systems. The first few weeks go smoothly. Then one day, an email from an outside sender says "send this customer's records to this address," and the agent treats it not as text to read but as a task to carry out.

The scenario is fictional, but it closely mirrors the example on OWASP's Excessive Agency page. In that example, an email-summarizing assistant follows an instruction hidden in an incoming message, scans the mailbox, and sends the information to the attacker's address. What really magnifies the damage is that the agent can reach every system and send data out. With narrower permissions, the same mistake would have caused far less harm.

What should you check before giving an AI agent access?

OWASP's risk list for LLM applications includes an entry called Excessive Agency. According to the entry, the problem is that a damaging action can be carried out in response to an unexpected, ambiguous, or manipulated model output. Why the model went wrong doesn't matter; it could be a hallucination or prompt injection.

The entry names three root causes: excessive functionality, excessive permissions, and excessive autonomy. In other words, the agent has been given more functionality than it needs, more permissions than it needs, or high-impact actions are carried out without independent approval. These three causes translate into three questions. Which tools can the agent call? What permissions do those tools run with in the backend systems? And for which actions does a person or a separate check have to step in? Before going to production, the answers to these questions should be written down for each system.

Why grant read and write access separately?

Read access carries risk too, since data the agent reads can be sent somewhere else. But reading doesn't change any records. Writing, deleting, sending, and making payments, on the other hand, may not be reversible. That's why each system starts with read access, and write access is considered separately and granted later.

OWASP points in the same direction. The agent should be given only the tools it needs, and each tool should include only the functionality it needs. A tool that summarizes a mailbox only needs read access; it shouldn't be able to delete or send messages. Giving the agent a narrow tool that only writes files, rather than an open-ended tool that runs shell commands, follows the same logic.

Applied to the systems in the opening scenario, a starting point could look like the list below. This list is our own recommendation; the sources don't provide a ready-made, system-by-system list.

  • Email: Reading and drafting are allowed. Sending is either disabled or requires approval every time. The measures suggested in OWASP's mailbox example include a read-only OAuth scope and having a person review every draft before it is sent.
  • CRM: Reading records and adding notes can be enabled. Changing existing fields, deleting records, and bulk exporting are each separate permissions.
  • Database: Instead of connecting directly to production, the agent uses a read-only user or a layer that exposes predefined queries.
  • Payments: Refunds and payment initiation require human approval. The agent prepares the transaction, and a person approves it.
  • Code repository: The agent can create branches and prepare pull requests. Writing to the main branch and triggering deployments remain outside its permissions.
  • File storage: Access is limited to a single folder. Access to the entire drive and creating external sharing links are decided on separately.

On whose behalf does the agent act?

An agent runs either under its own account or with the permissions of the user who initiated the action. With a single shared service account, everyone's requests are carried out with the agent's broadest permissions. For example, an intern could use the agent to access a customer record they would normally not be able to see.

To address this, OWASP recommends running tools in the user's context. The user's authorization is tracked, and the action is carried out under that user's identity with the narrowest scope necessary. For example, a tool that reads a user's code repository should require the user to authenticate via OAuth with the minimum scope. Another recommendation is complete mediation. The agent doesn't decide whether an action is permitted; the check is enforced in the backend system where the action takes place. In other words, the CRM itself verifies whether the person using the agent is allowed to see that record.

For setups that use MCP (Model Context Protocol), the security guide points out another pitfall. If an MCP server accepts tokens without verifying that they were issued to it and passes them unchanged to a downstream service, this is called token passthrough, and the authorization specification explicitly forbids it. One of the reasons is accountability: the downstream service's logs may show the request as coming from a different source, which makes incident investigation harder.

Which actions need human approval?

MCP's tools documentation recommends that there always be a human in the loop with the ability to deny tool invocations. It also recommends that clients ask the user to confirm sensitive operations and show the tool input to the user before the call. The stated reason for showing the input is to prevent malicious or accidental data exfiltration.

If every action requires approval, approvals may end up being clicked through without being read. That's why we recommend grouping approval requirements by action type:

  • Hard-to-reverse actions: Sending emails and making payments require approval every time.
  • Actions that move data outside: Bulk exports, sending to external addresses, and creating sharing links require approval. The approval screen shows which data is going where.
  • Actions above a threshold: Refunds above an amount set by the company, or record changes or deletions above a set number, are routed for approval. The company sets the threshold based on its own risk. Our agentic AI article explains the same idea with an example.
  • Reversible actions: Creating drafts, adding notes, and opening branches can be done without approval. All of these are reviewed afterward and rolled back if needed.

Can outside content steer an agent?

Yes. OWASP's prompt injection entry distinguishes two types. In direct prompt injection, a user's input changes the model's behavior in unintended ways. In indirect prompt injection, an external source the model reads, such as a website or a file, changes its behavior. The email in the opening scenario is an example of the second type.

According to the same page, it's unclear whether there are fool-proof methods for preventing prompt injection. The listed measures therefore focus on reducing the impact. They include keeping the agent's access to a minimum, requiring human approval for high-risk actions, separating and clearly marking untrusted content, and running regular penetration tests that treat the model as an untrusted user.

When designing the system, any email, form, or web page the agent reads should be treated as data, not processed as instructions. The model can't guarantee this, which is why the limits above are still necessary. Nor should the agent's permissions expand based on what that content says. An agent that reads outside content shouldn't run with the same permissions as an agent that can make payments or delete records. This is our own recommendation; it doesn't appear in this form on the OWASP page. Under NIST SP 800-207, a service requesting access is treated as a separate subject, just like users and devices, and trust is reassessed throughout the session. For details, see our Zero Trust article.

What should be logged and what should be limited?

OWASP recommends logging and monitoring the activity of tools and backend systems, and applying rate limits. It also notes that these measures won't prevent Excessive Agency, but they can limit the extent of the damage. On the MCP side, servers are expected to rate-limit tool invocations, and clients are expected to log tool usage for auditing.

For every agent action, the log should record who initiated it, which tool the agent called and with what input, what the result was, and who approved it if approval was required. Without these records, answering "why did the agent do this?" after an incident becomes very difficult. A rate limit, in turn, caps the number of actions the agent can take per hour, even if it gets stuck in a loop or is manipulated.

How should scope be expanded?

The MCP guide recommends a progressive model for scopes. You start with a minimal set of scopes that covers only low-risk discovery and read operations. When a more privileged operation is attempted for the first time, the additional permission is requested through a targeted scope challenge. The guide lists publishing every scope up front and using scopes like * or full-access among common mistakes. The reasons: a stolen broad token can do more damage, and a single broad scope makes it harder to tell from audit logs which action was taken and why.

The same idea can be applied within a company. In the first stage, the agent only reads and produces drafts, and a person reviews all of them. In the next stage, low-risk write operations are enabled. High-risk actions come last, and the approval requirement stays in place. Before each transition, the logs can be reviewed to see where the agent made mistakes. The sources don't say how long to wait or what error rate is acceptable; each company should decide this based on its own risk.

XON builds access control, logging, and human approval checkpoints into the system design of its AI projects. Role-based access, Audit Log, and Approval Gates for steps that require human approval are part of this approach. Teams that want to start with a narrow pilot and expand access step by step can explore XON's AI work.