Skip to main content

Open-source auditor for Non-Human Identities and AI Agent attack surfaces in cloud environments

Project description

AgentSentry ๐Ÿ›ก๏ธ

CI PyPI PyPI Downloads Python License Website

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nhi_audit-0.1.2.tar.gz (51.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nhi_audit-0.1.2-py3-none-any.whl (57.2 kB view details)

Uploaded Python 3

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

Hashes for nhi_audit-0.1.2.tar.gz
Algorithm Hash digest
SHA256 474af107d182d29682f60e7475c50fc7f9d38c06c1437f4b64883e4add411cea
MD5 0d8a30d4292f7ae0ce893628d0b93836
BLAKE2b-256 1ca7314736f230f65d4994074458928a8ada87d60ace9fd5d3101a63c043ef69

See more details on using hashes here.

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

Hashes for nhi_audit-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3bc6740d29f44bff5ac7706792ec6814abccf5e268002f0ac808e439d237bfba
MD5 5d0c5bfa37225af50e1f2b204dee1feb
BLAKE2b-256 51244310c22dc22279872061125f81bbb048681bdd4b979c391ac10116dae16b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page