After nineteen years in identity work, I've developed a fairly reliable sense of which account in an environment will eventually cause trouble. It is rarely the one with the most privilege on paper. It's the one nobody owns: a service account created for a project that ended, holding a credential that never rotated, trusted by a script no one remembers writing.

When I started looking at how enterprises deploy AI agents, I recognized that account immediately. The identity industry has spent two decades learning lessons that AI security teams are now discovering all over again.

intelligence is not authority: the architecture of AI guardrails

An agent is a service account that takes instructions from untrusted text

Most of the safety discussion centers on the model: how well it was aligned, how it performs on benchmarks, how rarely it produces something harmful. That work matters, but it answers a different question from the one an identity architect asks first. We want to know what the thing runs as, who owns it, and what it can reach. Those three answers tell you far more about the potential impact of a compromise than the model's performance benchmarks.

The underlying problem is structural. A language model receives instructions and data through the same channel and cannot reliably distinguish a document it should analyze from a command it should obey, which is why OWASP ranks prompt injection first among its LLM application risks. 

Alignment training lowers the odds of a bad outcome, but it doesn't establish a boundary. In one widely cited study of jailbreak prompts collected from the wild, the most effective ones reached success rates near 95 percent against ChatGPT and GPT-4, and some stayed effective for months.

I find it useful to hold one distinction firmly. A model can be capable of performing an action without being authorized to perform it. Capability belongs to the model. Authority has to come from the architecture around it.

What carries over from the service account problem

Years of cleaning up non-human identities (NHIs) taught me that activity alone doesn't tell you whether an identity matters. An account that looks dormant may be required by a scheduled task, or by an integration that only runs at quarter end, and disabling it because the logs were quiet is a dependable way to cause an outage. Agents present the same problem from the other direction: low traffic says nothing about consequence either. What tells you something useful is who owns the identity, what depends on it, and what it can touch.

The risks of shared credentials carry over just as directly. Plenty of agents are deployed under a service account with a static credential and broad permissions, often inherited from whoever built the prototype. That recreates the problems enterprises spent twenty years removing from legacy service accounts: unbounded scope, no clear owner, and credentials that outlive their purpose. The volume has also grown past the point where this can be handled case by case. Palo Alto Networks' 2026 identity research puts machine identities, AI agents included, at 109 for every human identity, and Okta found that only 34 percent of organizations apply the same controls to agents that they apply to employees.

The third lesson is that authorization has to be enforced at the resource. Telling a model not to read certain data is a request. Making that data unreachable is a control. A rule that exists only in a system prompt is enforced in natural language, and natural language can be argued with.

When a service desk ticket became an instruction

Let’s look at this through an illustrative scenario: An enterprise piloting an AI agent for service desk requests connected it to the directory through a service account. The agent could unlock accounts, reset passwords, and add users to groups that provided access to applications and file shares. To get the pilot underway, the directory team granted the account broad permissions before mapping which users and groups the service desk actually supported.

The team relied on the agent’s system prompt to enforce two important restrictions: do not modify privileged groups, and act only on requests approved by a manager.

The issue surfaced when the agent processed a routine ticket that included a block of text formatted to look like an approval. It asked the agent to add a user to a group that granted access to a finance application and to reset an executive’s password.

The ticket itself did not verify who submitted the request or whether a manager had approved it. It only contained text making those claims. Yet the agent was designed to read and act on tickets, and its service account had the permissions to carry out both actions. In effect, the ticket queue had become an instruction channel for an identity with far more access than the service desk required.

The problem extended beyond the possibility that the agent might follow misleading instructions. The service account could modify groups outside the service desk’s remit and reset passwords for users it was not meant to support. The directory would record changes under a shared identity, making it difficult to connect an action to the requester, approver, or ticket that prompted it. Key safeguards, including who could request a change, which groups were eligible, and what counted as approval, were described in the prompt instead of being enforced by the directory and workflow systems.

The revised design gave the agent a dedicated workload identity with a named owner, a defined lifecycle, and regular access reviews. For an on-premises deployment, this could be a group Managed Service Account (gMSA), with logon rights limited to the systems running the agent. Directory permissions were narrowed to the necessary operations and organizational units, with protected accounts and privileged groups excluded.

The agent no longer made directory changes directly. It submitted structured requests to a separate executor, which checked each action and target against policy. Only groups designated as eligible for service desk fulfillment were in scope. The executor retrieved approval from the workflow system, where it was recorded against an authenticated, authorized manager. Text in a ticket could not substitute for that approval. Password resets required users to complete the organization’s identity verification process, and requests involving privileged groups were rejected and referred to a person.

The team also updated its monitoring. It tracked group membership change events, including Windows Security event IDs 4728, 4732, and 4756, for the agent’s identity and reviewed them against expected activity. The executor recorded the ticket, requester, approver, target, action, and agent identity together, giving investigators a clearer account of what changed and why.

These controls could not prevent misleading instructions from appearing in tickets. They could limit the actions those instructions might trigger: requests without verified approval, or involving ineligible groups, would be rejected, and approved actions would stay within the service desk’s defined scope.

The changes took time. The directory team had to classify groups and review existing permissions, the executor needed ongoing development and maintenance, and the pilot took longer than it would have with a broadly privileged service account. In return, the organization got a boundary the prompt alone could not provide. Identity, directory, and workflow controls, not the model’s good behavior, determined what the agent was allowed to do.

Testing the controls you build

Guardrails on the model are a second layer, not the boundary. They still need testing, because a guardrail that has never been tested against the failure it exists to prevent is an assumption. One published comparison shows how steep the trade-off can be: the platform that blocked 92 percent of malicious prompts also blocked 13 percent of legitimate ones, while the platform with almost no false positives missed nearly half of the attacks. Measure both directions against your own traffic, and measure again after every model update, because results don't reliably survive a version change.

The test corpus also has to cover the channels the system actually reads. Indirect injection through documents, tickets, and tool output is a leading attack path, so a corpus that exercises only the chat box is testing the wrong door. Anything that turns up in production belongs in the corpus permanently, and the model under test should never be the one scoring its own safety.

The question I'd ask first

For any agent, I'd ask what I'd ask about any service account: if this identity were fully compromised tomorrow, what would an attacker get? If the honest answer depends on how well the model behaves, there isn't an answer yet. If the answer is a bounded set of resources, decided in advance, with every action attributable afterward, an organization can adopt more capable models without taking on proportionally more risk.

The tooling to support this is arriving. Okta has Agent SSO, Microsoft has Entra Agent ID, and Anthropic has made Workload Identity Federation generally available so that short-lived tokens can replace static keys. But these capabilities only matter if organizations actually integrate agents into their identity architecture. My view is that identity teams should claim this work now, before agents become one more population of unowned service accounts that someone has to clean up in five years. The model supplies the intelligence. What it is allowed to do with that intelligence is an architectural decision, and it belongs to the people who already know how these accounts fail.

About the Author

Sameer Bhanushali is an enterprise identity and security architect with 19 years of experience designing identity, access management, and security architecture for large, complex organizations. His work spans multi-forest Active Directory environments, cloud identity platforms, privileged access, and the identity challenges introduced by mergers, acquisitions, and now AI systems.

His current focus is applying enterprise identity and security discipline to AI agents, from agent authorization and least privilege to the runtime controls that keep capable models inside defined boundaries. He writes about identity, security architecture, and AI governance at TechSecure Insights, and his work has appeared in industry publications including Dark Reading.

‍

Share post: