AI Security
Orphaned AI Agent Credentials Create Lasting Security Gaps—Here's How to Fix It
AWS access keys created for temporary agents never expire by default, leaving forgotten credentials valid long after the jobs they served have ended—a gap that OWASP flagged as the top non-human identity risk.
1/2
The New Stack
When an AI agent finishes its task and gets decommissioned, its authentication credentials often remain active indefinitely—a gap that few teams catch until an audit uncovers keys sitting dormant for months or years.
The lifecycle problem is real. An IAM user access key created fourteen months ago but unused for eleven months can still grant access to cloud infrastructure, even if the agent that needed it is long gone and the person who approved it no longer works at the company. AWS doesn't expire IAM keys automatically, so without deliberate action, a forgotten credential stays valid until someone explicitly disables or deletes it.
Why Attackers Move Faster Than Annual Audits#
OWASP ranked improper credential offboarding first in its 2025 Top 10 for non-human identities. The problem isn't just neglect—it's the speed at which exposed credentials become dangerous once an attacker gains a foothold. In September 2026, GreyNoise documented an AI-orchestrated campaign targeting PaperCut servers that achieved remote code execution at real victims in under four hours and compromised at least eleven organizations in 26 seconds. That pace makes slow inventory and revocation procedures genuinely risky.
An agent's provisioned credential—a persistent key, secret, or token handed to a workload during deployment—differs from the deployment identity itself. Both need management, but they have different owners and revocation procedures. A forgotten VM costs money; a forgotten credential can grant access to anyone who finds it.
Query: Finding Keys No One Is Using#
The first step is visibility. Teams can sync AWS IAM credential reports into a database and query for keys that are both old and unused. The query identifies active IAM user access keys at least 90 days old with no activity in the past 90 days, skipping the root account (which requires urgent separate review). It returns a prioritized list of candidates for investigation:
- Which agent or workload used this credential?
- What still depends on it?
- When should access end?
Other clouds require similar but different inventory approaches. Microsoft Entra ID exposes credential metadata through entraid_serviceprincipals, and Google Cloud records service account key activity in audit logs if the inventory table is enabled in your sync configuration.
