What Is a Non-Human Identity (NHI) Audit — and Why It Is Now Essential
Most engineering teams enforce SSO, hardware keys, and strict offboarding for employees. Yet the majority of production access no longer belongs to humans. In modern stacks, Non-Human Identities (NHIs) — API keys, OAuth
Most engineering teams enforce SSO, hardware keys, and strict offboarding for employees. Yet the majority of production access no longer belongs to humans.
In modern stacks, Non-Human Identities (NHIs) — API keys, OAuth tokens, service accounts, webhooks, CI/CD bots, and AI agent credentials — outnumber human accounts by 10× to 50×. Almost none of them have MFA, and very few have an expiration date.
That gap is exactly why NHI audits are rapidly moving from a niche IAM topic to a core security requirement.
What Is a Non-Human Identity (NHI)?
An NHI is any digital credential used by a machine, script, workflow, or AI agent to authenticate against another system without direct human interaction.
They typically fall into four categories:
- API Keys & Tokens: SaaS API keys, OAuth tokens, Personal Access Tokens (PATs), and webhook URLs.
- Service & Cloud Accounts: Cloud IAM roles (AWS/Azure/GCP), Active Directory / Entra ID service accounts, and CI/CD runners.
-
Secrets & Certificates: SSH keys, TLS certificates, and database passwords stored in
.envfiles or containers. -
AI Agent & No-Code Credentials: LLM API keys, Model Context Protocol (
mcp.json) server tokens, and connectors inside n8n, Make, or Zapier.
Why Traditional IAM Audits Miss the Problem
Standard security controls were designed around human behavior. NHIs break every one of those assumptions:
| Security Control | Human Account (Employee) | Non-Human Identity (NHI) |
|---|---|---|
| Visibility | 1 account per employee, tracked by HR & SSO | 10×–50× volume, scattered across Git, Cloud, and SaaS |
| Authentication | Protected by MFA / SSO / biometrics | Zero MFA — a leaked key grants immediate silent access |
| Offboarding | Revoked on departure day | Zombie access — scripts and workflows keep running indefinitely |
| Privileges | Scoped by role (RBAC) | Often created with Admin or Read/Write * during prototyping |
The Two Multipliers Making NHI Audits Essential Now
Two recent shifts have turned unmanaged machine credentials into a primary intrusion vector:
1. Shadow Automation (No-Code & Low-Code)
Business and Ops teams routinely connect CRMs, email servers, and databases using Make, n8n, Zapier, or Power Automate. Every connector mints a persistent OAuth token or stores a Bearer token — often with broad permissions and outside IT visibility. When a contractor or employee leaves, those workflows quietly keep running.
2. Autonomous AI Agents & MCP
AI agents do not just generate text; they call tools, query RAG vector stores, and trigger APIs using their own NHIs. If an agent processes untrusted input containing an indirect prompt injection, an attacker can trigger a Confused Deputy attack: forcing the agent to exfiltrate data or run destructive actions using its own legitimate, over-privileged credentials.
How an NHI Audit Actually Works (4 Phases)
A solid NHI audit does not require expensive proprietary SaaS lock-in. It follows four reproducible steps using open-source tooling:
-
Discovery & Inventory: Scan Git history and
.envfiles (e.g., Gitleaks, TruffleHog), export Cloud IAM roles (Prowler, ScoutSuite), and collect No-Code JSON exports andmcp.jsonconfigs. Cross-check last-used timestamps to isolate zombie credentials. -
Privilege & Exposure Analysis: Flag wildcard scopes (
*,admin), unauthenticated public webhooks, and static keys without rotation. - Adversarial Validation: Test whether exposed tokens can be replayed, and run controlled indirect prompt injection tests against MCP/RAG agents to verify blast radius.
- Remediation & Lifecycle Governance: Revoke zombie keys in staged batches, centralize secrets in an open-source vault (OpenBao, Infisical), and migrate static keys toward short-lived ephemeral tokens (OIDC / SPIFFE).
For the complete technical breakdown — including open-source tooling, regulatory mapping (ISO 27001, NIS2, EU AI Act), and typical duration/cost benchmarks — read the full reference guide here:
👉 Non-Human Identity (NHI) Audit: Full Methodology, Tools & Benchmarks
The One Rule to Start With
If you want to cut 80% of your NHI risk before running a full audit, enforce one simple governance invariant across your stack:
1 NHI = 1 named human owner + 1 expiration date.
If a key, webhook, or MCP token has no owner and no expiry, it is not infrastructure — it is an unmonitored backdoor.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.