Catalog PyPI
PACKAGE EXPLORERView in registry

agent-security-scanner

PyPI

Security auditing tool for LLM agents, RAG pipelines, and agent frameworks

agentaiauditllmmitreowasppentestprompt-injectionragsecurity
Versions collected1
Direct dependencies9From release 0.1.0
Last observed20 Oct, 23:19 UTC

README

Version 0.1.0 documentation

Agent Security Scanner

v0.1 — Security auditing tool for LLM agents, RAG pipelines, and agent frameworks.

License: MIT Python 3.10+ Security Research


Overview

Agent Security Scanner is an open-source security research tool designed to audit AI agents, LLM-powered applications, and RAG (Retrieval-Augmented Generation) pipelines for security misconfigurations and vulnerabilities.

This tool helps security teams, developers, and researchers identify potential security risks in AI systems before they reach production.


Features

  • Security Misconfiguration Scanning

    • Missing authentication/authorization controls
    • CORS misconfigurations
    • Missing rate limiting
    • Information disclosure in error responses
    • Exposed debug endpoints
  • Prompt Injection Detection

    • Direct prompt injection
    • System prompt leakage
    • Obfuscation/homoglyph bypass
    • Instruction hijacking via context manipulation
  • Tool Calling Boundary Validation

    • Overly permissive tool access
    • Dangerous tool combinations (e.g. read_file + http_request)
    • Sandbox misconfiguration
    • Missing allow/deny lists
  • RAG Pipeline Security

    • Document poisoning detection
    • Data exfiltration risk analysis
    • Vector database security checks
    • Context window attack surface
    • Embedding model vulnerabilities
  • Comprehensive Reporting

    • JSON structured reports with OWASP/MITRE framework mappings
    • Markdown human-readable summaries with remediation guidance
    • Severity-based risk scoring

Installation

git clone https://github.com/Cybathreat/agent-security-scanner.git
cd agent-security-scanner

python -m venv venv
source venv/bin/activate  # Linux/macOS
# or: venv\Scripts\activate  # Windows

pip install -r requirements.txt

Quick Start

# Run a full scan (all modules)
python -m src.cli scan --target https://api.example.com/agent --output output/

# Run specific modules only
python -m src.cli scan --target https://api.example.com/agent --modules prompt_injection,rag_security

# JSON report only
python -m src.cli scan --target https://api.example.com/agent --format json --output output/

# Markdown report only
python -m src.cli scan --target https://api.example.com/agent --format markdown --output output/

Usage

Scan Command

python -m src.cli scan --target <url> [options]

Options:
  --target,  -t   Target URL or API endpoint (required)
  --modules, -m   Comma-separated modules to run (default: all)
                  Choices: misconfigurations, prompt_injection, tool_boundaries, rag_security
  --output,  -o   Output directory for reports (default: output)
  --format,  -f   Report format: json | markdown | both (default: both)
  --config,  -c   Path to YAML config file
  --timeout       Request timeout in seconds (default: 30)
  --verbose, -v   Enable verbose output (includes evidence in reports)
  --log-level     DEBUG | INFO | WARNING | ERROR (default: INFO)
  --dry-run       Load config and modules without executing scan

Configuration

Generate a default config file:

python -m src.cli config --generate

Or create config/config.yaml manually:

scanner:
  timeout: 30
  max_retries: 3
  rate_limit: 10.0   # requests per second
  verify_ssl: true

modules:
  prompt_injection:
    enabled: true
    sensitivity: high
    detect_obfuscation: true

  rag_security:
    enabled: true
    check_poisoning: true
    check_exfiltration: true
    vector_db_scan: true

  tool_boundaries:
    enabled: true
    check_permissions: true
    audit_sandbox: true

  misconfigurations:
    enabled: true
    check_auth: true
    check_cors: true
    check_rate_limiting: true
    check_info_disclosure: true

output:
  format: both
  output_dir: output
  verbose: false

logging:
  level: INFO

Environment Variable Overrides

Configuration can be overridden via environment variables using the ASS_ prefix:

export ASS_SCANNER_TIMEOUT=60
export ASS_SCANNER_VERIFY_SSL=false
export ASS_LOG_LEVEL=DEBUG
export ASS_OUTPUT_FORMAT=json

Architecture

src/
├── core/
│   ├── engine.py        # Scan orchestration — module selection and lifecycle
│   ├── config.py        # YAML + environment variable configuration loader
│   └── logging.py       # Structured logging via loguru
├── modules/
│   ├── base.py          # BaseModule ABC, Finding, ScanResult, Severity
│   ├── misconfigurations.py
│   ├── prompt_injection.py
│   ├── tool_boundaries.py
│   └── rag_security.py
├── output/
│   ├── json_report.py   # Structured JSON reports
│   └── markdown_report.py  # Human-readable Markdown reports
└── cli.py               # Command-line interface

