Service Account Identities Outlive the Task

Noam Dekel 6 min read

Human access ends at logout. An agent running under a service account never logs out. The account keeps existing, its credential does not lapse with a session, and its permissions have no relationship to what any individual is currently cleared to do. That structural gap is where a great deal of agent identity trouble starts.

Few organizations yet treat an agent's service account differently from the ones behind traditional automation. The difference is worth drawing out: an agent can act in ways a deterministic script will not, and whatever its credentials reach is the ceiling on what a misdirected or compromised agent can do.

Three Ways Agents Get an Identity

Two patterns dominate, and a third keeps appearing.

Purpose-built is the good one. Someone creates an account for the agent alone, attaches the minimum its task requires, and records it in the deployment config. It is also the rarer path.

Reuse is the common one. An account already powering another automation or a CI/CD job gets borrowed because it happens to have what the agent needs. What it also has is a history: permissions accumulated for other purposes and never assessed against an AI workload's behavior.

Then there is the developer credential. An early agent runs on someone's personal OAuth token because that was quick during development, and production arrives before a proper account exists. The token carries that person's access, which is generally wider than any service account would be granted. If they leave or rotate it, the agent breaks. Worse, it may keep running on a stale credential nobody remembered to revoke.

Setup Already Sets the Ceiling Too High

Even a purpose-built account starts generous. The scope attached at creation tends to cover everything the agent might eventually do, because the people provisioning it are imagining the roadmap rather than today's task.

So excess privilege exists before the first production call. Every later capability adds more. Most of the set may never be exercised, yet all of it is available to whatever action the agent takes or whatever input bends its behavior.

Compare a human employee. Access is granted for a reason, reviewed on a cadence, and removed when the reason goes away. An agent's account often has no review cadence and no revocation trigger. It simply persists, gaining scopes as the agent evolves, until some event forces someone to look.

When Delegation Fits

Some frameworks offer user-delegated identity: the agent acts with the permissions of the person who invoked it, rather than a standing credential. Effective permissions cannot exceed what that user may do, and they end with the session. That is a useful constraint.

The catch is the session itself. Scheduled agents, event-driven agents, and anything that keeps working after the user has gone cannot depend on delegated identity for their whole run. Headless and long-running patterns need a persistent credential; delegation is simply unavailable to them.

Where delegation is possible, it is worth doing. It ties the agent to the human access model instead of building a parallel account hierarchy. It does not remove scope questions entirely, since a broadly authorized user delegates broad authority, but it keeps the agent inside an existing control system rather than outside it.

The Review Question

For an agent's service account, start with what it holds, then ask which of those permissions it has actually used in the last 30, 60 or 90 days. Most cloud IAM systems can answer through access advisor or an equivalent that records last-use dates.

For a permission untouched for 90 days and absent from the agent's design, downscoping is low risk and clear gain. The agent has shown it does not need it for current work. Removing it shrinks the blast radius if the agent is compromised or goes off script.

The same pass reveals growth nobody tracked. An account able to create new IAM roles is a far more dangerous agent credential than one limited to data access, and that power may have arrived during a debugging session and stayed.

Naming, and Why It Pays

A prefix costs nothing and returns a lot. Accounts named agent- or ai-agent- stand out in IAM listings and cloud audit logs as agent credentials rather than human or traditional automation accounts.

With that discipline, periodic scope audits can run against a known set instead of a manual hunt. It also gives incident response context: an alert on unusual activity from agent-customer-support-v2 reads immediately as agent behavior, not a human login. That framing changes how the alert gets triaged.

No naming convention is required for good security, but without one every other control costs more, because the first step is always rediscovering the full list of agent credentials.

Back to Security Brief