← All cybersecurity posts

AI Agent Identity Sprawl: The New Attack Surface Pentesters Keep Missing

Every enterprise security team has spent the last decade getting comfortable with human identity: SSO, MFA, conditional access, periodic access reviews. Then, almost overnight, a second population of identities showed up — one that doesn't sleep, doesn't take vacation, and multiplies itself without asking anyone's permission. AI agents.

A single autonomous coding agent might provision a GitHub token, a cloud service account, a database credential, and a handful of third-party API keys in the course of one task. Multiply that by the dozens of agents now running inside CI pipelines, customer support stacks, and internal automation platforms, and you get what we're calling agent identity sprawl: a population of non-human identities that grows faster than any identity governance program was built to handle.

This is not a theoretical risk. In pentests we've run against organizations deploying agentic workflows in 2026, agent-created credentials have consistently been among the easiest paths to lateral movement — easier, in many cases, than phishing a human.

Why agent identities are different from service accounts

Security teams often assume agent credentials can be governed the same way as traditional service accounts: rotate keys, scope permissions, log usage. In practice, three properties make agent identities structurally harder to control.

They are created dynamically, not provisioned. A human requests a service account through a ticket; an approver reviews the scope; the account gets created with documented purpose. An AI agent, by contrast, often creates its own credentials on the fly — spinning up a new API key because a tool call failed, or minting a scoped token because a workflow step demanded one. There is frequently no ticket, no approver, and no documented purpose. The credential simply exists the moment the agent decided it needed one.

They inherit intent, not just permission. A traditional service account has a fixed, auditable permission set. An agent identity inherits whatever the agent's current task implies it should be able to do, which can shift from one invocation to the next. An agent tasked with "clean up stale S3 buckets" might request delete permissions on object storage for one run and never need them again — but the IAM policy that was created to satisfy that request rarely gets revoked once the task ends.

They propagate across trust boundaries. Agents increasingly call other agents, and each handoff can carry forward a credential, a session token, or delegated authority. We've seen agent orchestration frameworks where a top-level agent's OAuth scope was silently inherited by every sub-agent it spawned, including third-party tools the sub-agents invoked without the original agent's knowledge.

What this looks like in a real engagement

During a recent assessment of a fintech client running an agentic customer-support platform, our pentest team found seventeen distinct API keys created by a single support-ticket-triage agent over a 30-day window. Twelve of those keys were still active. Four had permissions broader than the task that created them required — including one key with write access to a customer data warehouse that had been requested to answer a single read-only query and never revoked.

None of those keys appeared in the client's existing secrets inventory, because the inventory process assumed credential creation was a human-initiated, ticketed event. The agent's credential-minting activity was logged in the platform's own audit trail, but nobody was reading that trail for identity governance purposes — it was treated as application telemetry, not security-relevant data.

This is the core finding across most agentic environments we test: the logs usually exist, but nobody has mapped them to an identity lifecycle process.

A practical attack surface map for agent identities

When we scope a pentest engagement involving AI agents, we now treat agent identity as a first-class attack surface alongside network, application, and cloud configuration. The checklist looks like this:

  1. Enumerate every credential type an agent can create. API keys, OAuth tokens, short-lived cloud credentials (like AWS STS tokens), database connection strings, and webhook secrets. Agents that have tool-calling access to cloud provider APIs or secrets managers can often create these without any human in the loop.
  1. Map credential lifetime against task lifetime. Does the credential expire when the task completes, or does it persist indefinitely? In our experience, the majority of agent-created credentials in production systems have no expiration tied to the task that created them.
  1. Trace delegation chains. If Agent A calls Agent B, which calls a third-party tool, what credential is actually presented at each hop? Is it the same token re-used end to end (a privilege escalation risk if any hop is compromised), or does each hop mint its own scoped credential (operationally safer but harder to audit)?
  1. Test for credential reuse across tasks. Does the agent cache and reuse a previously minted credential for unrelated tasks? This is a common optimization agent frameworks make for performance, and it quietly turns a task-scoped credential into a de facto standing credential.
  1. Audit the audit trail. Confirm that credential creation events are actually visible to whoever owns identity governance, not buried in an application log nobody reviews. If your SIEM doesn't have a rule that fires when a new API key or service account appears, you have a blind spot regardless of how good your agent framework's internal logging is.
  1. Attempt lateral movement using only agent-created credentials. The most direct way to validate the risk is to try it. In several engagements, credentials created by a single, narrowly-scoped agent were sufficient to reach systems well outside that agent's intended blast radius, purely because the credential's actual permissions were broader than its intended use.