ScanEngine

The ScanEngine class in src/core/engine.py can be used programmatically:

from src.core.config import load_config
from src.core.engine import ScanEngine

config = load_config("config/config.yaml")
engine = ScanEngine(config)

results = engine.run(
    target="https://api.example.com/agent",
    modules=["prompt_injection", "misconfigurations"],
    timeout=30,
)

Output Examples

JSON Report

{
  "$schema": "https://github.com/Cybathreat/agent-security-scanner/schema/report/v1",
  "report_id": "uuid",
  "generated_at": "2026-03-23T10:00:00Z",
  "scanner": { "name": "Agent Security Scanner", "version": "0.1.0" },
  "target": "https://api.example.com/agent",
  "summary": {
    "total": 5,
    "critical": 1,
    "high": 2,
    "medium": 1,
    "low": 1,
    "risk_score": 42
  },
  "findings": [
    {
      "id": "FIND-promptinjection-a1b2c3d4",
      "severity": "HIGH",
      "category": "promptinjection",
      "title": "Direct Prompt Injection Vulnerability",
      "description": "...",
      "cwe": "CWE-94",
      "owasp_ref": "OWASP LLM01:2024 - Prompt Injection",
      "mitre_ref": "MITRE ATLAS - TA0045 LLM Attack",
      "recommendation": "..."
    }
  ],
  "frameworks": {
    "owasp_llm_top_10": { "OWASP LLM01:2024 - Prompt Injection": ["FIND-..."] },
    "mitre_atlas": { "MITRE ATLAS - TA0045 LLM Attack": ["FIND-..."] }
  }
}

Markdown Report

Reports include an executive summary, findings overview table, detailed findings with remediation guidance, and a module status summary. Pass --verbose to include raw evidence per finding.


Security Frameworks Referenced

  • OWASP LLM Top 10 — Large Language Model security risks
  • MITRE ATLAS — Adversarial Threat Landscape for AI Systems
  • ANSSI Generative AI Referential — French cybersecurity agency guidelines

Development

Running Tests

# Run all tests with coverage
pytest tests/ -v --cov=src --cov-report=html

# Unit tests only
pytest tests/unit/ -v

# Integration tests only
pytest tests/integration/ -v

Adding New Modules

  1. Create a new class in src/modules/ inheriting from BaseModule
  2. Implement the scan(target, **kwargs) -> ScanResult method
  3. Register it in src/core/engine.py — add to ALL_MODULES and _build_module()
  4. Add the config dataclass in src/core/config.py
  5. Add unit and integration tests

Disclaimer

This tool is for security research and educational purposes. Use responsibly and only against systems you are authorised to test. See DISCLAIMER.md for complete legal disclaimers.


License

MIT License — see LICENSE for details.


Author

Ahmed Chiboub (Cybathreat)


Contributing

Contributions welcome! Please read our contributing guidelines and submit PRs.

Downloads & popularity

3downloads
1-day window · source-reported counts20 Oct 2026
73.50
2026-07-23: 4 · observed 2026-10-21T15:58:26.3012863Z · period 2026-07-23–2026-07-232026-07-24: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-07-24–2026-07-242026-07-26: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-07-26–2026-07-262026-07-27: 4 · observed 2026-10-21T15:58:26.3012863Z · period 2026-07-27–2026-07-272026-08-02: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-02–2026-08-022026-08-04: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-04–2026-08-042026-08-09: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-09–2026-08-092026-08-14: 4 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-14–2026-08-142026-08-15: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-15–2026-08-152026-08-17: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-17–2026-08-172026-08-18: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-18–2026-08-182026-08-21: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-21–2026-08-212026-08-23: 3 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-23–2026-08-232026-08-24: 5 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-24–2026-08-242026-08-25: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-25–2026-08-252026-08-26: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-26–2026-08-262026-08-28: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-28–2026-08-282026-08-29: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-29–2026-08-292026-08-31: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-08-31–2026-08-312026-09-01: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-01–2026-09-012026-09-07: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-07–2026-09-072026-09-10: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-10–2026-09-102026-09-14: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-14–2026-09-142026-09-16: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-16–2026-09-162026-09-17: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-17–2026-09-172026-09-19: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-19–2026-09-192026-09-20: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-20–2026-09-202026-09-21: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-21–2026-09-212026-09-22: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-22–2026-09-222026-09-23: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-23–2026-09-232026-09-26: 3 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-26–2026-09-262026-09-27: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-27–2026-09-272026-09-30: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-09-30–2026-09-302026-10-02: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-02–2026-10-022026-10-04: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-04–2026-10-042026-10-06: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-06–2026-10-062026-10-09: 3 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-09–2026-10-092026-10-11: 3 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-11–2026-10-112026-10-12: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-12–2026-10-122026-10-13: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-13–2026-10-132026-10-14: 2 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-14–2026-10-142026-10-15: 4 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-15–2026-10-152026-10-16: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-16–2026-10-162026-10-17: 7 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-17–2026-10-172026-10-18: 5 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-18–2026-10-182026-10-19: 1 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-19–2026-10-192026-10-20: 3 · observed 2026-10-21T15:58:26.3012863Z · period 2026-10-20–2026-10-20
23 Jul20 Oct

