sast-gap-analyzer — Claude Code subagent: find validation gaps
sast-gap-analyzer — a subagent for Claude Code, Cursor and other IDEs that identifies where validation chains break down — missing, insufficient or bypassable checks. Detects bugs between code fragments that each look correct in isolation.
no license ★ 1,298 updated 2026-06-12
.claude/agents/sast-gap-analyzer.mdWhat sast-gap-analyzer does
Takes traced data flows and spots seven categories of validation gaps: no check at all, bounds that do not cover the constraint, type mismatches between check and use, checks of the wrong property, race conditions between check and use, interactions between individually correct checks that create impossible-yet-satisfiable conditions, and skipped checks in error paths.
The agent excels at finding interaction gaps — the hardest vulnerabilities, such as the SACK pattern in TCP or sentinel-value collision in FFmpeg. Requires Claude Opus to reason through complex chains. Access it via /sast, passing files with traced flows and source code; the agent reads, verifies and suggests concrete fixes.
In PHP codebases, it spots classic traps: loose token comparison with == instead of ===, is_numeric as a guard, non-strict in_array, path traversal through stream wrappers and second-order SQL injection through logs.
What it helps with
- spot missing or insufficient checks in data validation
- find bugs in the gaps between separately correct checks
- detect race conditions between permission checks and file use
- catch type mismatches where data is validated in one type but used in another
- diagnose PHP pitfalls: loose comparison, path traversal, second-order SQL injection
Example prompts for the agent
- Analyze validation in
auth.php— find gaps in token checks betweenparse_jwtandvalidate_claims - Review data flows in the file handler: where could a race condition exist between extension checks and path use
- Examine buffer boundary interactions in
memcpy— can two separately correct checks contradict each other
How to install sast-gap-analyzer
Manually: put the files in place
.claude/agents/sast-gap-analyzer.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/sast-gap-analyzer.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/sast-gap-analyzer.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about sast-gap-analyzer
How do I install sast-gap-analyzer in Claude Code?
Create .claude/agents/sast-gap-analyzer.md at your project root with the agent description and instructions. Call it via /sast in Claude Code, passing files with traced data flows.
What does sast-gap-analyzer do?
It reviews validation in data flows and identifies seven kinds of gaps: missing checks, incorrect bounds, type mismatches, checks of the wrong property, race conditions, interactions between correct checks and omitted error-path checks. It finds bugs between separately correct code fragments.
Why does it require Claude Opus?
Finding interaction gaps — the hardest vulnerabilities — demands extended reasoning chains that only Opus provides. Other models yield shallow results.