Non-human identity security protects the accounts that software uses instead of people: service accounts, service principals, API keys, OAuth apps, and AI agents. These identities often hold broad, long-lived permissions with no MFA, so securing them means inventorying them, limiting their access, rotating credentials, and monitoring how they behave.
Key takeaways
- A non-human identity (NHI) is any credential software uses to authenticate, from service accounts to AI agents.
- NHIs are a growing attack surface because they carry broad permissions, rarely rotate secrets, have no MFA, and often have no owner.
- Common attack paths include leaked secrets, over-privileged service principals, abused OAuth grants, and compromised pipeline tokens.
- Securing them starts with an inventory and an owner for every identity, then least privilege and short-lived credentials.
- Detection works well because NHIs behave predictably. Deviations from baseline are often clearer than they are for people.
- AI agents are NHIs too, and need the same controls plus limits on the actions they can take.
Every cloud environment runs on identities nobody logs in as. Service accounts move data between systems. App registrations connect SaaS tools. Pipelines hold tokens to deploy code. Developers and integrations create these constantly, so most teams can’t say how many exist or who owns them. Attackers know that. A stolen API key or an over-privileged service principal gives persistent access that looks like normal automation. This page covers what NHIs are, how they get attacked, and how to secure and monitor them. You can find more on identity-based attacks here.
What are non-human identities?
| Type | What it does | Common risk |
|---|---|---|
|
Service accounts |
Run apps and scheduled jobs | Shared, never rotated, no owner |
|
Service principles and workload identities |
Lets cloud workloads access resources | Over-privileged roles |
|
API keys |
Authenticates calls between systems | Leaked in code or logs |
|
OAuth apps |
Connects third-party apps to your data | Broad scopes granted by users |
|
CI/CD tokens |
Lets pipeline deploy and read secrets | Compromised build systems |
|
AI agents |
Acts on someone’s behalf | Delegated access with few limits |
Why are non-human identities a growing attack surface?
Three things push the count and the risk up. First, SaaS integrations multiply OAuth connections, and one approval can hand an app lasting access to mail or files. Attackers exploit that with malicious OAuth apps. Second, cloud and DevOps work creates service principals and tokens faster than anyone reviews them. Third, AI agents add a new class of identity that reads data and takes actions with delegated permissions.
The common thread is that these identities are rarely reviewed. They’re created for a task, given generous access to avoid breaking things, and then forgotten.
What are the common attack paths?
- Leaked secrets. API keys and tokens end up in code repositories, logs, or chat.
- Over-privileged service principals. One stolen credential reaches far more than the task needed.
- Abused OAuth grants. A malicious app keeps access after the user’s password is reset.
- Compromised pipeline tokens. An attacker who owns the build system inherits its permissions.
How do you secure non-human identities?
- Inventory and assign owners. List every service account, app registration, and API key. Every one gets a named owner.
- Apply least privilege. Cut each identity down to what it needs and remove the ones nobody uses.
- Replace long-lived secrets. Use short-lived tokens or managed identities where you can.
- Rotate what’s left. Set rotation schedules and track credential age.
- Baseline and monitor. Know what normal looks like for each identity so odd behavior stands out.
How do you detect a compromised non-human identity?
Watch for these signals:
- Service principals or service accounts signing in from new IP addresses or networks.
- New secrets added to an existing app.
- Sudden permission increases.
- API activity that breaks the identity’s normal pattern.
Because NHIs behave predictably, a deviation from baseline is often a clearer signal than it is for a human user. Detection ties into your broader ITDR coverage. For AI agents, baselines matter just as much.
Are AI agents non-human identities?
Yes. An AI agent that reads mail, queries data, or takes actions authenticates with its own credentials or delegated OAuth permissions. That makes it an NHI. It needs an owner, least-privilege access, and monitoring, plus guardrails on what it can do. Risks beyond identity, such as prompt injection, are covered in security risks of agentic AI.
Best practices
- Give every non-human identity an owner and a purpose on record.
- Delete unused service accounts and app registrations on a schedule.
- Scan code, logs, and chat for leaked keys and rotate anything exposed.
- Prefer managed identities and short-lived tokens over static secrets.
- Alert on new credentials added to existing apps.
- Treat AI agents like any other NHI from day one.
Expel’s take
Non-human identities are where identity security and cloud security meet, and most teams only find them after something goes wrong. Expel calls it the AI attack surface, and watches for service principal and OAuth abuse across cloud and identity, and our analysts investigate what changed: new credentials, new permissions, and new network sources. Human-led, with technology doing the heavy lifting on volume.
Frequently asked questions
What is a non-human identity?
A non-human identity is any account or credential that software, rather than a person, uses to authenticate. Examples include service accounts, cloud service principals and workload identities, API keys, OAuth app registrations, CI/CD tokens, and AI agents. They let systems talk to each other, but attackers can abuse them just like user accounts.
Why are non-human identities a security risk?
Non-human identities often have broad permissions, credentials that rarely rotate, no MFA, and no clear owner. They’re also hard to inventory because developers and SaaS integrations create them constantly. An attacker who steals a leaked API key or abuses an over-privileged service principal can gain persistent access that looks like normal automation.
Are AI agents non-human identities?
Yes. An AI agent that reads mail, queries data, or takes actions on someone’s behalf authenticates with its own credentials or delegated OAuth permissions, which makes it a non-human identity. Agents need the same controls as other machine identities—an owner, least-privilege access, and monitoring—plus guardrails on the actions they can take.
How do you secure non-human identities?
Start with an inventory of every service account, app registration, and API key, and assign each one an owner. Then remove unused identities, reduce permissions to what each one needs, replace long-lived secrets with short-lived tokens or managed identities, and monitor activity against a baseline so unusual behavior is flagged.
How do you detect a compromised non-human identity?
Watch for service principals or service accounts signing in from new IP addresses or networks, new secrets added to an existing app, sudden permission increases, and API activity that breaks the identity’s normal pattern. Because these identities behave predictably, deviations from their baseline are often clearer signals than they are for human users.


