skills/sast-pipeline/SKILL.md
Running the SAiST (Static AI-assisted Security Testing) pipeline against a codebase. Use when the user wants to run static analysis rules, detect code smells, find vulnerability patterns, or scan code with the built-in rule engine. Covers the full init → resolve gaps → run rules flow.
npx skillsauth add artifex1/auditor-addon sast-pipelineInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Three-phase static analysis: init → resolve gaps → run rules.
sast_init_scan({
files: ["src/**/*.sol"],
languages: ["solidity"],
context: {
domainOverrides: { "rust": "on-chain" }, // e.g. Anchor/CosmWasm
framework: "anchor"
}
})
Builds SymbolMap (functions, state variables, call edges, modifiers, state reads/writes). Computes hotspots (functions in the most call chains). Detects gaps — callees the static pass cannot resolve:
unresolved_callee: target not found in scopeinterface_dispatch: call through interface (concrete impl unknown)external_library: target exists but out-of-scopeReturns scanId, gaps (prioritized high/medium/low by hotspot proximity), hotspots. Status is needs_resolution if gaps exist, ready if none.
Review gaps and resolve what you can. Each gap has id, type, qualifiedName, callSite, codeSnippet, priority.
Triage:
sast_resolve_gaps({
scanId: "abc123",
resolutions: [{
gapId: "deadbeef1234",
facts: { writesState: ["balances"], callsExternal: false },
resolvedBy: "agent",
confidence: "medium"
}]
})
Skip entirely if gap count is zero or all low priority.
sast_run_rules({
scanId: "abc123",
includeSeverity: ["critical", "high", "medium"],
includeKind: ["issue", "smell"],
})
Filters: ruleIds (specific IDs), includeSeverity, includeKind (issue, smell, pointer).
| Kind | Confidence | Meaning |
|---|---|---|
| issue | high | Confirmed defect — must fix |
| smell | medium | Likely problem — investigate |
| pointer | low | Suspicious pattern — verify manually |
Pointer rules flag syntactic patterns (rounding in branch conditions, few fields in EIP-712 hashes, inconsistent guard-vs-assignment) that have historically led to vulnerabilities. Expect false positives.
Besides shipped rules, the pipeline supports per-engagement custom rules. Pass file paths via customRulePaths:
sast_run_rules({
scanId: "abc123",
customRulePaths: ["./rules/CUSTOM-001-unbounded-loop.ts"],
})
Both .ts and .js paths are accepted. TypeScript files are compiled on-the-fly by tsx — no build step needed. Custom rule IDs must use the CUSTOM- prefix. Use the rule-authoring skill to create them.
Flywheel: Find an issue → recognize it's a pattern → write a custom rule → test it flags the known instance → run it against the full codebase to find more.
includeKind: ["issue", "smell"]includeKind: ["pointer"] for lower-confidence flagsdevelopment
Analyzing codebases to systematically identify and categorize potential security threats, producing a threat model report before code-level auditing. Use when starting an engagement and wanting to map the attack surface, identify high-value assets, and enumerate threat agents before diving into code-level analysis.
development
Conducting interactive security audits using the Map & Probe methodology. Use when the user wants to perform a security review of source code, find vulnerabilities, audit a codebase, or analyze code for security issues.
testing
Technical writing for formal security audit reports. Use when the user wants to write up a security finding, create a formal issue report, or draft system overview and security model sections for an audit report.
development
Writing SAiST static analysis rules — both shipped rules in the auditor-addon repo and custom per-engagement rules in audit workspaces. Use when the user wants to create a new detection rule, add a security check, implement a code smell detector, turn a confirmed finding into a reusable rule, or extend the rule set. Covers rule types (shallow, deep, MapRule), the trait system, language scoping, finding kinds, custom rules, and testing patterns.