Skip to main content

Security scanner for AI agents and MCP servers — finds exfiltration paths, unauthenticated tool exposure, code execution risks, and misconfigured agents

Project description

agentsentinel-cli

One-command security scanner for AI agents and MCP servers. No server, no Docker, no setup.

pip install agentsentinel-cli
sentinel scan my_agent.py
sentinel mcp scan http://localhost:3000

Install

pip install agentsentinel-cli

# With MCP server scanning (HTTP transport):
pip install "agentsentinel-cli[mcp]"

# With agent discovery (process + network scanning):
pip install "agentsentinel-cli[discover]"

# Everything:
pip install "agentsentinel-cli[all]"

Commands

sentinel scan — audit an agent file

Detects exfiltration paths, dangerous grants, hardcoded credentials, and more from static analysis of Python agent files.

# Scan a single file
sentinel scan my_agent.py

# Scan a directory recursively
sentinel scan ./agents/

# Fail with exit code 1 if CRITICAL findings exist (for CI)
sentinel scan my_agent.py --fail-on CRITICAL

# Output JSON (for piping into other tools)
sentinel scan my_agent.py --format json

# Include live behavior data from a running AgentSentinel instance
sentinel scan my_agent.py --connect http://localhost:9000

What it detects:

Rule Severity Description
EXFILTRATION_PATH CRITICAL Agent holds internal-read AND external-write grants
CODE_EXECUTION_GRANT CRITICAL Agent holds bash/exec/shell grants
HARDCODED_CREDENTIALS CRITICAL API keys or secrets hardcoded in source
SECRETS_ACCESS_GRANT HIGH Agent holds runtime access to vaults or tokens
PROMPT_INJECTION_VECTOR HIGH Agent reads from web AND holds write grants
LATERAL_MOVEMENT_PATH HIGH Admin/IAM grants combined with infrastructure grants
UNBOUNDED_FILE_ACCESS HIGH Filesystem write grants with no scoped description
PRIVILEGE_EXCESS HIGH Write grants on a read-only described agent
DANGEROUS_GRANTS HIGH Agent holds dangerous tool grants
TOOL_SPRAWL MEDIUM Too many tools across too many categories
UNDESCRIBED_WRITE_AGENT MEDIUM Write grants with no agent description
MISSING_RATE_LIMIT LOW Dangerous grants without rate limit configuration

sentinel mcp scan — audit an MCP server

Connects to any MCP server, enumerates all exposed tools, and checks for authentication gaps, exfiltration paths, code execution exposure, and input validation weaknesses.

# Scan an HTTP MCP server
sentinel mcp scan http://localhost:3000

# Scan with authentication
sentinel mcp scan http://localhost:3000 --auth-header "Authorization: Bearer token"

# Scan a stdio-transport server (launch as subprocess)
sentinel mcp scan --stdio "python my_mcp_server.py"

# JSON output for CI pipelines
sentinel mcp scan http://localhost:3000 --format json

# Fail CI on CRITICAL findings
sentinel mcp scan http://localhost:3000 --fail-on CRITICAL

What it detects:

Rule Severity Description
NO_AUTH CRITICAL Server accepts tool enumeration with no credentials (HTTP)
UNAUTH_DANGEROUS_EXEC CRITICAL Dangerous tools callable without authentication (HTTP)
EXFILTRATION_PATH CRITICAL Server exposes internal-read AND external-write tools
CODE_EXECUTION_TOOL CRITICAL Server exposes code execution tools
UNBOUNDED_INPUT HIGH Tools accept unconstrained string inputs — injection surface
TOOL_SPRAWL MEDIUM Excessive tool count or category breadth
VAGUE_TOOL_DESCRIPTIONS MEDIUM Short/missing descriptions expand injection surface
MISSING_RATE_LIMIT LOW Dangerous tools present with no visible rate limiting

See docs/mcp-scan-testing.md for test server examples that trigger every finding.


sentinel discover — find AI agents in your environment

sentinel discover                        # scan processes + network
sentinel discover --docker               # include Docker containers
sentinel discover --path ./agents        # scan a source directory
sentinel discover --subnet 10.0.0.0/24   # scan an internal subnet
sentinel discover --format json          # machine-readable output

CI/CD integration

# .github/workflows/security.yml
- name: Scan AI agents
  run: |
    pip install agentsentinel-cli
    sentinel scan ./agents/ --fail-on CRITICAL

- name: Scan MCP server
  run: |
    pip install "agentsentinel-cli[mcp]"
    sentinel mcp scan http://localhost:3000 --fail-on CRITICAL

Tool detection (sentinel scan)

The scanner detects tools defined via:

  • @tool decorator (LangChain)
  • @SentinelTool decorator (AgentSentinel middleware)
  • BaseTool / StructuredTool subclasses
  • Tool(name=...) and StructuredTool(name=...) instantiations

Requirements

  • Python 3.10+
  • No running server required for static scan or stdio MCP scan
  • httpx required for HTTP MCP scanning: pip install "agentsentinel-cli[mcp]"
  • psutil + httpx required for sentinel discover: pip install "agentsentinel-cli[discover]"

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

agentsentinel_cli-0.3.0.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

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

agentsentinel_cli-0.3.0-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file agentsentinel_cli-0.3.0.tar.gz.

File metadata

  • Download URL: agentsentinel_cli-0.3.0.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for agentsentinel_cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c0a0c3885a8e5aabaf77ee94cca2c2df6fbd54971e316d16f57c387826ca0ee8
MD5 bc1985d04dbbf0abff21c18434aa64a5
BLAKE2b-256 4c78b3f8aa04fed6ec0fafcf8f2f89b606f848f4c89f22fb511bd10f6ea4bc9a

See more details on using hashes here.

File details

Details for the file agentsentinel_cli-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentsentinel_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb18dd655b2406594c738287f6bf03ad7768f18b872f631ca9b53a6058e7481f
MD5 74b0dc17238552259e95df2927768b99
BLAKE2b-256 839fc49736c692792080a48ab783853ef015f303645d5045fdb9c89e9a3c9aa9

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