Open-source auditor for Non-Human Identities and AI Agent attack surfaces in cloud environments
Project description
AgentSentry ๐ก๏ธ
Open-source auditor for Non-Human Identities and AI Agent attack surfaces in cloud environments.
"45 machine identities for every 1 human. Almost none of them are governed."
AgentSentry discovers every IAM role, API key, service account, and AI agent in your environment, builds an attack graph of their access relationships, and scores the blast radius if any identity is compromised โ including a novel AI-Amplification Factor that quantifies how autonomous AI agents multiply attack surface.
Why AgentSentry?
Modern enterprises have a critical blind spot: Non-Human Identities (NHIs). While security teams focus on human user access, machine identities โ CI/CD service accounts, AI agents, API keys, Lambda execution roles โ operate with minimal governance, often with excessive permissions, and almost no rotation discipline.
In 2026, with autonomous AI agents taking real-world actions (sending emails, writing databases, deploying code), a single compromised NHI can cascade into a breach that defeats every perimeter control simultaneously.
No free, open-source tool maps this risk. AgentSentry does.
Features
- ๐ NHI Discovery โ Finds all IAM roles, API keys, service accounts, and AI agents
- ๐ Risk Scoring โ Computes
Risk = Privilege ร Reachability ร Exposure ร AI-Amplification - ๐ธ๏ธ Attack Graph โ Builds an interactive graph of access relationships and blast radius
- ๐ค AI Agent Analysis โ Scans LangChain/CrewAI configs for autonomy level and tool risk
- ๐บ๏ธ MITRE ATT&CK Mapping โ Maps every finding to ATT&CK techniques
- ๐ CISA KEV Enrichment โ Correlates findings against known exploited vulnerabilities
- ๐ 100% Free โ Runs on AWS free tier, outputs to local HTML, no SaaS required
Quick Start
# Install from PyPI (no credentials needed to try it)
pip install nhi-audit
# Run against mock environment instantly
agentsentry scan mock
# Check what providers are ready on your machine
agentsentry providers
# Scan your local machine (no credentials needed)
agentsentry scan local
# Scan AWS (requires aws configure)
pip install nhi-audit[aws]
agentsentry scan aws
# Scan everything that's configured
agentsentry scan all
# Generate interactive attack graph
agentsentry scan mock --visualize
# Analyze blast radius for a specific identity
agentsentry blast "ml-pipeline-executor"
Provider-specific installs
pip install nhi-audit[aws] # + AWS IAM, Lambda, S3, Secrets Manager
pip install nhi-audit[azure] # + Managed Identities, Service Principals
pip install nhi-audit[gcp] # + Service Accounts, SA Keys
pip install nhi-audit[github] # + PATs, Deploy Keys, Actions Secrets
pip install nhi-audit[k8s] # + ServiceAccounts, ClusterRoleBindings
pip install nhi-audit[all-clouds] # Everything
Sample Output
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ AgentSentry v0.1.0 โ
โ NHI & AI Agent Risk Auditor โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
NHIs Discovered: 6 Critical: 3 High: 1 AI Agents: 2
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโฌโโโโโโโโโโโ
โ Identity โ Type โ Risk โ Score โ Findings โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโผโโโโโโโโโโโค
โ langchain-crm-agent โ ai_agent โ โ CRITICAL โ 150.0 โ 2 โ
โ ml-pipeline-executor โ iam_role โ โ CRITICAL โ 112.5 โ 3 โ
โ github-actions-prod-deploy โ github_secretโ โ CRITICAL โ 90.0 โ 2 โ
โ legacy-reporting-service-key โ iam_user_key โ โ HIGH โ 52.5 โ 2 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโดโโโโโโโโโโโ
โ langchain-crm-agent โ Fully Autonomous AI Agent With Irreversible Tools
This agent has FULLY_AUTONOMOUS execution with delete_record, send_email.
AI-Amplification Factor: 10.0x
Remediation: Implement human-in-the-loop approval for all irreversible tools.
MITRE: T1651, T1059
The Scoring Model
NHI Risk Score = P ร R ร E ร A
P = Privilege Score (1โ10) How powerful are the permissions?
R = Reachability Score (1โ3) How accessible is this identity to attackers?
E = Exposure Score (1โ5) How poor is the credential lifecycle?
A = AI-Amplification (1โ60) [NOVEL] How much does agent autonomy multiply blast radius?
Score โฅ 100 โ CRITICAL
Score โฅ 50 โ HIGH
Score โฅ 20 โ MEDIUM
Score < 20 โ LOW
The AI-Amplification Factor (A) is the novel academic contribution of this project. No existing NHI risk framework accounts for how autonomous AI agents compound the impact of a compromised machine identity. See the paper for the formal model.
Architecture
agentsentry/
โโโ core/
โ โโโ models.py # Data models (NonHumanIdentity, Resource, Finding)
โ โโโ scorer.py # Risk scoring engine โ P ร R ร E ร A
โ โโโ graph.py # NHI Attack Graph (NetworkX + Pyvis)
โโโ scanners/
โ โโโ mock.py # Demo environment โ no credentials needed
โ โโโ aws.py # AWS IAM scanner (Phase 1)
โ โโโ langchain.py # AI agent static analyzer (Phase 3)
โโโ enrichment/
โ โโโ cisa_kev.py # CISA KEV feed correlation
โ โโโ mitre.py # MITRE ATT&CK mapping
โโโ cli.py # Click-based CLI
Roadmap
- Core scoring model (P ร R ร E ร A)
- Mock scanner for demos
- CLI with Rich terminal output
- Interactive attack graph visualization
- AWS IAM scanner (boto3)
- LangChain agent static analyzer
- CISA KEV enrichment
- MITRE ATT&CK enrichment
- Azure AD service principal scanner
- GitHub Actions secrets scanner
- Streamlit dashboard
- Research paper (arXiv)
Contributing
This is an open research project. Contributions welcome โ especially:
- Cloud provider scanner implementations
- Additional AI agent framework support (CrewAI, AutoGen, Semantic Kernel)
- Threat intelligence enrichment integrations
- Validation datasets for the scoring model
Paper
The formal scoring model and evaluation methodology is being written up as a research paper.
Pre-print will be available on arXiv. See paper/ for the LaTeX source.
License
MIT โ use it, fork it, build on it.
Built by Abhiram Lanka | Addressing the NHI blindspot in enterprise security
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nhi_audit-0.1.2.tar.gz.
File metadata
- Download URL: nhi_audit-0.1.2.tar.gz
- Upload date:
- Size: 51.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
474af107d182d29682f60e7475c50fc7f9d38c06c1437f4b64883e4add411cea
|
|
| MD5 |
0d8a30d4292f7ae0ce893628d0b93836
|
|
| BLAKE2b-256 |
1ca7314736f230f65d4994074458928a8ada87d60ace9fd5d3101a63c043ef69
|
File details
Details for the file nhi_audit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: nhi_audit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 57.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bc6740d29f44bff5ac7706792ec6814abccf5e268002f0ac808e439d237bfba
|
|
| MD5 |
5d0c5bfa37225af50e1f2b204dee1feb
|
|
| BLAKE2b-256 |
51244310c22dc22279872061125f81bbb048681bdd4b979c391ac10116dae16b
|