Code Scanner

ai-blackteam includes a static analysis scanner that finds LLM-specific security vulnerabilities in Python and JavaScript/TypeScript code. It catches the things traditional linters miss — prompt injection vectors, secrets in prompts, unsafe output handling, and excessive agency.

Quick Start

What It Detects

The scanner ships with 11 rule categories, each mapped to OWASP LLM Top 10:

Output Formats

Table (default)

Prints a Rich-formatted table with file path, line number, rule ID, severity, and message.

JSON

Returns an array of finding objects:

CI Integration

The scanner returns exit code 1 if critical findings are detected, exit code 0 otherwise. Use it as a pre-merge check:

File Types

The scanner reads .py, .js, .ts, .tsx, and .jsx files. It skips binary files, node_modules, and hidden directories automatically.

Programmatic Usage