Menu
Back to Blog
AI SecurityCode Audit

AI Agent Access Control: How a Display Name Gave a Stranger Owner Access to an AI Agent

Author: Aleksandr Tynianov

Access control for an AI agent answers two questions: who is the agent acting for, and what is it allowed to do. Get either one wrong, and it no longer matters how good the model is.

This post explains what AI agent access control is, why it sits at the center of agentic AI security and where agents usually get it wrong, then walks through two real bugs from our security review of Rome, an open-source, self-hosted AI agent. In the first, a stranger who set their WhatsApp name or email display name to the owner's name was treated as the owner, with a shell and every connected account. In the second, an action that runs root scripts on the host sat in agents described as read-only. Rome fixed both and agreed that we could name them and link the repo.

What is AI agent access control?

AI agent access control has two halves.

Identity. The agent has to know who it is talking to and on whose behalf it acts. In a regular web app this comes from a login and a session. An agent often has no login step at all: messages arrive from email, WhatsApp, Slack or a chat widget, and the agent has to decide how much to trust each sender.

Permissions. Each agent holds a set of tools and actions: send email, read files, call an API, run a command. Access control decides which agent holds which tools, under which conditions, and which actions need a human to approve them first.

Both halves are well known in classic software. Agents add new ways to get them wrong. Systems often run several agents with different jobs, tools are granted in config files rather than in code paths a reviewer reads, and a model, not a hard-coded rule, decides when to call a tool.

OWASP now tracks this as a separate risk class. Its Top 10 for Agentic Applications, published in December 2025, lists Identity and Privilege Abuse as ASI03. Its Top 10 for LLM applications lists Excessive Agency as LLM06:2025, with three causes: excessive functionality, excessive permissions and excessive autonomy.

Why access control is the core of agentic AI security

When an access check fails in a web app, someone usually sees a record they should not see. When it fails in an agent, someone gets a worker that acts for them: it sends messages as the owner, changes code, moves money or runs commands, depending on which tools it holds.

The agent's decisions also come from a model that can be persuaded. That is why AI agent security depends on access control more than on anything else. The model decides what to try. Access control decides what can actually happen, and that layer has to hold no matter what the model was told.

Where AI agents get access control wrong

AI agent access control bugs usually fall into a few patterns:

  • Identity is taken from a label the sender controls, such as a display name, an email From header, a username or an HTTP header.
  • Trust is applied first and approval comes later, so the approval can only undo what already happened.
  • Permissions are granted by wildcard, so every new action, including a dangerous one, goes to every agent on that list.
  • An agent that reads untrusted text holds the same tools as the agent that serves the owner.
  • The project's docs describe the right control, but the code never applies it on the path that matters.

The Rome review below hit all five.

A real case: AI agent access control bugs in Rome

Rome is an open-source, self-hosted agent system. It connects to messaging channels such as WhatsApp, email, Telegram and Discord, and runs a main agent for its owner, whom Rome calls the "guardian". Every sender gets a trust level, which Rome calls a "bond level". If the owner turns it on, Rome can also run scripts on the host VM.

Finding 1: AI agent identity from a display name

We filed this as issue #624, from a review of commit de2d152. It applied to the default configuration. The path:

  1. Telegram, Discord and Feishu require pairing. Other channels, such as WhatsApp and email, deliver every sender to the inbox.
  2. A message arrives from an account Rome has never seen.
  3. Rome looks for an existing person whose display name matches the sender's display name, ignoring case. The owner was not excluded from that lookup.
  4. On a match, Rome linked the sender's account to that person immediately. An approval request was created, but only after the link was written, so it could undo the link, not prevent it.
  5. The sender now has the owner's bond level, and the message goes to the main agent on the trusted path.

The sender controls the field that decides all of this. On WhatsApp it is the push name. On email it is the display name in the From header.

AI agent access control bug: a stranger's display name matched the owner's name, and the account was linked to the owner before any approval

