Using LLMs to Secure Source Code: Eugene Yan's Six-Step Pipeline From Anthropic

AI Engineer 2026: Anthropic Talks
21 parts- 1Claude for Long-Horizon Tasks: Lance Martin's Four Rules for Agents That Run for Hours
- 2Inside the Claude Managed Agents Workshop: Pets, Cattle, Outcomes and Dreaming
- 3How Anthropic Builds: Mike Krieger on Being Unreasonable With Claude
- 4How Jarred Sumner Ships Millions of Lines of Agent-Written Code
- 5A Field Guide to Fable: Thariq Shihipar on Unhobbling Claude and Finding Your Unknowns
- 6Claude Tag Lands 65% of Anthropic's Product PRs: Takeaways From Cat Wu and Thariq Shihipar
- 71,000 Claude Agents, Git and a Database: How Fable 5.2 Formalized Fermat Without a Custom Harness
- 8Your Old Prompts Are Making Claude Worse: Lance Martin's Checklist for Frontier Models
- 9Why One Agent Isn't Enough: Anthropic on Flows, UltraCode and Running 1,000 Agents
- 10Tokens Should Have Jobs: Anthropic's Case for Advisors, Graders and Dreamers
- 11Give the Agent a Budget, Not a Token: Anthropic's CI Team on Safe Agent Permissions
- 12Rethinking Claude Code Best Practices: Lydia Hallie on Getting Out of the Loop Safely
- 13How Anthropic Merges 30,000 Code Changes a Day: Addy Osmani on Verifying the Software Factory
- 14Using LLMs to Secure Source Code: Eugene Yan's Six-Step Pipeline From AnthropicCurrent
- 15From Messages API to Managed Agents: Anthropic's Applied AI Team on Harnesses That Go Stale
- 16Forward Deployed Engineering 101: When Your AI Startup Needs FDEs, From Palantir to Anthropic
- 17The Enterprise Tech Stack for AI Agents: Why Your POC Stalls and How to Design Past It
- 18The Claude Certified Architect Exam as a Field Guide to Agentic Engineering
- 19The Future of MCP: David Soria Parra on Connectivity, Progressive Discovery and Skills Over MCP
- 20Gateways Are All You Need: How Anthropic Thinks About MCP in the Enterprise
- 21How to Build Agents That Run for Hours: Anthropic's Planner, Generator and Evaluator Harness
TL;DR
Eugene Yan of Anthropic on finding and fixing vulnerabilities with Claude: why discovery is no longer the bottleneck, and the threat model, sandbox, verify, triage and patch loop.
Eugene Yan, a member of technical staff at Anthropic, has spent months working with security teams and Claude to find and fix vulnerabilities. Their AI Engineer World's Fair 2026 talk distills what dozens of organizations converged on into a six-step pipeline, and makes one argument loudly: finding vulnerabilities is no longer the hard part. Verifying, triaging and patching them is.
The talk pairs with a written guide they co-authored, Using LLMs to secure source code, and an open-source reference harness.
Source: Using LLMs to Secure Source Code, Eugene Yan, Anthropic, AI Engineer World's Fair 2026.
Three Trends#
Capability is jumping, not creeping. The UK AI Security Institute tracks a cybersecurity version of task-horizon benchmarks: how long a cyber task (reverse engineering, web exploitation) a model can complete, against human baselines. Recent models sit above the previous trend line, a step change. AISI's analysis is here.
Vulnerability discovery has exploded. Mozilla's monthly Firefox security bug fixes averaged around 20 in 2025, roughly tripled in February and March 2026, then hit about 400 in April. Mozilla attributed about two-thirds of April's fixes, roughly 271, to work with Claude Mythos Preview. Mozilla's write-up: Behind the scenes hardening Firefox.
The bottleneck has moved. In Anthropic's own scan of more than a thousand open source repositories, about 23,000 candidate findings yielded about 6,200 rated high or critical; at the time of the update, about 1,600 had been reported to maintainers and about 100 patched upstream (Project Glasswing update). Finding is straightforward. Everything after finding is the queue.
Mozilla's observation captures why: early experiments had too many false positives to scale, but agentic harnesses that reliably detect issues and dismiss non-reproducible speculation changed that. The harness and the model together do the work.
The Six Steps#
Yan says most teams converge on the same pipeline. Two steps are one-time setup per codebase; four are a loop.
%% title: The security pipeline most teams converge on
flowchart TD
T[1. Threat model: context] --> S[2. Sandbox: isolation]
S --> D[3. Discovery]:::emphasis
D --> V[4. Verification]
V --> R[5. Triage]
R --> P[6. Patch and re-attack]
P --> DTheir running example is a tiny "order service": pass an ID, get an order back.
1. Threat model: give the model the system, not just the code#
Teams found that a well-documented threat model pushes the true positive rate to about 90%; Yan considers anything above 75% good. One CISO's phrasing: the model has great context of the code but poor context of the system.
The missing context is in people's heads: why the system was designed this way, what on-call keeps fixing, which controls compensate elsewhere. To build the threat model:
- Bootstrap it by giving the model docs, code, past comments and past patches with the CVEs they fixed, and asking what similar issues remain unpatched.
- Interview the experts, with the model asking: what could happen that we did not plan for, and what do we not need to worry about because the app is VPN-only or there is a compensating control?
For the order service, the threat model names the key asset (customer PII), the entry point (the orders API), and candidate threats like SQL injection and unauthenticated access.
2. Sandbox: isolation and reproducibility#
You may be running untrusted code and deliberately detonating proof-of-concept exploits, so run in a VM with no egress and no cloud credentials. You also want every agent starting from the same baseline container, so a "bug" is not just an old dependency. One team called live testbeds where the model can detonate PoCs their biggest lever. For the order service: three containers (app, Postgres, Redis) with the security agent outside, probing over HTTP.
3. Discovery#
Three things matter:
- Context engineering. Everything written down and shared improves coverage and cuts false positives.
- Simpler prompts. Yan finds they cut prompt size by roughly half with each step-change model. Instead of listing vulnerability classes, something like "look for where untrusted data hits the trust boundary" is enough.
- Tools. Give the model what a human security engineer has: call the API, read responses, read logs, read source. One pen-testing team that did this got a true positive rate near 100%, because the model could verify in the loop.
In the example, the discovery agent flags a five-line GET handler that builds SQL with string interpolation.
4. Verification#
Confirm each finding is real, ideally by running the PoC against the sandbox and checking the actual effect, rather than trusting the model's description.
5. Triage#
You cannot hand a developer a hundred findings. Deduplicate (cheap heuristics or model-assisted clustering), then score impact and likelihood. This is where the threat model earns its keep again. A firewall can drop a high to a low; knowing a database holds healthcare data can lift a medium to a high. In the example, the agent rates the SQL injection high; a human downgrades likelihood because an application firewall blocks SQL injection and the service is internal-only. The model could only know that from documentation.
6. Patch, then attack the patch#
A ladder for validating patches:
- The original PoC stops working.
- The existing test suite stays green.
- A fresh discovery agent attacks the patched code to check the fix is comprehensive.
- A human confirms before merge.
Feeding that feedback to the patching agent greatly improves patch quality. And close the loop: the second half of the patch updates the threat model with the compensating controls, so the next scan does not re-raise the same issue. Yan's framing: loops are operating expense until you close them; then they become capital expense that improves with every run.
Their summary: steps 1 and 2 are context and reproducibility. Steps 3 through 6, if you squint, are an ML pipeline: recall, precision, ranking and closing the loop.
The Non-Technical Bottlenecks#
Compute scales with money; human attention does not. When findings grow by one or two orders of magnitude, organizations hit:
- Routing. A dozen findings a month can be hand-curated; hundreds cannot. Send them to code or service owners automatically; this does not need an LLM.
- Severity calibration. Product and security engineers often disagree on what "high" means. Get everyone in a room, write it down once, and hand that to the agents.
- Patching bandwidth. Implementing patches by hand does not scale. Move to AI-generated patches with human verification, generate then re-attack.
Fully automated patch review for security fixes is still rare.
How to Start This Week#
- Start now, with open-source dependencies or whatever you are comfortable with.
- Climb the learning curve interactively in Claude Code or your IDE before automating. Learn where context is missing and where precision is low.
- Do not stop at scanning. Verification, triage, patching and the organizational process are the bottleneck.
Anthropic's resources: Claude Security for scanning, validating and proposing fixes, the written guide, and the reference harness repo with interactive skills and an autonomous pipeline you can customize. Our coverage of Claude Security continuous scanning goes into the product.
Our Take#
The most transferable idea is that the threat model is just context, and it is the single biggest lever on precision. Most of what makes a finding real or irrelevant lives outside the code. Teams that skip writing it down will drown in plausible-sounding false positives and blame the model.
The second is the patch ladder, especially re-attacking patches with a fresh agent. It is the same separate-verifier principle Lance Martin describes in their long-horizon tasks talk, applied to security. We also argued in security agents need repro harnesses that reproducibility is what turns findings into fixes.
FAQ#
What is the bottleneck in AI-driven vulnerability management?#
According to Eugene Yan, discovery is now straightforward. The bottleneck has moved to verification, triage, patching and organizational processes like routing and severity calibration.
Why does a threat model improve LLM security scanning?#
The model understands the code it can read but not the system context in people's heads, such as compensating controls or data sensitivity. Teams with a well-documented threat model reported true positive rates around 90%.
How should AI-generated security patches be validated?#
Confirm the original proof of concept no longer works, keep the existing tests green, have a fresh agent attack the patched code, and have a human approve before merge.
Sources#
- Using LLMs to Secure Source Code - video
- Using LLMs to secure source code - Eugene Yan and Henna Dattani
- Defending Code Reference Harness
- Behind the Scenes Hardening Firefox with Claude Mythos Preview - Mozilla
- How fast is autonomous AI cyber capability advancing? - UK AISI
- Project Glasswing: An initial update
The Full Series#
This post is part of our coverage of Anthropic's talks at AI Engineer 2026:
- Claude for Long-Horizon Tasks: Lance Martin's Four Rules for Agents That Run for Hours
- Inside the Claude Managed Agents Workshop: Pets, Cattle, Outcomes and Dreaming
- How Anthropic Builds: Mike Krieger on Being Unreasonable With Claude
- How Jarred Sumner Ships Millions of Lines of Agent-Written Code
- A Field Guide to Fable: Thariq Shihipar on Unhobbling Claude and Finding Your Unknowns
- Claude Tag Lands 65% of Anthropic's Product PRs: Takeaways From Cat Wu and Thariq Shihipar
- 1,000 Claude Agents, Git and a Database: How Fable 5.2 Formalized Fermat Without a Custom Harness
- Your Old Prompts Are Making Claude Worse: Lance Martin's Checklist for Frontier Models
- Why One Agent Isn't Enough: Anthropic on Flows, UltraCode and Running 1,000 Agents
- Tokens Should Have Jobs: Anthropic's Case for Advisors, Graders and Dreamers
- Give the Agent a Budget, Not a Token: Anthropic's CI Team on Safe Agent Permissions
- Rethinking Claude Code Best Practices: Lydia Hallie on Getting Out of the Loop Safely
- How Anthropic Merges 30,000 Code Changes a Day: Addy Osmani on Verifying the Software Factory
- From Messages API to Managed Agents: Anthropic's Applied AI Team on Harnesses That Go Stale
- Forward Deployed Engineering 101: When Your AI Startup Needs FDEs, From Palantir to Anthropic
- The Enterprise Tech Stack for AI Agents: Why Your POC Stalls and How to Design Past It
- The Claude Certified Architect Exam as a Field Guide to Agentic Engineering
- The Future of MCP: David Soria Parra on Connectivity, Progressive Discovery and Skills Over MCP
- Gateways Are All You Need: How Anthropic Thinks About MCP in the Enterprise
- How to Build Agents That Run for Hours: Anthropic's Planner, Generator and Evaluator Harness
Continue Reading#
Get the next deep dive like this in your inbox
One email a week on Anthropic and the rest of the AI dev stack. Free.
Read next on Claude Code
Claude Security Continuous Scanning: Fix Tracking, API and MCP
Claude Security now rescans repos as commits land, marks findings fixed when the fix ships, and adds an API, MCP connector and webhooks. Setup, limits and cost.
8 min readAI Security Scanners Move the Bottleneck to Triage
AI security scanners find vulnerability candidates faster than teams can verify, disclose and patch them. Why triage is now the real bottleneck.
8 min readSecurity Agents Need Repro Harnesses, Not More Scan Prompts
Anthropic's open-source vulnerability harness shows AI security agents need reproducible exploit loops, separate verification agents, and patch receipts.
9 min readTechnical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.







