Raptor turns Claude Code into a general-purpose AI Security researchers Gadi Evron, Daniel Cuthbert, Thomas Dullien, Michael Bargury, and John Cartwright released RAPTOR (Recursive Autonomous Penetration Testing and Observation Robot), an open-source framework built on Claude Code v3.1.0 that automates security research by chaining static analysis, binary analysis, LLM-powered vulnerability validation, exploit generation, and patch writing into a single workflow. The tool, available on GitHub under an MIT license, requires Claude Code with an active subscription or Anthropic API key, Python 3.10+, Node.js 18+, and Semgrep, with CodeQL optional but recommended. ╔═══════════════════════════════════════════════════════════════════════════╗ ║ ║ ║ ██████╗ █████╗ ██████╗ ████████╗ ██████╗ ██████╗ ║ ║ ██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗ ║ ║ ██████╔╝███████║██████╔╝ ██║ ██║ ██║██████╔╝ ║ ║ ██╔══██╗██╔══██║██╔═══╝ ██║ ██║ ██║██╔══██╗ ║ ║ ██║ ██║██║ ██║██║ ██║ ╚██████╔╝██║ ██║ ║ ║ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ║ ║ ║ ║ Autonomous Offensive/Defensive Research Framework ║ ║ Based on Claude Code v3.1.0 ║ ║ ║ ║ Gadi Evron, Daniel Cuthbert, Thomas Dullien Halvar Flake ║ ║ Michael Bargury, John Cartwright ║ ║ ║ ╚═══════════════════════════════════════════════════════════════════════════╝ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣤⣤⣀⣀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⠿⠿⠟ ⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⣤⣴⣶⣶⣶⣤⣿⡿⠁⠀⠀⠀ ⣀⠤⠴⠒⠒⠛⠛⠛⠛⠛⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⣿⣿⣿⡟⠻⢿⡀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⢿⣿⠟⠀⠸⣊⡽⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⣿⡁⠀⠀⠀⠉⠁⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⠿⣿⣧⠀ Get them bugs.....⠀⠀⠀⠀⠀ Authors: Gadi Evron, Daniel Cuthbert, Thomas Dullien Halvar Flake , Michael Bargury, John Cartwright @gadievron https://github.com/gadievron , @danielcuthbert https://github.com/danielcuthbert , @thomasdullien https://github.com/thomasdullien , @mbrg https://github.com/mbrg , @grokjc https://github.com/grokjc Licence: MIT, see LICENSE. Note that CodeQL has its own licence and does not permit commercial use. Repository: https://github.com/gadievron/raptor https://github.com/gadievron/raptor RAPTOR is an autonomous security research framework built on top of Claude Code but not tied to it -- you can plug in your own analysis layer too . It chains together static analysis, binary analysis, LLM-powered vulnerability validation, exploit generation, and patch writing into a single workflow you can run against a codebase or binary. It is not polished software. It was built in free time, held together with enthusiasm and duct tape, and it works well enough that we can't stop using it. If you want to make it better, open a PR. RAPTOR stands for Recursive Autonomous Penetration Testing and Observation Robot. We really wanted to call it RAPTOR. RAPTOR is mostly AI-generated code. The humans set direction, review output, and make design decisions; the AI writes the implementation. Mechanical verification tests, static analysis, corpus calibration keeps the quality bar where it needs to be regardless of who — or what — wrote the code. - Claude Code with an active subscription Max, Pro, Team, or Enterprise or an Anthropic API key. This is the orchestration layer -- RAPTOR runs inside a Claude Code session. - Python 3.10+ and Node.js 18+ . - Semgrep pip install semgrep for static analysis. CodeQL is optional but recommended. For the analysis dispatch layer the LLM that analyses individual findings , Claude Code itself handles everything by default -- no extra API keys needed. If you want multi-model analysis e.g. Claude + GPT + Gemini , you will need API keys for each provider. See Using a different LLM using-a-different-llm below. Clone the repo git clone https://github.com/gadievron/raptor.git cd raptor Install Python dependencies pip install -r requirements.txt Install Claude Code if you don't already have it npm install -g @anthropic-ai/claude-code Install Semgrep required for scanning pip install semgrep Add the launcher to your PATH -- put this in your shell profile to make it permanent. Append rather than prepend, so system directories stay ahead of the repo. Alternatively, symlink bin/raptor into a directory already on PATH. export PATH="$PATH:$PWD/bin" Launch RAPTOR raptor The raptor launcher is the recommended way to start a session, and it works from any directory -- it resolves the RAPTOR installation, remembers the directory you launched from so commands like /scan default to it , runs the pre-flight trust and project checks, loads the coverage-tracking plugin, and sanitises the environment before handing off to Claude Code. It also takes an optional target path and flags like --project , --continue , and --model -- see raptor --help . Running plain claude from inside the repo directory also works -- Claude Code picks up RAPTOR's configuration from the checkout -- but you skip everything the launcher does above: no pre-flight checks, no coverage tracking, and commands that default to "the directory you ran this from" can't see it. Important: RAPTOR loads its configuration from the repo directory. If you run claude from any other directory, you get plain Claude Code, not RAPTOR. The raptor launcher avoids this failure mode entirely. Using containers is a common security practice to restrict agents from accessing areas of your filesystem you don't want them to, as well as limiting the blast radius of any malicious code that may execute e.g via supply-chain attack . The image is large around 6 GB . It starts from the Microsoft Python 3.12 devcontainer and adds static analysis, fuzzing, and browser automation tooling. You can pull down a pre-built image: docker pull danielcuthbert/raptor:latest or build it locally using the included Dockerfile : docker build -f .devcontainer/Dockerfile -t raptor:latest . The image expects the RAPTOR framework this repo to be mounted into /workspaces/raptor on startup. You can optionally mount a target folder for local analysis. To start the container: docker run -it \ -v "$ pwd :/workspaces/raptor" \ raptor:latest To mount a target folder as well: docker run -it \ -v "$ pwd :/workspaces/raptor" \ -v "/path/to/target-folder:/workspaces/target" \ raptor:latest Add --privileged if you need the rr deterministic debugger. VS Code devcontainers are also supported. To mount a target folder, add it to the mounts section of .devcontainer/devcontainer.json : "mounts": // ...existing entries... "source=/path/to/target-folder,target=/workspaces/target,type=bind,consistency=cached" Then open the repo in VS Code — it will prompt you to reopen in the container: cd /path/to/raptor code . Either way, once you're inside the container, run raptor to get started. The simplest thing you can do: /scan /path/to/code This runs Semgrep plus Coccinelle when spatch is installed; add --codeql for CodeQL against the target, deduplicates findings, and writes a SARIF report. No LLM analysis, no API keys beyond Claude Code. Takes a few minutes on a typical repository. To add LLM-powered validation: /agentic /path/to/code This runs the full pipeline: scan, deduplicate, then send each finding through the validation stages A-F . On a medium-sized codebase with ~50 findings, expect 10-30 minutes and $2-8 in analysis-layer LLM costs depending on the model . The default cost cap is $10 per run; adjust with --max-cost-usd . Cost note: The Claude Code orchestration layer uses your Claude subscription. The analysis dispatch layer makes separate LLM API calls that are billed per token. If you only use Claude Code as the analysis model the default , there is no extra cost beyond your subscription. If you configure external models OpenAI, Gemini, etc. , those API calls are billed to those providers. RAPTOR runs LLM-generated code and analyses untrusted repositories. Subprocesses that handle untrusted content are sandboxed using Linux namespaces, Landlock, and seccomp. The sandbox blocks network access, restricts filesystem visibility, and limits resource consumption. See docs/sandbox.md for the full threat model and configuration. Environment variables that could inject code into the launcher chain are stripped at startup core/security/ dangerous env strip.sh . File paths from scanned repositories are never interpolated into shell strings — all subprocess calls use list-based arguments. | Command | What it does | Status | |---|---|---| | /agentic | Full autonomous workflow: scan, validate, exploit, patch | Stable | | /scan | Static analysis with Semgrep and CodeQL | Stable | | /understand | Map attack surface, trace data flows, hunt vulnerability variants | Stable | | /binary | Black-box binary investigation, runtime evidence, graph queries and handoff | Beta | | /ghidra | Ghidra RE bridge: attach/import .gpr projects, cross-version diff, findings export | Beta | | /audit | Hypothesis-driven, tool-grounded systematic code review | Beta | | /review | Query audit state: findings, gaps, coverage, operator notes | Stable | | /annotate | Attach free-form per-function prose annotations operator review notes | Stable | | /validate | Multi-stage exploitability validation pipeline Stages 0-F | Stable | | /diagram | Mermaid visual maps from /understand and /validate JSON outputs | Beta | | /codeql | CodeQL-only deep analysis with SMT dataflow pre-screening | Stable | | /analyze | Analyse existing SARIF findings with LLM, without re-scanning | Stable | | /sca | Software composition analysis: dependencies, advisories, supply-chain signals, SBOMs, and fixes | Beta | | /cve-diff | Discover and diff the fix commit for a CVE across OSV, NVD, GitHub, and GitLab | Beta | | /cve-env | Build and verify a Docker environment running a CVE's affected application at its pre-patch version | Experimental | | /exploit | Generate proof-of-concept exploit code | Beta | | /patch | Generate secure patches for confirmed vulnerabilities | Beta | | /fuzz | Binary fuzzing with AFL++ and crash analysis | Stable | | /crash-analysis | Autonomous root-cause analysis for C/C++ crashes | Stable | | /oss-forensics | Evidence-backed forensic investigation for GitHub repositories | Stable | | /project | Named workspaces to organise runs and track findings over time | Stable | | /describe | Describe a target: language mix, build system, tool gaps, cost estimate read-only | Stable | | /threat-model | Create, inspect, and maintain per-project threat models | Stable | | /sage | Persistent memory layer store, recall, link, corroborate | Stable | | /ask | Send a free-form prompt to any configured LLM model | Stable | | /scorecard | Inspect per-model reliability across decision classes | Stable | | /frida | Dynamic instrumentation via Frida | Alpha | | /web | Web application scanning: crawl, ffuf/nuclei integration, oracle-verified injection, blind SSRF callbacks | Beta | Start by creating a project so all your runs land in one place: /project create myapp --target /path/to/code create a project first /project use myapp set it as active /understand --map map the attack surface /agentic --threat-model --validate map, model, scan, validate /project findings review everything in one place For a compiled artefact, the equivalent starting point is: /binary investigate /path/to/binary build the evidence-backed binary map /binary graph