All insights
Thought Leadership

How to stop AI agents reaching data they should not

Over-privileged agents are an authority problem before they are a data problem. The five ways it happens, the control that closes each, and what prompt injection changes.

By Raidiam6 min read
Agentic AIAPI Security

An AI agent reaches data it should not when the authority it carries is wider than the task it was given. Classification and egress controls catch some of the consequences. The cause sits earlier, in how the agent got its permissions, and there are five common ways that goes wrong.

This matters more with agents than with the software that came before, because an agent chooses its own calls. You cannot bound it by listing the endpoints it will touch, because nobody knows that list in advance.

The five ways over-privilege happens

Over-privilege happens in five common ways, and each one has a control that closes it.

1. Shared service accounts

Ten agents built by one team use one service account. The account was scoped for the widest of the ten, so nine of them hold permissions they never needed. No downstream system can tell them apart, and withdrawing one withdraws all ten.

The control: one identity per agent, bound to a key that agent holds. Two agents from the same team should present different identities to the same API.

2. Scope inherited from the person's full permission set

An assistant acts for a relationship manager, so it is given the relationship manager's permissions. That person can see the whole credit book. The assistant was asked to prepare one review pack.

This is the most common single cause, and it is invisible in a permissions audit, because every permission is technically correct. The person really does hold them.

The control: scope the grant to the task, rather than to the person. The authorisation should name what this request covers, checked against what the agent is allowed to ask for at all, with everything outside the request staying outside the token.

3. Tokens forwarded unchanged through a chain

A task passes from an assistant to a specialist agent to a tool to an API. Each hop forwards what it was given, or obtains something new with its own scope. By the fourth system, the authority the person granted has been replaced by whatever the third system decided to ask for. Our article on agent API security follows a single request through five steps to show where this happens.

The control: narrow the scope at each hop. Scope narrows as the chain extends and never widens. OAuth 2.0 Token Exchange (RFC 8693) defines how a token can be exchanged while carrying actor information, and the act claim records who is acting. That claim is informational, so the receiving system still has to decide whether the chain is acceptable. That is a governance decision, made in policy.

4. Long-lived credentials

A credential issued once and valid for months survives the task, the project and sometimes the team that created it.

The control: credential lifetimes measured in minutes. A token that expires in five minutes limits exposure more reliably than a quarterly access review, because it does not depend on anyone remembering to act.

5. No transaction boundary

A customer approves an agent looking at last month's spending. The approval becomes an account connection that persists, covering everything the agent might later ask for.

The control: bind the authorisation to the transaction. Approval to prepare one credit review pack does not become standing access to the credit book. Approval to read last month's transactions does not become payment initiation.

What the limits look like in practice

Three limits sit between an agent and the data: registered, attested and granted.

Registered is what the authority governing the agent has said it may ask for. The agent cannot write this itself. It is published in a statement signed by the agent's authority, which is why a receiving platform reads that statement instead of taking the agent's word.

Attested is what a particular running copy is approved for, where an attester vouches for copies. Where there is no attester, attested equals registered.

Granted is what this one request named, checked against both. Everything outside the request stays outside the token.

The effect is that an agent asking for something outside its limits gets no token at all, and the request never reaches the data. These limits map onto the five control domains a bank's approvers look for.

For a lighter way to see the limits at work, try our interactive walkthrough. Click through a galaxy of bank systems and watch an action the agent was never approved for get blocked before it touches anything.

What prompt injection changes

Prompt injection changes what an agent decides to try. What the agent is permitted to ask for stays the same.

That distinction is worth being precise about. An agent persuaded by hostile content in a document to send customer records elsewhere will attempt it. If the attempt falls outside its limits, no token is issued and the attempt fails at the authorisation layer. The injection succeeded. The access did not.

This is containment rather than prevention, and saying so is the honest position. Recent research points the same way. AgenTRIM enforces least-privilege tool access at each step of an agent's work, filtering every tool call. A 2026 paper reporting penetration tests of two agent products describes execution-capable agents as effectively unbounded programs with a very broad attack surface. Both are arguments for limits enforced at every call. The OWASP Top 10 for LLM Applications lists excessive agency among the main risks for the same reason.

Where data loss prevention fits

Data loss prevention fits downstream of the authority question. Classification, egress allowlisting and monitoring are real controls and worth running, and they catch different failures.

The order that works is to bound what the agent can ask for first, so most of the surface never opens, and then classify and monitor what remains, so you see the rest. Running the second without the first means inspecting a very large amount of traffic that should never have been authorised.

Open finance APIs and over-privileged agents

Open finance APIs give institutions an advantage and a specific risk when agents arrive.

The advantage is that the hard parts already exist: APIs with a security profile, certificate-based trust, consent mechanics and an audit trail. FAPI 2.0 defines the financial-grade profile these run on.

The risk is that consent built for a person clicking through a flow is a poor fit for an agent working across a long task. A consent that grants account information access for ninety days is reasonable for an app a customer opens weekly. For an agent making hundreds of calls on its own, it is a standing grant with no task boundary.

The adjustment is small for a bank already in an ecosystem. The authorisation server resolves OpenID Federation statements, accepts the connector's attestation and issues sender-constrained tokens. Our guide to AI agent identity and access management explains each of those parts.

What to check in your own estate

Five questions show where to start, and any "no" is the place to begin.

  • Can you list every agent with access to customer data, with a named owner for each?
  • Does each agent hold its own credential, or is there a shared service account anywhere in the path?
  • At the fourth hop of a multi-agent task, can the final API establish who started it?
  • Is your credential lifetime measured in minutes?
  • If you withdraw an agent's authority now, do you know how long until every consuming platform stops accepting it?

To work through the full set with your teams, get the free AI agent access readiness assessment. It shows which access controls you already have, which are missing and what to fix first.

Frequently asked questions

How do you prevent AI agents from exposing sensitive customer data?

Bound what the agent is permitted to ask for before it asks, using per-agent identity, task-scoped grants, narrowing at each hop and short credential lifetimes. Classification and egress controls then cover what remains.

Why do AI agents end up over-privileged?

Most often because the agent inherits the full permission set of the person it acts for, or because several agents share one service account scoped for the widest of them.

Can AI agents access data without authorisation?

They should not be able to. An agent asking for something outside its limits gets no token, so the request never reaches the data.

Does least privilege work for AI agents?

The principle holds and the implementation changes. Least privilege usually means listing permitted actions in advance. An agent chooses its own calls, so the bound has to be a policy applied at request time.

How secure are AI agent interactions with customer data?

That depends on whether the agent's authority is bounded, whether it can be withdrawn, and whether the audit record names every party in the chain. Those three properties are what a second-line review will ask for.

Does prompt injection defeat access controls?

No. It changes what the agent tries. An attempt outside the agent's permitted limits gets no token.

How do you protect open finance APIs from over-privileged agent access?

Treat the agent as a participant that has to be resolved and bounded, instead of another client of an existing consent. The APIs and security profile are already there. What changes is the authorisation server resolving federation statements and issuing sender-constrained tokens.

Check if your AI agents are ready for production

See which access controls you already have, which are missing, and what to fix first.

Get the free assessment