Remediation that actually holds up

Rotating a key after a pentest finds it is not remediation — it's a patch. The organizations that have gotten ahead of agent identity sprawl share a few structural decisions:

  • Short-lived credentials by default, with expiration tied programmatically to task completion rather than to a calendar-based rotation policy.
  • A dedicated non-human identity registry that agent frameworks are required to write to at credential-creation time, separate from — but reconciled against — the human identity provider.
  • Scoped-down default permissions for agent orchestration frameworks, so that a sub-agent cannot inherit broader authority than its specific task requires, even if the parent agent holds broader authority itself.
  • Automated anomaly detection on credential creation patterns, since a sudden spike in keys minted by one agent is a stronger early signal of compromise or misconfiguration than almost anything else in the environment.

None of this requires exotic tooling. It requires treating "an AI agent just created a credential" as an identity event with the same governance weight as "a new employee was onboarded" — because functionally, that's close to what's happening, except the new entity can clone itself a hundred times before lunch.

How SecurityInfinity approaches this

Our agentic pentesting platform treats non-human identity enumeration as a standing part of every engagement scope where AI agents touch production systems. We don't just test the agent's intended behavior against its stated permissions — we test what the agent's credentials can actually reach once minted, independent of what the agent was supposed to do with them. That gap between intended scope and actual reachable scope is where we've found the highest-severity findings in agentic environments this year, consistently.

Agent identity sprawl isn't a future problem. It's already the attack surface inside organizations that adopted agentic workflows over the last eighteen months, and most of them don't know it yet because nobody has looked.

Frequently asked questions

Is agent identity sprawl the same as shadow IT? Related but distinct. Shadow IT describes unsanctioned tools or services that humans adopt outside official channels. Agent identity sprawl describes credentials and permissions created by sanctioned, approved AI tooling that nonetheless proliferate beyond what any governance process tracked or approved — the tool is authorized, but its credential-minting behavior isn't.

Can standard identity and access management (IAM) tools handle agent identities? Most IAM platforms can technically register a non-human identity, but very few have workflows designed around the velocity and dynamism of agent-created credentials. The gap isn't tooling capability, it's process: almost nobody has built the equivalent of an onboarding/offboarding workflow for credentials an agent creates for itself mid-task.

How do we even find out how many credentials our agents have created? Start with your secrets manager and cloud IAM audit logs, filtered to the service principals or API identities your agent frameworks run under. Cross-reference credential creation timestamps against your agent orchestration platform's task logs. If those two data sources have never been joined before, expect to find more active credentials than your existing inventory shows.

Should we just ban agents from creating their own credentials? In high-sensitivity environments, that's often the right call — route all credential issuance through a broker service the agent must call, rather than letting the agent mint credentials directly against a cloud provider or secrets manager. It adds latency but gives you a single enforcement and audit point.

What's the single highest-impact fix if we can only do one thing? Put an expiration on every credential an agent can create, tied to task completion rather than a fixed TTL. Standing credentials are the single biggest multiplier of blast radius we see in agentic pentests, and most frameworks support short-lived tokens already — the gap is usually configuration, not capability.

Find what attackers can see, before they do.

AI pentesting agents test your web app, API and cloud, and every finding comes with evidence and a fix. First report in about 10 minutes.

Stay ahead of attackers.

New vulnerabilities, breach write-ups and practical fixes. A few emails a month.