Skip to main content
The Python CLI provides direct command-line access to RAPTOR for scripting, automation, and CI/CD pipeline integration. All functionality available in Claude Code is also accessible via the command line.
Using Claude Code? See the Claude Code Usage Guide for interactive workflows.

Quick Reference

Installation

Prerequisites

1

Python 3.9+

Ensure Python 3.9 or higher is installed:
2

Install Dependencies

Install required Python packages:
3

Set API Keys

Configure LLM provider (required for autonomous analysis):

Optional Tools

For full functionality, install these optional tools:
Usually pre-installed on most systems:

Available Modes

RAPTOR provides six operational modes:

1. scan - Static Analysis

Runs Semgrep for fast, pattern-based vulnerability detection:
Use Cases:
  • Quick security scans in development
  • CI/CD pipeline integration
  • Pre-commit hooks
  • Finding low-hanging fruit
Arguments: Example:

2. agentic - Full Autonomous Workflow

Comprehensive security testing with Semgrep, CodeQL, LLM analysis, exploit generation, and patch creation:
Use Cases:
  • Complete security assessments
  • Vulnerability research
  • Security audits
  • Automated penetration testing
Arguments: Example:

3. codeql - Deep Dataflow Analysis

CodeQL-only analysis for complex dataflow vulnerabilities:
Use Cases:
  • Finding complex dataflow vulnerabilities
  • SQL injection with sanitizers
  • Path traversal with validation
  • Taint analysis
Arguments: Supported Languages:
  • Java, JavaScript, TypeScript, Python, C/C++, C#, Go, Ruby
Example:

4. fuzz - Binary Fuzzing

AFL++ fuzzing with crash analysis and exploit generation:
Use Cases:
  • Finding memory corruption vulnerabilities
  • Buffer overflows, use-after-free
  • Crash analysis
  • Binary security testing
Arguments: Example:

5. web - Web Application Testing

OWASP Top 10 testing for web applications:
The /web mode is currently in alpha and should not be relied upon for production security testing. It’s a stub implementation.
Arguments:

6. analyze - LLM Analysis Only

Analyze existing SARIF files without running scans:
Use Cases:
  • Analyzing results from other tools
  • Re-analyzing previous scans
  • Integrating with existing security pipelines
  • Custom SARIF processing
Arguments: Example:

Output Structure

All results are saved to the out/ directory:

File Descriptions

Standard SARIF 2.1.0 format containing:
  • Vulnerability locations (file, line, column)
  • Severity ratings
  • Rule metadata and descriptions
  • Dataflow paths (for CodeQL findings)
Compatible with GitHub Code Scanning, Azure DevOps, and other SARIF consumers.
Scan statistics including:
  • Total findings by severity
  • Scan duration
  • Files scanned
  • Languages detected
  • Tool versions
LLM analysis results:
  • Exploitability assessments
  • False positive detection
  • Attack scenarios
  • CVSS scores
  • Prioritization recommendations
Generated proof-of-concept code:
  • Python, C, C++, JavaScript, or language-appropriate
  • Fully compilable and executable
  • Includes usage instructions
  • Safe for authorized testing only
Secure fixes in unified diff format:
  • Production-ready code changes
  • Includes explanatory comments
  • Testing recommendations
  • OWASP/CWE references

Policy Groups

Semgrep policy groups define which rules to run: Usage:
Custom policy groups can be added in packages/static-analysis/scanner.py.

Environment Variables

Configure RAPTOR behavior via environment variables:

LLM Provider Configuration

RAPTOR automatically falls back: Claude → GPT-4 → Ollama if a provider fails.

Path Configuration

Debugging

CI/CD Integration

Integrate RAPTOR into your continuous integration pipelines:

GitHub Actions

GitLab CI

Jenkins Pipeline

Fast Mode for Pipelines

Use --mode fast to optimize for CI/CD:
Fast mode differences:
  • Fewer findings processed (default 5 vs 10)
  • Skips exploit generation (faster, less LLM usage)
  • Focuses on high-severity issues only
  • Optimized for quick feedback

Exit Codes

Scripting Examples

Batch Processing Multiple Repositories

Scheduled Security Scans

Compare Before/After Patches

Parse and Filter Results

Advanced Usage

Custom Build Commands

For compiled languages, specify build commands:

Focus on Specific Vulnerability Types

Binary Mitigation Analysis

Troubleshooting

Command Not Found

Permission Denied

Module Import Errors

Semgrep Not Found

CodeQL Not Found

Next Steps

Claude Code Usage

Learn interactive security testing with Claude Code

Extending RAPTOR

Add custom security scanners and capabilities

Configuration

Configure RAPTOR for your environment

API Reference

Python API documentation