Non-Human Identities (NHI): The Hidden Security Crisis Powering AI Agent Attacks in 2026
Machine identities now outnumber humans 40–100:1 in enterprise environments. With AI agents minting thousands of new credentials daily, NHIs have become the fastest-growing and least-governed attack surface in cybersecurity. Here is what every security team needs to know.
The identity crisis nobody saw coming
In 2024, a security team at a Fortune 500 bank audited their identity infrastructure expecting around 50,000 human user accounts. They found 4.2 million non-human identities instead: service accounts, API keys, OAuth tokens, certificates, bot credentials. Most were unmanaged. Many had excessive privileges. Thousands were completely abandoned.
This isn't an anomaly. It's what most large organizations look like when they actually check.
NHIs now outnumber human identities in enterprise environments 40:1 to 100:1, with some hyper-automated organizations hitting 500:1. AI agents are accelerating this faster than existing IAM tools were built to handle.
Gartner named "Identity and Access Management Adapts to AI Agents" one of its top six cybersecurity trends for 2026. The World Economic Forum called NHIs "agentic AI's new frontier of cybersecurity risk." Most organizations still manage them like it's 2019: spreadsheets, manual rotation schedules, shared API keys that nobody ever expires.
68% of IT security incidents now involve machine identities. Half of enterprises have already had a breach tied to unmanaged NHIs.
What a non-human identity actually is
A non-human identity is any credential, token, or secret that lets a software system, automated process, or AI agent authenticate and access resources — no human directly involved in the transaction.
| NHI Type | Examples | Risk Level |
|---|---|---|
| Service Accounts | Database service accounts, Windows service accounts | High: often over-privileged, rarely rotated |
| API Keys | AWS access keys, Stripe keys, OpenAI API keys | Critical: frequently hardcoded, long-lived |
| OAuth Tokens | App-to-app authorization, third-party integrations | High: broad scope, hard to track |
| Certificates & Secrets | TLS certs, SSH keys, JWT signing keys | Medium-High: expiry gaps cause outages and breaches |
| CI/CD Credentials | GitHub Actions secrets, pipeline tokens | Critical: direct access to code and infrastructure |
| AI Agent Identities | Autonomous agent API keys, MCP server tokens, tool access tokens | Emerging: rapidly growing, almost no governance |
AI agent identities are driving the 2026 problem. Every time you deploy an AI agent — a coding assistant, a support bot, an autonomous data pipeline — that agent needs credentials to hit APIs, databases, communication tools, cloud services. A single AI workflow can mint dozens of new NHIs in an afternoon. In most organizations, those credentials are created once, never rotated, and owned by nobody.
The 2026 NHI Reality Report puts the average enterprise at over 250,000 NHIs across cloud environments. 71% haven't been rotated within recommended timeframes. 97% carry more access than their function requires. Only 15% of organizations feel confident they can actually prevent NHI-based attacks.
Why attackers go after NHIs first
The main thing about compromised NHIs is that they don't tell anyone. A suspicious login from a human account might trigger a password reset or an IT ticket. An API key just keeps working. The average dwell time after an NHI breach is over 200 days — more than three times the average for compromised human accounts.
On top of that, they come pre-loaded with too much access. Developers grant broad permissions when creating service accounts because narrowing scope takes time they don't have. The OWASP NHI Top 10 lists excessive permissions as the most prevalent NHI risk. An API key with read/write access to cloud storage is a skeleton key, not a service credential.
The blast radius when one goes wrong can be enormous. In the 2025 Salesloft-Drift incident, attackers compromised OAuth tokens connecting multiple SaaS platforms and reached hundreds of downstream customer environments through a single credential — roughly 10x the impact of a typical human account breach, because that one NHI was trusted by many interconnected systems.
Most NHI breaches don't get caught from the inside. Only 21% of executives report complete visibility into agent permissions, tool usage, or data access patterns. Most incidents surface through external reports or accidents, not internal detection.
And NHIs don't expire on their own. API keys and service account passwords often survive employee departures, product pivots, and infrastructure migrations for years.
The five OWASP NHI risks worth acting on
OWASP published a Non-Human Identities Top 10 framework in 2025, recognizing that NHI security doesn't fit neatly into existing application security or human IAM processes. Here are the five that matter most.
1. Improper offboarding
When a service is deprecated, an employee leaves, or a vendor contract ends, the NHIs tied to those entities rarely get cleaned up. Zombie credentials keep their access long after they serve any purpose.
Attackers hunt for them by enumerating endpoints, scanning certificate transparency logs, and combing code repositories for abandoned keys.
What to do:
- Wire NHI deprovisioning into HR offboarding and vendor management as an automated step, not a task someone might remember
- Set hard expiry dates at creation time — no NHI should exist without one
- Run a monthly report on NHIs with no activity in 30 days
- Assign every NHI a named human owner; if that person leaves, the NHI gets flagged automatically
2. Secret leakage
Credentials hardcoded in source code, committed to version control, baked into container images, or sitting in CI/CD environment variables are consistently exploited. AI coding assistants have made this worse — they generate placeholder credentials that developers swap with real values, often without a scanning gate in place.
What to do:
- Run pre-commit secret scanning on every developer workstation and CI/CD pipeline; detect-secrets, Trufflehog, and GitGuardian can block credential commits before they hit the repository
- Rotate any credential that may have touched a repo, even a private one
- Don't store secrets in environment variables for production; use a vault
- Make secret scanning part of the code review checklist, not something optional
This .pre-commit-config.yaml gets you scanning in under five minutes:
# .pre-commit-config.yaml - add to repo root, then run: pre-commit install
repos:
- repo: https://github.com/trufflesecurity/trufflehog
rev: v3.88.0
hooks:
- id: trufflehog
name: TruffleHog secret scan
entry: trufflehog git file://. --since-commit HEAD --fail
language: system
pass_filenames: false
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']3. Excessive permissions
97% of NHIs carry more access than they need. That's the default when permissions get set once and never revisited. Unlike human accounts, NHI permissions almost never appear in quarterly access reviews.
The fix is least privilege by design: every NHI should have access to the minimum set of resources for its actual function, based on usage data, not what a developer guessed it might need someday.
What to do:
- Pull 90-day usage logs for all NHIs, compare actual permissions used against what's granted, and revoke the rest
- Require explicit sign-off for any NHI with admin or wildcard scopes
- Include NHI permissions in your quarterly access review alongside human accounts
- Use cloud-provider tools (AWS Access Analyzer, Azure Access Reviews) to flag NHIs with unused permissions
AWS Access Analyzer makes it straightforward to generate a least-privilege policy from actual usage:
# Generate a report of services accessed by a role in the last 90 days
aws iam generate-service-last-accessed-details --arn arn:aws:iam::123456789012:role/MyAgentRole
# List services that were NEVER used - safe to remove from the policy
aws iam get-service-last-accessed-details --job-id <job-id> --query "ServicesLastAccessed[?TotalAuthenticatedEntities==`0`].ServiceName"Any service with zero authenticated entities in 90 days can be removed from the role's policy with no operational impact.
4. Third-party NHI risks
Every SaaS integration, vendor connection, and OAuth app you authorize creates NHIs you don't control. They run under your trust, with your data, governed by someone else's security program.
The February 2026 Moltbook breach illustrated this: attackers hit a third-party integration on an AI agent platform, then pivoted to client environments across the whole platform through the trusted NHIs that integration held.
What to do:
- Keep a complete inventory of all third-party NHIs and OAuth authorizations — that means auditing your SaaS catalog, not just your own infrastructure
- Narrow the scope of third-party OAuth grants; most are broader than the vendor actually needs
- Review all third-party NHI authorizations every 90 days and revoke what you can't justify
- Feed third-party NHI activity into your SIEM; unusual access patterns from vendor integrations often show up before the vendor admits anything is wrong
5. Insecure authentication methods
Most NHIs still authenticate with static, long-lived credentials: API keys that don't rotate, passwords in config files, certificates with multi-year lifetimes. Workload identity standards like OIDC, short-lived tokens, and certificate-bound access cut the attack surface considerably, but they take real effort to implement.
What to do:
- Start by eliminating static API keys in cloud environments; AWS, Azure, and GCP all support workload identity federation, which removes the need for long-lived keys entirely
- Set a credential lifetime policy: API keys expire in 90 days, service account passwords rotate every 30, certificates renew automatically
- Use JIT access for AI agents: issue credentials for a specific task and revoke them when it's done, rather than granting standing access
- Build break-glass procedures so a compromised agent's credentials can be revoked in minutes
JIT vs. standing access
Moving from standing access to just-in-time access is one of the highest-impact changes you can make for AI agent NHIs.
| Factor | Standing Access | Just-in-Time Access |
|---|---|---|
| Exposure window | Continuous | Minutes per task |
| Blast radius if compromised | All granted permissions, always | Only the current task's scope |
| Audit granularity | Low (access is always authorized) | High (every task logged individually) |
| Operational overhead | Low | Medium (requires vault integration) |
| Overall risk | High | Low |
JIT access requires a vault that can issue dynamic credentials — HashiCorp Vault, AWS Secrets Manager with rotation, or Azure Key Vault all work. A compromised agent with JIT credentials can't do much once its task-scoped token expires.
NHI governance maturity model
Most organizations are at Level 1. Level 3 is where risk becomes manageable when you're deploying AI at scale.
| Level | What it looks like | Share of enterprises in 2026 |
|---|---|---|
| Level 0: Unaware | No NHI inventory. Credentials managed ad hoc. No rotation. | ~20% |
| Level 1: Reactive | Partial inventory. Rotation happens after incidents. Basic vault usage. | ~40% |
| Level 2: Managed | Full inventory. Automated rotation. Least-privilege underway. Regular NHI reviews. | ~25% |
| Level 3: Optimized | JIT access. Continuous behavioral monitoring. AI agent identities fully governed and audited. | ~15% |
Getting from Level 1 to Level 2 is the priority for most organizations. It needs three things: a complete NHI inventory, automated rotation, and NHI permissions added to your existing access review process.
Where to start
This week: get visibility
- Run a discovery scan across cloud environments and CI/CD pipelines; Entro, Clutch, or your cloud provider's IAM analysis tools can help build the inventory
- Flag every credential with no expiry date — those are your highest priority
- List every AI agent deployment, document what credentials it uses, who created them, and whether there's a named owner
This month: shrink the exposure
- Stand up a secrets management platform if you don't have one (HashiCorp Vault, AWS Secrets Manager, and Azure Key Vault are all workable starting points)
- Get pre-commit secret scanning running across all developer repositories
- Set an NHI ownership policy: every NHI needs a named human owner on record
- Review and cut permissions on your 50 highest-privilege NHIs using actual 90-day usage data
This quarter: build the foundation
- Automate credential rotation for all NHIs, starting with cloud service accounts and CI/CD credentials — those have the largest blast radius
- Build behavioral baselines for AI agent identities and alert on anything anomalous
- Wire NHI offboarding into HR and vendor management so credentials are revoked automatically when people leave or contracts end
- Define a JIT access model for new AI agent deployments going forward
The governance gap
The habits that created shadow IT in the 2010s — move fast, create credentials for immediate needs, figure out lifecycle management later — are producing shadow NHIs at a scale that wasn't possible before. Every autonomous AI workflow, every new integration, every MCP server connection adds to the footprint. NHIs don't have offboarding interviews or IT-managed device wipes. They sit there until someone finds them.
Gartner projects that by 2027, organizations without formal NHI governance will see three times the identity-related breach rate of those that have it. For organizations running AI agents at scale, that's not an abstract risk.
The OWASP NHI Top 10, Gartner's IAM guidance, and a growing market of NHI management platforms give security teams a usable path. The practical starting point is the same as it is for most security problems: you need to know what you have before you can do anything about it.
Further Reading
The following reports and frameworks were used as the basis for this article:
- [Gartner: Top Cybersecurity Trends for 2026](https://www.gartner.com/en/newsroom/press-releases/2026-02-05-gartner-identifies-the-top-cybersecurity-trends-for-2026) - Gartner's official February 2026 press release naming IAM for AI agents as a top trend
- [OWASP Non-Human Identities Top 10](https://owasp.org/www-project-non-human-identities-top-10/) - The OWASP framework for NHI security risks
- [AI Agents Are Creating an Identity Security Crisis in 2026](https://www.iansresearch.com/resources/all-blogs/post/security-blog/2026/02/24/ai-agents-are-creating-an-identity-security-crisis-in-2026) - IANS Research analysis
- [Non-Human Identities: Agentic AI's New Frontier of Cybersecurity Risk](https://www.weforum.org/stories/2025/10/non-human-identities-ai-cybersecurity/) - World Economic Forum
- [AI Agents: The Next Wave Identity Dark Matter](https://thehackernews.com/2026/03/ai-agents-next-wave-identity-dark.html) - The Hacker News, March 2026
- [2026 NHI Reality Report](https://cyberstrategyinstitute.com/2026-nhi-reality-report/) - Cyber Strategy Institute
- [Why Non-Human Identities Are Your Biggest Security Blind Spot in 2026](https://www.csoonline.com/article/4125156/why-non-human-identities-are-your-biggest-security-blind-spot-in-2026.html) - CSO Online
- [The State of Non-Human Identity and AI Security](https://cloudsecurityalliance.org/artifacts/state-of-nhi-and-ai-security-survey-report) - Cloud Security Alliance
Get weekly security insights
Cloud security, zero trust, and identity guides — straight to your inbox.
Microsoft Cloud Solution Architect
Cloud Solution Architect with deep expertise in Microsoft Azure and a strong background in systems and IT infrastructure. Passionate about cloud technologies, security best practices, and helping organizations modernize their infrastructure.
Questions & Answers
Related Articles
Azure AI Foundry Private Link Setup: Secure Azure OpenAI, AI Search, and Storage End-to-End
18 min read
MCP Server Security: How to Protect AI Agents from Prompt Injection and Tool Abuse (2026)
18 min read
AI Red Teaming: How to Test Your AI Systems for Security Vulnerabilities
15 min read
Need Help with Your Security?
Our team of security experts can help you implement the strategies discussed in this article.
Contact Us