The main agent has a shell in the container and reaches every connected account through actions: mail, GitHub, Slack, Stripe. Replies go back to the sender, and the link is stored, so every later message from that account is trusted too. If the owner has enabled host execution, this reaches root on the host VM.

The stronger check already existed next to this code. Rome's email channel puts unauthenticated senders in a separate namespace, and the comment in packages/core/src/channels/email.ts states the rule: "a spoofed From can never resolve to a mapped person (guardian, inner-circle, or acquaintance) and reach the trusted path." The inbox lookup used the display name, not that namespaced ID, so the rule did not hold. It did not even need spoofing. Mail from a domain that passes SPF and DKIM, with the owner's name as the display name, worked too.

There was a second guard nearby. A function that links an account to the owner existed, with checks, but it ran only during pairing and credential setup. The automatic link did not go through it.

Rome fixed this in PR #623, merged the same day the issue was filed. The display-name lookup and automatic linking are gone. An unknown sender now resolves to no person and the lowest bond level, other. A regression test covers the case where a sender uses the owner's name.

Rome also noted that the upgrade does not revoke links created before the fix. If you run Rome and had it connected to a non-pairing channel, review the accounts that were linked automatically.

Finding 2: AI agent permissions, a root action in read-only agents

We filed this as issue #679, from a review of commit 9837b71, re-checked on the current main branch before filing.

This one is off by default. It only applies when the owner enables host execution (ROME_HOST_EXECUTION_ENABLED=true) and installs the host helper.

Rome has an action that runs an unrestricted root shell script on the host VM. Agents get actions through an allow-list, and several agents use the wildcard "*". The wildcard gives an agent every action, unless the action is marked visibility: explicit.

The root action was not marked explicit. Rome's docs, in docs/concepts/actions.md, say that "visibility gates both agent discovery and agent execution", so this is the documented control for this case. No action in the repo used it outside tests.

As a result, three agents described as read-only or validation agents held the root action:

  • sentinel, which triages messages from untrusted senders;
  • envoy, which validates outgoing actions;
  • explore, described as read-only exploration.

None of them has a shell, so the action list was their only path to the host. The sentinel reads the untrusted sender's text in its prompt, so a crafted message could try to make it call the root action.

In OWASP's terms this is excessive functionality: agents held a tool their job never needed.

We did not report this for the main agent. The main agent has a shell, and Rome's docs state openly that access to the host socket gives host authority to code in the container. Rome documents that as a trade-off, so we left it out. The finding is only about agents that have no shell and should never have held root.

Rome fixed this in PR #740, merged on October 10, 2026. Both host root actions are now visibility: explicit and granted to the main agent by exact name, so the wildcard no longer gives them to anyone. The sentinel now holds no actions at all and only returns a decision. A regression test checks that the main agent is the only holder.

Rome's fix went further than our report. The PR lists more wildcard holders of the root actions than we did. During review, Rome also found and closed a second route, where an agent could schedule the root action through a routine instead of calling it directly. That is the right way to take a report: they fixed the class of problem.

Least privilege for AI agents: a root action granted through a wildcard reached read-only agents before the fix, and only the main agent after it

What we did not prove

  • We did not run Rome or send anything to any instance. This was a static review.
  • We did not measure how reliably a crafted message makes the sentinel call the root action. The defect does not depend on that: a root action should not be in that agent's list at all.
  • We traced finding 1 end to end for WhatsApp and email. WeChat and telegram-user are also non-pairing channels, but we did not trace where their display names come from.
  • If two people share the owner's display name, the code did not make clear which one would match first.

The pattern

In both findings, trust was decided by a label instead of an authenticated identity plus a scoped permission. In the first, the label was a display name. In the second, it was a wildcard.

In both, a stronger control already existed in the codebase: the email namespace, the guarded pairing function, visibility: explicit. It just was not on the path that mattered. We saw the same shape in our Open Session review, where trust was checked on who started a run, not on the text fed into it.

