Skip to main content
AgentSec

AgentSec

Static security scanner for AI coding agents and MCP configurations.

PyPI Python License Tests

AI coding agents have access to your shell, filesystem, network, and secrets. Most agent configurations are never audited for security risks. AgentSec inspects MCP server manifests, Claude Desktop configs, Cursor rules, and agent instruction files for dangerous permissions, prompt injection risks, and secret exposure — with no LLM dependencies and no data leaving your machine.

All findings map to OWASP Top 10 for LLM Applications (LLM01–LLM10) and the OWASP Agentic Security Top 10 (AG01–AG10).

Features

  • 41 security rules covering shell execution, filesystem access, network exfiltration, OAuth scopes, prompt injection, container escape, and credential exposure
  • OWASP LLM + Agentic mapping on every finding
  • 4 output formats: terminal, JSON, Markdown, SARIF v2.1.0
  • CI/CD gating with --fail-on (exit code 1 at severity threshold)
  • Baseline comparison for regression tracking
  • Automatic detection of JSON, YAML, TOML, and Markdown configs
  • Zero runtime dependencies beyond the Python standard library

Installation

pip install agentsec-cli

Requires Python 3.10 or later.

Quick Start

# Scan a project
agentsec scan /path/to/project

# Generate SARIF for CI/CD
agentsec scan . --format sarif > results.sarif

# Gate CI on critical findings
agentsec scan . --fail-on critical

# Baseline comparison
agentsec scan . --update-baseline baseline.json
agentsec scan . --baseline baseline.json

# OWASP mapping
agentsec scan . --show-owasp

Example output:

 Scanning /home/user/dev/mcp-project...

[CRITICAL] MCP shell execution
  File: claude_desktop_config.json
  Server: shell-server
  Description: MCP server can execute shell commands
  Recommendation: Require explicit approval or remove shell access.

[CRITICAL] MCP filesystem write access
  File: claude_desktop_config.json
  Server: filesystem
  Description: MCP server has filesystem write access
  Recommendation: Restrict filesystem access to read-only or specific directories.

Total findings: 4 · Critical: 3 · High: 0 · Medium: 1 · Low: 0

Output Formats

  • terminal (default) — human-readable with severity coloring
  • json — machine-parseable JSON array of findings
  • markdown — formatted report suitable for commit comments
  • sarif — SARIF v2.1.0, compatible with GitHub CodeQL

Supported Config Files

AgentSec automatically detects and scans these file types:

  • MCP servers: mcp.json, mcp.yaml, mcp.toml
  • Claude Desktop: claude_desktop_config.json
  • Cursor: .cursorrules, .cursor/rules/*
  • Codex / Cline: codex.toml, .clinerules
  • Agent instructions: AGENTS.md, CLAUDE.md
  • Infrastructure: Dockerfile, package.json

Documentation

Full documentation: https://locface.github.io/AgentSec/docs/

Contributing

See CONTRIBUTING.md for development setup, testing, and pull request workflow.

Security

Report vulnerabilities privately. See SECURITY.md for our disclosure policy.

License

MIT — see LICENSE.

Download files

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

Source Distribution

agentsec_cli-1.0.4.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

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

agentsec_cli-1.0.4-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file agentsec_cli-1.0.4.tar.gz.

File metadata

  • Download URL: agentsec_cli-1.0.4.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentsec_cli-1.0.4.tar.gz
Algorithm Hash digest
SHA256 4dd05b4c221191120601e81fb8f6d3998cd8358c46cffbf327fb5fd5d4658a78
MD5 7bc6a0fd8f5ba600f27f9473a05c6b74
BLAKE2b-256 f06f8b7a89de6d2f8354bedf2d1abcb0c3250222aa5b5885066341573e5f8ab3

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentsec_cli-1.0.4.tar.gz:

Publisher: agentsec.yml on Locface/AgentSec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentsec_cli-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: agentsec_cli-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentsec_cli-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 193cf78e39d43aa58a322e7334ac5158924ae622cfa8159c900ae6594662df62
MD5 962d09fddedb11b1fed1467e1a311d93
BLAKE2b-256 acccb6a075300fa7da8a511f5d203b44816020bc4e5b28a7832eea7bc4bb7992

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentsec_cli-1.0.4-py3-none-any.whl:

Publisher: agentsec.yml on Locface/AgentSec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 files

1.0.3

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

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