{"slug": "anthropic-s-open-source-framework-for-ai-powered-vulnerability-discovery", "title": "Anthropic's open-source framework for AI-powered vulnerability discovery", "summary": "Anthropic released an open-source reference implementation for autonomous vulnerability discovery and remediation using its Claude AI model, based on learnings from security team partnerships. The framework provides a configurable pipeline for source code scanning, triage, and patching, and is designed to help organizations build their own vulnerability-finding systems using Claude APIs across platforms including Bedrock, Vertex, or Azure.", "body_md": "A reference implementation for autonomous vulnerability discovery and\nremediation with Claude, based on our learnings from [partnering with security\nteams at several organizations](https://www.anthropic.com/glasswing)\nsince launching Claude Mythos Preview. For a write up of these learnings along with\nbest practices, see the [accompanying blog post](https://claude.com/blog/using-llms-to-secure-source-code)\n(also available in [ blog-post.md](/anthropics/defending-code-reference-harness/blob/main/docs/blog-post.md)). For a lightweight SDK-only\nwalkthrough of the same recon → find → triage → report → patch loop, see the\n\n[companion cookbook](https://platform.claude.com/cookbook/claude-agent-sdk-06-the-vulnerability-detection-agent).\n\nThis repo is not maintained and is not accepting contributions.\n\n🔒\n\nWant a managed option?Anthropic offers[Claude Security], a hosted product that finds and fixes vulnerabilities in your source code across multiple projects. Claude Security scans your repository for vulnerabilities, applies a multi-stage verification pipeline to reduce false positives, and lets you manage findings through their lifecycle: triage, fix validation, and rapid fix generation.This repository is an open-source reference implementation based on general best practices for finding vulnerabilities using Claude. You can use it to build your own vulnerability finding pipeline, customize the logic, and it can be used with whatever access you have to Claude APIs (including Bedrock, Vertex, or Azure).\n\n**Claude Code skills**:`/quickstart`\n\n,`/threat-model`\n\n,`/vuln-scan`\n\n,`/triage`\n\n,`/patch`\n\n,`/customize`\n\n: interactive scoping, scanning, triage, and patching. Open this repo in Claude Code and run`/quickstart`\n\nto get oriented.: the autonomous reference pipeline (recon → find → verify → report → patch), configured for finding C/C++ memory vulnerabilities using Docker and ASAN. This harness is a`harness/`\n\n**reference, not a product**. The general shape, prompts, and sandboxing are reusable, but the harness will not work on every codebase out of the box. Run`/customize`\n\nto port it to your language, detector, or vuln class.\n\n⚠️ Security:`/quickstart`\n\n,`/threat-model`\n\n,`/vuln-scan`\n\n, and`/triage`\n\nonly read and write files. Running`/patch`\n\non static findings (`TRIAGE.json`\n\nor`VULN-FINDINGS.json`\n\n) is likewise read- and write-only.`/customize`\n\nedits the harness code and runs validation commands. Any of these skills are safe to run unsandboxed, as long as you review and approve each tool use in Claude Code. The autonomous reference pipeline (including`/patch`\n\non pipeline results)executes target code, so it refuses to run outside of a gVisor sandbox unless explicitly overridden. To get set up, run`scripts/setup_sandbox.sh`\n\nonce, then invoke the pipeline via`bin/vp-sandboxed`\n\n. See[docs/security.md]and[docs/agent-sandbox.md]for more details.\n\n```\ngit clone https://github.com/anthropics/defending-code-reference-harness\ncd defending-code-reference-harness\nclaude\n\n# 30-sec intro + guided first run on the canary target\n> /quickstart\n\n> /quickstart how do I port the pipeline to Java?\n> /quickstart how do I triage all these bugs?\n```\n\n· The accompanying blog post with learnings + best practices**Blog Post**· How it works: diagram, stages, CLI flags** Pipeline**· Sandboxing, what not to mount** Security**· gVisor isolation + egress allowlist for every agent** Agent sandbox**· Port to my stack; which files change and why** Customize**· Generate and verify fixes for verified crashes** Patching**· Duplicates, rate limits, subagent model pinning** Troubleshooting**· Block for dangerous cyber work** Safeguards**\n\nThe most successful security teams we've partnered with are those that have gotten hands-on the fastest. Though it's tempting to spend months designing the perfect pipeline, we recommend starting small on Day 1 and building from there as learnings come. The steps below follow that pattern and set an ambitious (but reasonable) pace based on what we've seen.\n\n|\n\n**Day 1**[Step 2](#step-2-day-2-run-the-reference-pipeline-on-a-cc-library)** Day 2**[Step 3](#step-3-days-3-5-customize-the-pipeline-for-your-target)** Days 3-5**[Step 4](#step-4-week-2-start-autonomous-scanning-triage-and-patching)** Week 2**Day 1 is focused on seeing the whole loop end-to-end. Using only the interactive skills, you'll build a threat model, run a static scan scoped by it, triage what comes back, and draft candidate fixes. You'll finish the day with a threat model, a ranked list of static findings, and candidate patches.\n\nThe relevant skills **only read and write files** in your repo. As long as you\nrun Claude Code interactively and approve each tool use, no sandbox is needed.\n\n```\n# Pin every subagent to the model you want\nexport CLAUDE_CODE_SUBAGENT_MODEL=<model-id>\nclaude\n\n# 0. intro + guided first run\n> /quickstart\n\n# 1. Build a threat model (aim before you shoot)\n> /threat-model bootstrap targets/canary\n\n# 2. Run a static scan, scoped by that threat model\n> /vuln-scan targets/canary\n\n# 3. Verify, dedupe, and rank what came back\n> /triage targets/canary/VULN-FINDINGS.json\n\n# 4. Generate candidate fixes for the verified findings\n> /patch ./TRIAGE.json --repo targets/canary\n```\n\nThis flow produces `THREAT_MODEL.md`\n\n, `VULN-FINDINGS.{json,md}`\n\n,\n`TRIAGE.{json,md}`\n\n, and `PATCHES/`\n\n.\n\nThe vulnerability candidates produced in Step 1 come from Claude's static\nreview of the source (nothing is built or run), so expect more false positives on\nany non-canary targets. In Step 2, you'll produce *execution-verified* findings.\n\nNote:on the canary target,`/triage`\n\nmay dismiss the scan's findings as false positives.`entry.c`\n\nannounces itself as deliberately vulnerable demo code, and`/triage`\n\ncorrectly excludes bugs in test / fixture code. To see the full confirm / dedupe / false positive flow, run it on the curated fixture instead (`/triage .claude/skills/triage/fixtures/canary-findings.json --repo targets/canary`\n\n) or point the Step 1 skills at your own code.\n\nOn Day 2, you'll move from interactive skills to your first autonomous run using the reference pipeline. You'll run the full recon → find → verify → report loop in your environment on a known-vulnerable open-source library, then generate a candidate patch for what it finds. You'll finish with a set of reproducible crashes, exploitability reports, and candidate patches, along with a feel for how the pipeline works.\n\nRunning the pipeline is simple:\n\n```\n# One-time setup\npython3 -m venv .venv && .venv/bin/pip install -e .\n./scripts/setup_sandbox.sh   # installs gVisor, builds the agent images, and verifies isolation; note: requires Docker\nexport ANTHROPIC_API_KEY=sk-ant-...   # or CLAUDE_CODE_OAUTH_TOKEN; the pipeline requires one in env\n\n# Run the recon → find → verify → report loop\nbin/vp-sandboxed run drlibs --model <model-id> --runs 3 --parallel --stream --auto-focus\n# Generate a candidate patch for each finding\nbin/vp-sandboxed patch results/drlibs/<timestamp>/ --model <model-id>\n\n# Or, ask Claude Code to launch the pipeline and watch the run for you\nclaude\n> run the pipeline on drlibs and explain findings as they come\n```\n\nResults from the loop land in a `results/drlibs/<timestamp>/`\n\ndirectory. With\nthe `--stream`\n\nflag, the first report will appear in minutes under `reports/bug_NN/`\n\n.\n\n⚠️ The pipeline runs each agent inside a gVisor container with egress restricted to the Claude API. Agent-spawning subcommands refuse to start outside it unless explicitly overridden. For more information, see`run`\n\nspawns autonomous agents.[docs/security.md]and[docs/agent-sandbox.md].\n\nUnder the hood, the pipeline walks through seven stages:\n\n**Build**: Compiles the target into a Docker image with ASAN (the memory error detector for C and C++). The pipeline builds this image automatically on first run using the target's`Dockerfile`\n\n.**Recon**: A lightweight agent reads the source inside a network-isolated container and proposes a partition, i.e.,*\"here are N distinct input-parsing subsystems worth attacking separately\"*, so that parallel find agents explore different areas instead of converging on the same bug. Without the`--auto-focus`\n\nflag, the pipeline uses the`focus_areas`\n\nlist from the target's`config.yaml`\n\n.**Find**: N agents run in parallel, each in its own isolated container. Each agent reads the source, crafts malformed inputs, and runs the ASAN binary until a given input produces a crash 3 out of 3 times.**Verify**: A separate grader agent reproduces each crash in a fresh container that the find agent hasn't touched. The only thing that crosses over from the find agent to the grader is the proof of concept it produced.**Dedupe**: A judge agent compares verified crashes against bugs already reported and decides whether each is a new bug, a better example of a known bug, or a duplicate to skip.**Report**: A report agent writes a structured exploitability analysis per unique bug, including details on primitive class, reachability, escalation path, and severity.**Patch**(the separate patch command above): A patch agent writes a proposed fix, and a grader agent confirms that the new code builds, that the original proof of concept input no longer crashes, that the target's test suite still passes, and that a fresh find agent can't find a way around the fix.\n\nFor more details, see [docs/pipeline.md](/anthropics/defending-code-reference-harness/blob/main/docs/pipeline.md).\n\nOn Days 3-5, you'll customize the harness for your own target. First, you'll\npoint the Step 1 skills at your code, then you'll use `/customize`\n\nto port the\npipeline to your stack. By the end of the week, you'll have a `targets/<your-service>/`\n\ndirectory that the pipeline can run against, validated with a single smoke run\nof the pipeline, and ready to scale up in Step 4.\n\nWhile the reference pipeline is designed for finding memory vulnerabilities in C and C++ code, its shape is generic. Porting it to a new vuln class or language just means answering the following questions for your target stack:\n\n| Question | C/C++ Reference | Your target (examples) |\n|---|---|---|\n| What signals a finding? | ASAN crash signature | exception / canary file / DNS callback |\n| What does a proof of concept look like? | crashing input file | HTTP request sequence / tx list / test harness |\n| How is the target built and run? | `Dockerfile` (using clang + ASAN) |\nyour language's build in a container |\n\nBefore customizing, point the Step 1 skills at your own code. As a reminder, they're read- and write-only, so they can run unsandboxed.\n\n```\nclaude\n\n> /quickstart how do I customize this for ~/code/my-service?\n\n> /threat-model bootstrap-then-interview ~/code/my-service\n> /vuln-scan ~/code/my-service\n> /triage ~/code/my-service/VULN-FINDINGS.json --repo ~/code/my-service\n```\n\nThen, use the artifacts produced by those skills in the `/customize`\n\nskill,\nwhich modifies the harness for your codebase.\n\n```\n> /customize use ~/code/my-service/{THREAT_MODEL.md,VULN-FINDINGS.json} and ./TRIAGE.md\n```\n\nWhen `/customize`\n\nis done, you'll have a `targets/my-service/`\n\ndirectory\nset up. Validate it with a smoke run of the pipeline before scaling up.\n\n```\nbin/vp-sandboxed run my-service --model <model-id> --runs 1\n```\n\nFor more details, see [docs/customizing.md](/anthropics/defending-code-reference-harness/blob/main/docs/customizing.md).\n\nIn Week 2, you'll use the pipeline you customized in Step 3 on your own\ntargets, adding an *outer* loop to the inner pipeline loop - run multiple\npipeline scans, triage the findings from across those runs, patch based\non prioritization, and repeat.\n\n```\n# Scan - run a wave of parallel runs against your target\nbin/vp-sandboxed run my-service --model <model-id> --runs 5 --parallel --stream --auto-focus\n\n# Triage - dedupe and rank every finding across all waves using your threat model\n> /triage results/my-service/ --repo ~/code/my-service --auto --votes 5\n\n# Patch - generate and validate fixes, starting with what triage ranked the highest\n> /patch results/my-service/<timestamp>/ --model <model-id>\n```\n\n⚠️ Follow the same sandboxing guidelines as in[Step 2]\n\nA given pipeline run already verifies and deduplicates its own findings.\n`/triage`\n\nworks across many pipeline runs. When pointed at the `results/`\n\ndirectory, it collapses duplicates across all runs (and any static findings\nfrom `/vuln-scan`\n\nif present), recalibrates severity ratings against your\nthreat model, and attempts to route every finding to the component owner.\n\nWhen possible, patching findings quickly helps keep the outer loop as\nproductive as possible. When findings are fixed, the model can't re-find\nthem, and instead will surface net new, typically deeper issues. As you run\nmore pipeline waves, the number of findings will likely go down, but the\ncomplexity will likely also go up. If quick patching isn't possible, even\njust recording prior findings in the target's `known_bugs`\n\ncan help steer\nfuture runs toward newer bugs.\n\nAutonomous triage and patching are still open issues, and this reference\nharness doesn't fully solve them. The verification strategies in `/patch`\n\nhelp raise the bar, but severity and prioritization are ultimately\njudgments about your environment, and verified patches are not always\nupstreamable. Many partners have reported these steps as their current\nbottlenecks, and you should budget real engineering time for them.\n\nFor more details, see [docs/triage.md](/anthropics/defending-code-reference-harness/blob/main/docs/triage.md) and\n[docs/patching.md](/anthropics/defending-code-reference-harness/blob/main/docs/patching.md).\n\nAfter the initial ramp up, the teams we've worked with have tended to invest in a few directions:\n\n- Reviewing all their internal repos and key open-source dependencies, ranking which are the most important to scan (e.g., based on their exposure, history of CVEs, business-criticality), then working through scanning the list in priority order.\n- Setting up bespoke infrastructure for scanning to move scans off of laptops or one-off VMs. The most successful teams resist the urge to build the perfect scanning platform before scaling up.\n- Incorporating scans into their SDLC. Some teams have set up recurring scans (e.g., daily, weekly) or have added scanning into their CI pipelines.\n- Testing and experimenting with the models to find what works best for them.", "url": "https://wpnews.pro/news/anthropic-s-open-source-framework-for-ai-powered-vulnerability-discovery", "canonical_source": "https://github.com/anthropics/defending-code-reference-harness", "published_at": "2026-06-04 20:11:20+00:00", "updated_at": "2026-06-04 20:41:18.868453+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-agents", "ai-safety", "ai-tools"], "entities": ["Anthropic", "Claude", "Claude Mythos Preview", "Claude Security", "Bedrock"], "alternates": {"html": "https://wpnews.pro/news/anthropic-s-open-source-framework-for-ai-powered-vulnerability-discovery", "markdown": "https://wpnews.pro/news/anthropic-s-open-source-framework-for-ai-powered-vulnerability-discovery.md", "text": "https://wpnews.pro/news/anthropic-s-open-source-framework-for-ai-powered-vulnerability-discovery.txt", "jsonld": "https://wpnews.pro/news/anthropic-s-open-source-framework-for-ai-powered-vulnerability-discovery.jsonld"}}