Zero-config, fully local static security analyzer for AI agents
Project description
๐ก๏ธ Agent Risk Analyzer (ARA)
Zero-config, fully local static security scanner for AI agents.
ARA detects 20 vulnerability categories across LangChain, CrewAI, AutoGen, and MCP agent projects โ no API keys, no cloud, no LLM required.
$ ara scan ./my-agent
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ Agent Risk Analyzer โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Target: /path/to/my-agent
Files: 3 scanned | Duration: 0.04s | Framework: langchain
Grade Score ๐ด Critical ๐ High ๐ก Medium โช Low Total
F 116 6 9 3 5 23
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Grade F Score: 116 โ Unsafe for production โ critical issues must be โ
โ fixed immediately. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โจ Features
- ๐ Fully local โ no data leaves your machine, no API keys needed
- โก Zero config โ point at a directory, get a graded report
- ๐ฏ 20 vulnerability rules mapped to MITRE ATLAS and OWASP LLM Top 10 2025
- ๐ง AST + regex โ two-tier detection with CONFIRMED / SUSPECTED confidence levels
- ๐ AโF grading โ weighted severity scoring for instant risk posture
- ๐ Multi-format output โ terminal (Rich), JSON, Markdown
- ๐ค CI/CD ready โ
--ciflag returns exit code 1 on findings
๐ฆ Installation
# Clone the repo
git clone https://github.com/Prnvlol/agent-risk-analyzer.git
cd agent-risk-analyzer
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
Requires Python 3.11+
๐ Usage
Basic scan
ara scan ./my-agent-project
JSON report (for CI pipelines)
ara scan ./my-agent --format json --output report.json
Markdown report
ara scan ./my-agent --format markdown --output report.md
CI mode (fail on findings)
ara scan ./my-agent --ci --min-severity HIGH
Filter options
# Only show CONFIRMED findings (hide heuristic checks)
ara scan ./my-agent --no-suspected
# Disable specific rules
ara scan ./my-agent --disable VULN-017,VULN-019
# Set minimum severity threshold
ara scan ./my-agent --min-severity MEDIUM
List all rules
ara list-rules
๐ฏ What ARA Detects
| ID | Vulnerability | Severity | ATLAS | OWASP |
|---|---|---|---|---|
| VULN-001 | Direct Prompt Injection | CRITICAL | AML.T0051.000 | LLM01 |
| VULN-002 | Indirect Prompt Injection | CRITICAL | AML.T0051.001 | LLM01 |
| VULN-003 | Unrestricted Code Execution | CRITICAL | AML.T0050 | LLM06 |
| VULN-005 | Over-Permissioned Tools | HIGH | AML.T0053 | LLM06 |
| VULN-006 | Unbounded Agent Autonomy | HIGH | AML.T0053 | LLM06 |
| VULN-007 | Tool Result Poisoning | HIGH | AML.T0097 | LLM06 |
| VULN-008 | Memory / Context Poisoning | HIGH | AML.T0087 | LLM04 |
| VULN-009 | Insecure MCP Configuration | HIGH | AML.T0088 | LLM03 |
| VULN-010 | System Prompt Leakage | HIGH | AML.T0056.001 | LLM07 |
| VULN-011 | Insecure Tool Input | MEDIUM | AML.T0053 | LLM06 |
| VULN-012 | Sensitive Data in Logs | HIGH | AML.T0048 | LLM02 |
| VULN-013 | Missing Rate Limiting | MEDIUM | AML.T0054 | LLM10 |
| VULN-014 | Hardcoded Credentials | MEDIUM | AML.T0037 | LLM02 |
| VULN-015 | Insecure Multi-Agent Trust | MEDIUM | AML.T0087 | LLM06 |
| VULN-016 | Verbose Error Messages | LOW | AML.T0048 | LLM02 |
| VULN-017 | Missing Output Filtering | LOW | AML.T0048 | LLM05 |
| VULN-018 | Missing Human-in-the-Loop | LOW | AML.T0053 | LLM06 |
| VULN-019 | Unversioned Prompts | LOW | AML.T0088 | LLM07 |
| VULN-020 | Third-Party Plugin Risk | LOW | AML.T0010.003 | LLM03 |
๐ Grading System
Findings are scored by severity weight, then mapped to a letter grade:
| Weight | Severity |
|---|---|
| 10 | CRITICAL |
| 5 | HIGH |
| 2 | MEDIUM |
| 1 | LOW |
| Grade | Score Range | Meaning |
|---|---|---|
| A | 0 | No findings |
| B | 1 โ 5 | Minor issues |
| C | 6 โ 15 | Needs attention |
| D | 16 โ 30 | Significant risk |
| F | 31+ | Unsafe for production |
๐๏ธ Architecture
src/
โโโ cli.py # Typer CLI (scan, list-rules, version)
โโโ scanner.py # File discovery, AST parsing, detector dispatch
โโโ models.py # Pydantic models (Finding, ScanResult, grades)
โโโ report.py # Rich terminal, JSON, Markdown renderers
โโโ detectors/
โโโ base.py # BaseDetector ABC + ScanContext
โโโ credentials.py # VULN-014: hardcoded secrets (15 regex patterns)
โโโ code_execution.py # VULN-003: exec/eval/subprocess (AST)
โโโ prompt_injection.py # VULN-001/002/010/017/019
โโโ tool_permissions.py # VULN-005/007/011/018/020
โโโ mcp_config.py # VULN-009: MCP misconfigurations
โโโ multi_agent.py # VULN-006/008/015
โโโ logging_detector.py # VULN-012/016
โโโ rate_limiting.py # VULN-013
Design principles:
- No LLM dependency โ all detection is deterministic (AST + regex)
- Two-tier confidence โ
CONFIRMED(pattern exists verbatim) vsSUSPECTED(absence-of-safeguard heuristic) - Single-pass scan โ files read once into
ScanContext, shared across all detectors - Fail-safe detectors โ a crashing detector never stops the scan
๐งช Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run with coverage
pytest --cov=src --cov-report=term-missing
# Lint
ruff check src/ tests/
# Type check
mypy src/
๐ Exit Codes
| Code | Meaning |
|---|---|
0 |
Scan completed (no findings, or non-CI mode) |
1 |
Findings detected (CI mode only) |
2 |
Error (bad arguments, scan failure) |
๐บ๏ธ Roadmap
- Framework-specific detectors โ deep checks for LangChain, CrewAI, AutoGen patterns
-
--deepmode โ optional local LLM analysis via Ollama for semantic prompt review - GitHub Actions workflow โ pre-built CI action
- PyPI release โ
pip install agent-risk-analyzer - VS Code extension โ inline findings in the editor
๐ License
Built with ๐ Python โ no clouds, no APIs, no excuses.
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 arascan-0.1.0.tar.gz.
File metadata
- Download URL: arascan-0.1.0.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6d92b3de2fc9915c55e5d76fdab60297cc9779f3a174856e1feb4582457abbb
|
|
| MD5 |
52a35b41f2c3732745e5de5de9961fd7
|
|
| BLAKE2b-256 |
fcf631b4d0258eee384883dfbc03dc55d21431ec9dca94d6d4e3ca566b559ac0
|
File details
Details for the file arascan-0.1.0-py3-none-any.whl.
File metadata
- Download URL: arascan-0.1.0-py3-none-any.whl
- Upload date:
- Size: 37.0 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 |
e197884c3be653c18a85f3afdc9d6be7db5ec9f72c84fcf216d2190ebca12236
|
|
| MD5 |
34f431064d3be2a0b7eaf2c6eab0c219
|
|
| BLAKE2b-256 |
4702fa567ef57cb3a79aadc6514e9f84be1e9e0b7f11a2afdd7ec92c5997d460
|