pypistats · 47 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-20 – 2026-10-2032026-10-21T15:58:26.3012863Z
2026-10-19 – 2026-10-1912026-10-21T15:58:26.3012863Z
2026-10-18 – 2026-10-1852026-10-21T15:58:26.3012863Z
2026-10-17 – 2026-10-1772026-10-21T15:58:26.3012863Z
2026-10-16 – 2026-10-1612026-10-21T15:58:26.3012863Z
2026-10-15 – 2026-10-1542026-10-21T15:58:26.3012863Z
2026-10-14 – 2026-10-1422026-10-21T15:58:26.3012863Z
2026-10-13 – 2026-10-1312026-10-21T15:58:26.3012863Z
2026-10-12 – 2026-10-1222026-10-21T15:58:26.3012863Z
2026-10-11 – 2026-10-1132026-10-21T15:58:26.3012863Z
2026-10-09 – 2026-10-0932026-10-21T15:58:26.3012863Z
2026-10-06 – 2026-10-0612026-10-21T15:58:26.3012863Z
2026-10-04 – 2026-10-0422026-10-21T15:58:26.3012863Z
2026-10-02 – 2026-10-0212026-10-21T15:58:26.3012863Z
2026-09-30 – 2026-09-3012026-10-21T15:58:26.3012863Z
2026-09-27 – 2026-09-2712026-10-21T15:58:26.3012863Z
2026-09-26 – 2026-09-2632026-10-21T15:58:26.3012863Z
2026-09-23 – 2026-09-2312026-10-21T15:58:26.3012863Z
2026-09-22 – 2026-09-2212026-10-21T15:58:26.3012863Z
2026-09-21 – 2026-09-2122026-10-21T15:58:26.3012863Z
2026-09-20 – 2026-09-2012026-10-21T15:58:26.3012863Z
2026-09-19 – 2026-09-1922026-10-21T15:58:26.3012863Z
2026-09-17 – 2026-09-1712026-10-21T15:58:26.3012863Z
2026-09-16 – 2026-09-1622026-10-21T15:58:26.3012863Z
2026-09-14 – 2026-09-1422026-10-21T15:58:26.3012863Z
2026-09-10 – 2026-09-1012026-10-21T15:58:26.3012863Z
2026-09-07 – 2026-09-0712026-10-21T15:58:26.3012863Z
2026-09-01 – 2026-09-0112026-10-21T15:58:26.3012863Z
2026-08-31 – 2026-08-3112026-10-21T15:58:26.3012863Z
2026-08-29 – 2026-08-2912026-10-21T15:58:26.3012863Z
2026-08-28 – 2026-08-2812026-10-21T15:58:26.3012863Z
2026-08-26 – 2026-08-2612026-10-21T15:58:26.3012863Z
2026-08-25 – 2026-08-2512026-10-21T15:58:26.3012863Z
2026-08-24 – 2026-08-2452026-10-21T15:58:26.3012863Z
2026-08-23 – 2026-08-2332026-10-21T15:58:26.3012863Z
2026-08-21 – 2026-08-2122026-10-21T15:58:26.3012863Z
2026-08-18 – 2026-08-1812026-10-21T15:58:26.3012863Z
2026-08-17 – 2026-08-1722026-10-21T15:58:26.3012863Z
2026-08-15 – 2026-08-1522026-10-21T15:58:26.3012863Z
2026-08-14 – 2026-08-1442026-10-21T15:58:26.3012863Z
2026-08-09 – 2026-08-0922026-10-21T15:58:26.3012863Z
2026-08-04 – 2026-08-0422026-10-21T15:58:26.3012863Z
2026-08-02 – 2026-08-0212026-10-21T15:58:26.3012863Z
2026-07-27 – 2026-07-2742026-10-21T15:58:26.3012863Z
2026-07-26 – 2026-07-2622026-10-21T15:58:26.3012863Z
2026-07-24 – 2026-07-2412026-10-21T15:58:26.3012863Z
2026-07-23 – 2026-07-2342026-10-21T15:58:26.3012863Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.023 Mar 20269

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
cybathreat/agent-security-scanner

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:19 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:2ad064ce0f32da2da578e65e1e751778d8a2c642c5d997e86c4b33a04761fc9f