For decades, access control has had to keep up with the requirements of evolving user personas and the security teams who support them: from employees in the office to remote workers to cloud workloads. The most recent challenge? AI agents. Organizations are connecting them to email, file shares and business applications, often before anyone has clearly defined the parameters of what a particular agent is allowed to access.
How agents get access today
Many agent pilot projects start the same way. A team wants an AI assistant that can read email, open tickets, review code or pull files from a shared drive. An API key or a service account is created for the agent so it can connect. The pilot has a deadline and narrowing permissions takes time, so in many cases the account ends up with more access than the agent actually needs to perform its task. And in the rush to move a pilot into production deployment, permissions become a second thought.
How prompt injection works
Agents take direction from the text they read, a weakness that prompt injection exploits. An attacker plants instructions inside something the agent will process, like an email, a web page or a document. Today's AI models can't reliably distinguish the content they're working on from the commands they're meant to follow, so the agent may treat the planted text as an instruction and act on it.
In August, the security firm PromptArmor demonstrated this attack against Atlassian's Rovo AI assistant. The researchers hid instructions in a document using tiny white text on a white background. Later, when a user asked Rovo to help with a routine task, Rovo read the hidden text, collected Jira and Confluence data and sent it to a server the researchers controlled. Rovo inherits all of its user's permissions, which gave it access to that data.
Using Zero Trust to control agents
Applying least-privilege access control, a key pillar of zero trust, is the most reliable way to limit damage caused by excessive permissions. The same Zero Trust controls that have been put in place for employees and workloads can also be applied to agents. However, because agents act quickly and operate around the clock, stricter enforcement of access controls is essential. Here are some recommendations:
1. Provide each agent with a unique identity. If multiple agents share a single service account, shared identities make it impossible to tell which agent performed a given action.
2. Assign each agent to a specific person or team, and grant no privileges beyond what they hold.
3. Give each agent credentials that only apply to the task it's working on, and set them to expire when the task ends. An attacker who steals a long-lived API key with broad privileges can use it for months.
4. Check permissions each time the agent takes an action. An agent asked to summarize a contract, for example, might find a hidden instruction in the document telling it to email the contract to an external address. A permission check at that point would block the email.
5. Log every action an agent takes: the files it opens, the changes it makes and the messages it sends. That record is the basis for any forensic investigation after an incident.
6. Require human approval for any action that is difficult to reverse, such as sending email outside the company, transferring funds or changing access rights.
In a previous role, much of my Kubernetes security positioning centered on the ephemeral nature of pods. Pods are being constantly created and destroyed, and each new pod is assigned a new IP address. An address that belonged to one pod can later be assigned to a different one. Firewall rules tied to IP addresses quickly go out of date, so policies have to be based on each workload's identity, such as its labels or service account. Agents call for the same approach.
Before the next agent goes live...
Before your next agent goes into production, ask these three questions:
- Who is this agent working for, and can it access anything that its "employer" can't?
- What systems and data can it access now?
- If an attacker hijacked it through prompt injection, how much damage could they do with that access?
If you can't answer all three with confidence, close those security gaps before you deploy more agents.
How is your security team handling identity and access for AI agents? I'd love to hear what's working.