How to get AI agent access control right

  • Never let a sender-controlled field grant a trust level. A display name, a signature or a subject line is whatever the sender wants it to be.
  • Tie identity to something the sender cannot set: a pairing step, a verified account link or an authenticated channel ID.
  • Require approval before trust is applied. An approval created after the link or the action already happened can only clean up.
  • Make dangerous actions opt-in by exact name. Then a wildcard allow-list can never grant them by accident.
  • Apply least privilege per agent. Agents that read untrusted text should get the smallest tool set, because they are the most exposed agents in the system.
  • Check that the controls your docs describe are used on the paths that matter. Rome's docs named visibility as the control, and no action in the repo used it.
  • When you fix an access control bug, clean up the state it already created. Rome's fix stopped new links, but links made before the upgrade stayed until an operator removed them.

How to review access control in your AI agent

You do not need to run attacks against a live agent to find these bugs. Most of them are visible in the code and config:

  1. Find every place where the system decides who a sender is. For each one, check which fields it uses and whether the sender can set them.
  2. List the tools and actions each agent holds. Resolve wildcards into the full list, because that is what the agent actually gets.
  3. Mark the dangerous actions: anything that runs code, sends data out, spends money or changes permissions. Check which agents can reach each one.
  4. For each approval step, check whether it runs before or after the effect it is meant to gate.
  5. Compare the result with what your docs and security policy promise.

How we work

In a security review or code audit, we read the docs and security notes first, review the code statically and tie each finding to files and lines. We drop anything the project documents as a deliberate trade-off, as we did with the main agent here. For finding 1, Rome's co-founder asked us to file it as a GitHub issue, so we kept the public report at the level of conditions and offered a step-by-step proof of concept privately.

Thank you to the Rome team. Both issues were labelled P0 the day they were filed, and the first fix shipped the same day with a regression test and clear upgrade notes.

FAQ

What is AI agent access control?

It is the set of rules that decides who an AI agent is acting for and what it is allowed to do: which tools and actions each agent holds, which data it can reach, and which steps need a human first. It covers identity and permissions, the same two halves as in any software system.

How is access control for AI agents different from regular apps?

In a regular app, a user logs in and the code checks each request against fixed rules. An agent often has no login: messages arrive from email or chat, several agents hold different tools, and a model decides when to use them. Labels like display names get treated as identity, and wildcard grants hand new tools to every agent automatically.

What is least privilege for AI agents?

Each agent gets only the actions its job needs, granted by exact name. An agent that triages untrusted messages needs no actions at all, which is where Rome ended up after the fix. Wildcard grants like "*" are the opposite of least privilege, because every new action, including a dangerous one, is granted automatically.

What is excessive agency in AI agents?

OWASP lists Excessive Agency as LLM06:2025: an agent can take damaging actions because it has more functionality, permissions or autonomy than its task needs. Finding 2 is a direct example: triage and read-only agents held an action that runs root scripts on the host.

How do you secure an AI agent that reads WhatsApp or email messages?

Treat every sender-controlled field as untrusted, including display names, and never let one decide a trust level. Link accounts to people only through pairing or another verified step, and ask for approval before trust is applied, not after. Keep the agent that reads raw messages away from actions that change anything.

How do you find security issues in an AI agent?

Start with inputs and grants, not with the model. List every input a sender controls and trace where each one affects identity or tool access, then list which actions each agent can reach, including through wildcards. An AI agent security review of this kind is static: we read the code and docs and tie every finding to files and lines. In this review, both findings came from that trace, not from testing prompts.

Is this prompt injection?

Finding 1 is not. No model was tricked: the identity mapping itself granted trust. Finding 2 would rely on injecting the sentinel, but the defect is structural. The action should not have been in its list.

We review AI agent access control, permissions and other security risks by hand, with every finding tied to specific files. Tell us about your product.