Identity & access security for non-human identities (NHIs).
Enterprises have 10–50x more machine identities than human ones — service accounts, API keys, OIDC tokens, and now AI agents. Most are over-permissioned, unaudited, and invisible to traditional IAM tools.
AgentShield is an open-source scanner that finds risky non-human identities across your stack. We're starting where the pain is newest and sharpest: AI agents and MCP configurations. Service accounts, CI/CD credentials, and cloud workload identities are on the roadmap.
npx agentshield scan ~/.claude/claude_desktop_config.json- MCP server configurations (Claude Desktop, Cursor, etc.)
- AI agent IAM policies and tool permissions
- GitHub Actions secrets and OIDC trust policies
- AWS / Azure service accounts and workload identities
- CI/CD pipeline credentials
# Install
npm install -g agentshield
# Scan your MCP configs (auto-detects config locations)
agentshield scan
# Scan a specific file
agentshield scan ~/.claude/claude_desktop_config.json
# See all available rules
agentshield rules| Rule | Severity | Description |
|---|---|---|
| MCP-001 | 🔴 Critical | Hardcoded secrets in environment variables |
| MCP-002 | 🟠 High | Overprivileged filesystem access |
| MCP-003 | 🟠 High | Unrestricted shell execution |
| MCP-004 | 🔵 Medium | No transport security (HTTP without auth) |
| MCP-005 | 🟠 High | Known vulnerable MCP packages (CVE database) |
| MCP-006 | 🔵 Medium | Excessive tool permissions |
| MCP-007 | 🟠 High | Data exfiltration risk (read + network combo) |
| MCP-008 | 🔵 Medium | Unversioned package references (supply chain) |
| MCP-009 | 🔵 Medium | Localhost-only exposure violation (0.0.0.0) |
| MCP-010 | ⚪ Low | Missing resource boundaries / no allowlists |
AI agents are the fastest-growing attack surface in enterprise security. OWASP released a Top 10 for Agentic Applications in 2026. Gartner projects 40% of enterprise applications will embed AI agents by 2026.
But nobody is scanning agent configurations for security issues. Until now.
Common vulnerabilities AgentShield prevents:
- Prompt injection → data exfiltration: Agent reads your SSH keys via filesystem access and sends them via the HTTP fetch server
- Supply chain attacks: Unpinned
npxpackages can be hijacked between runs - Credential theft: API keys hardcoded in config files read by anyone with file access
- Network exposure: MCP servers bound to
0.0.0.0accessible from the entire LAN - Shell compromise: Direct
bash/shcommands grant complete system access to any agent
┌──────────┬──────────┬─────────────────────┬────────────────────────────────────────────┐
│ Severity │ Rule │ Server │ Issue │
├──────────┼──────────┼─────────────────────┼────────────────────────────────────────────┤
│ 🔴 CRITICAL │ mcp-001 │ filesystem │ Env var "OPENAI_API_KEY" contains a secret │
│ 🟠 HIGH │ mcp-003 │ shell-access │ Server uses "bash" — unrestricted shell │
│ 🔵 MEDIUM │ mcp-004 │ http-server │ Unencrypted HTTP transport │
└──────────┴──────────┴─────────────────────┴────────────────────────────────────────────┘
AgentShield found 3 issues (1 critical, 1 high, 1 medium)
Overall Risk Score: 8.2/10
# GitHub Actions
- name: AgentShield Security Scan
run: npx agentshield scan --ci --severity high
# Exits with code 1 if any critical or high issues are found# JSON output for pipeline integration
agentshield scan --format json | jq '.summary.critical'In addition to static rule-based scanning, AgentShield can use Claude to perform a contextual security analysis:
export ANTHROPIC_API_KEY=your-key
agentshield scan --deepThe deep scan:
- Analyzes attack scenarios specific to your server combination
- Identifies chained attack paths (e.g., filesystem + fetch = exfiltration)
- Provides actionable remediation suggestions
- Results are cached by config hash to avoid redundant API calls
AgentShield automatically scans these locations when no path is specified:
~/.claude/claude_desktop_config.json(Claude Desktop)./.mcp.json(project-level)./mcp.json(project-level)./.claude/config.json(project-level)
agentshield initCreates a .mcp.json with security best practices pre-applied: versioned packages, scoped filesystem paths, and commented security guidelines.
- Never hardcode secrets — Use
export KEY=valueor a secrets manager - Pin package versions —
npx @org/pkg@1.2.3notnpx @org/pkg - Scope filesystem paths —
/path/to/projectnot/or~ - Use HTTPS — For any SSE/network transport
- Add allowlists — Declare which tools/resources each server can access
- Avoid shell servers — Use purpose-built MCP servers instead of bash/sh
- Separate concerns — Don't give the same agent both data read and network write access
# Setup
git clone https://github.com/yourusername/agentshield
cd agentshield
pnpm install
# Development
pnpm dev
# Tests
pnpm test
# Add a new rule: see CLAUDE.md for instructionsAll new rules must have:
- Detection logic with no false positives on the
valid-clean.jsonfixture - At least 5 test cases covering positive, negative, and edge cases
- A human-readable fix suggestion with actionable steps
MIT — see LICENSE