/secaudit:run [repo-path] [--scope <relative-path>] [--output <exact-run-directory>]from secaudit
Launch the full secaudit source-code security audit against a repository. Explicit-only entry point: inspects the target read-only, recommends hunters with a token-cost bracket, asks the user which hunters + whether to run the blindspot sweep, prepares an isolated run via the deterministic runtime, then starts the deterministic workflow. The workflow itself never prompts.
Ships in secaudit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill is a thin launcher. It asks the user two things UP FRONT, then hands a fixed config to the deterministic Workflow spine.
Run node --version. If it fails or reports a major version below 22, STOP and tell the
user: secaudit requires Node.js 22 or newer on PATH (https://nodejs.org) — nothing else
is attempted until that is installed. Do not work around it.
Every command below runs a script bundled with secaudit, not a script in the repository being audited. The plugin root and the audit target are different roots and are never derived from each other.
${CLAUDE_PLUGIN_ROOT} — that placeholder is expanded to the
plugin's absolute installation directory before you read this file. If you literally see the
unexpanded placeholder text here, expansion did not happen; use the fallback rule below.<PLUGIN_ROOT>/skills/run/SKILL.md.Substitute that absolute path for <PLUGIN_ROOT> everywhere below, and always quote it — the
plugin may be installed under a path containing spaces. Never substitute the audit target for
it, and never assume the plugin lives inside the repository being audited.
Run the deterministic inspection. If the user gave a repo path, pass it; if they gave
--output, remember it for Step 3 (inspect does not take it):
node "<PLUGIN_ROOT>/skills/run/scripts/secaudit-runtime.mjs" inspect --target <repo-path> [--scope <relative-path>]...
Omit --target entirely when the user gave no path — the runtime resolves the Git
toplevel above the current directory, else the current directory. Parse the one-line
JSON: {target, targetSource, artifactRoot, artifactRootSource, coverage, extensions, manifests, exclusionsApplied, warnings, …}. On {"error":{code,message}}, report the message and stop.
Show the resolved target to the user before anything else — they must see what
would be audited. Surface any warnings verbatim.
Show where the report will be written: <artifactRoot>/.secaudit/runs/. The run directory
follows the PROJECT root, not the audited tree — artifactRootSource says which one it found:
targetGitRoot (the audited tree's own repository), cwdGitRoot (the audited tree is in no
repository, so the run follows the one you are standing in — this is what keeps an audit of a
staged or copied workspace out of that copy), or target (nothing is a repository). When it is
not the target, say so plainly; the user can override the exact directory with --output.
targetSource says how that path was arrived at: explicit (the user named it), gitToplevel
(guessed by walking up from the current directory to the nearest repository root), or cwd
(guessed, no repository found). A guess can be wider than the user meant — running from
repo/services/api audits all of repo — so anything other than explicit MUST be confirmed
in Step 2 before Step 3 writes anything.
Print the size line from coverage:
Repo: <sourceLines> source LOC, ~<estimatedSourceTokens> source tokens.
Estimate the full-scan token cost and tell the user. Rough, tunable heuristic:
FIXED ≈ 150k tokens — Recon + Dedupe + Trace + Generate Artifacts overhead.PER_HUNTER ≈ 40k + coverage.estimatedSourceTokens — each hunter reads its skill + the relevant slices of source.est ≈ FIXED + nHunters × (40k + estimatedSourceTokens); the blindspot sweep roughly doubles the hunt+challenge portion.Print an order-of-magnitude line, e.g. Est. full scan (N hunters, blindspot sweep off): ~XXXk–YYYk tokens. Fewer hunters = proportionally fewer tokens — trim the list below to cut cost. Keep it a bracket, not false precision.
Map extensions + manifests to a RECOMMENDED subset of these 14 classes:
businesslogic, fileupload, graphql, hardcodedsecrets, idor, jwt, missingauth, pathtraversal, rce, sqli, ssrf, ssti, xss, xxe.
Rule of thumb: always include sqli, idor, missingauth, hardcodedsecrets. Add ssrf/rce
for services that make outbound calls or shell out; xxe when XML is parsed (pom.xml,
.csproj hint at XML-heavy stacks); graphql only if a .graphql schema/endpoint exists;
fileupload/xss only if upload or HTML-render surface exists (.html/.cshtml in
extensions); jwt if tokens are issued/verified. Exclude classes with no matching
surface and say why.
Also form a blindspot-sweep RECOMMENDATION: small/simple repo (few files, one service) → recommend the blindspot sweep OFF; large or high-surface repo → recommend it ON. The blindspot sweep adds one more full hunt+challenge round targeting what the first round missed.
AskUserQuestion allows at most 4 options per question, so the 14 hunter classes cannot
all be shown as checkboxes. The user must still be able to SEE every available class — so the
hunter question text MUST list all 14 valid class names verbatim. Never leave the user
guessing what they can type.
Ask these in one AskUserQuestion call — the target question only when Step 1 reported
targetSource other than explicit:
Target (single select, ask ONLY when targetSource !== "explicit"). Question text:
"No path was given, so I resolved the target by <gitToplevel → walking up to the nearest
Git repository root / cwd → using the current directory>. Audit <target>?" State the
size line from Step 1 alongside it, so the scope is visible as a number too.
Options:
<target> (Recommended) — the resolved path.inspect with
--target <their path> and start Step 2 again with the new numbers.Never skip this question by inferring consent from the hunter answer. If the user picks a
different path, the old target, coverage and recommendations are stale — discard them.
0b. Scope (single select, ALWAYS ask — never reuse a previous run's scope, and never
restore one from an earlier run directory; scope is chosen fresh every time).
Question text: "Audit the whole target, or only part of it? Whole target is
<coverage.sourceLines> source LOC." Options:
--scope.inspect with those --scope values and restate
the size line before continuing; a scope that matches nothing is refused with
E_SCOPE_UNKNOWN, and a scope with no source files with E_SCOPE_EMPTY.Never hand-stage a subset of the repository to narrow an audit. --scope exists precisely
so the target, project root, and corpus hash keep referring to the real repository.
Hunters (multiSelect). Question text MUST include:
businesslogic, fileupload, graphql, hardcodedsecrets, idor, jwt, missingauth, pathtraversal, rce, sqli, ssrf, ssti, xss, xxe.Options (multiSelect; recommended first, labelled "(Recommended)"):
<your inspect-matched subset> — the classes with matching surface.sqli, idor, missingauth, hardcodedsecrets — cheapest sensible floor.hunters: "all").The user can tick presets or use Other to supply any custom subset by name. Validate typed names against the 14-class list; drop unknowns and tell the user which you dropped. If multiple presets are ticked, union them.
Blindspot Sweep — "Run the optional Blindspot Sweep? Off is cheaper and the default." Options: Off (recommended for this repo) / On. Flip the recommendation label to match your Step-1 recommendation.
If the user passed an explicit hunter list or blindspot-sweep choice in their message, skip the corresponding question.
Create the isolated run with the deterministic runtime, using the target from Step 1's
JSON (and the user's --output if they gave one):
node "<PLUGIN_ROOT>/skills/run/scripts/secaudit-runtime.mjs" prepare --target <target> [--scope <relative-path>]... [--output <exact-run-directory>]
Parse its one-line JSON: {runId, runDir, work, target, projectRoot, scope, artifactRoot, coverage, corpusSha256, generatedDate, …}. On {"error":{code,message}}, report the message
and stop — never improvise a workspace.
Before launching, print all three resolved facts — they are the only chance to redirect the run:
Target: <target>Selected scope: <scope joined by ", ", or "whole target">Output: <runDir>Call the workflow with the chosen config, passing the prepare fields through verbatim. The
hunters: argument is MANDATORY — substitute the user's selected classes as a literal array
(or the literal string "all" if they chose the full 14-class sweep):
Workflow({
name: "secaudit:secaudit",
args: {
target: "<target>",
work: "<work>",
runDir: "<runDir>",
runId: "<runId>",
scope: <scope array, verbatim>,
projectRoot: "<projectRoot>",
coverage: <coverage object, verbatim>,
corpusSha256: "<corpusSha256>",
generatedDate: "<generatedDate>",
pluginRoot: "<PLUGIN_ROOT>",
hunters: ["sqli", "idor", "missingauth"],
blindspotSweep: false,
traceBatch: 5,
launchToken: "secaudit:run"
}
})
name is the installed plugin's namespaced workflow (plugin secaudit + workflow secaudit).
If the client reports no such workflow because you are running from an uninstalled checkout
rather than an installed plugin, retry with the bare name "secaudit". pluginRoot is
mandatory: the workflow has no filesystem or environment access, so it cannot find its own
bundled skills and scripts — without it the run dies at the first agent dispatch.
Do NOT omit hunters:. The workflow HARD-FAILS if hunters is missing or empty (it
refuses to silently run all 14) — so a dropped selection errors immediately instead of
running an expensive full sweep. Pass hunters: "all" only when the user explicitly wants
every class. launchToken is the handshake that authorizes the full pipeline — the
workflow refuses to start without it, and nothing except this skill may supply it.
Optional traceBatch: N (default 5) raises records-per-Trace-agent if a run is still
too expensive. (Challenge itself is not batched — it runs one Challenger per hunter with findings.)
This orchestrates: Recon (map) → Hunt (one focused agent per chosen hunter) →
Challenge (adversarial, one Challenger per hunter) → [Blindspot Sweep] → Dedupe → Trace →
Generate Artifacts, with a guaranteed artifact generation step. Watch live progress in
/workflows and by tailing <work>/sast/.
Once the run reaches Recon, confirm its trace/ledger Recon / Prepare: line shows
hunters=<the count you selected>. If it shows a different count, the selection was dropped —
stop and re-launch with the correct hunters: array.
When the workflow finishes, report to the user: counts of CONFIRMED / REFUTED / MANUAL REVIEW,
the top 3 CONFIRMED findings, and the paths to <runDir>/trace.md and
<runDir>/work/sast/report-data.json. No report is rendered — the findings are read in the
secaudit:issues dashboard. The copied source is removed automatically on a successful
publish; <runDir>/work/sast/ keeps the stage evidence. If the run reports state
cleanup-incomplete, say so plainly and name the leftover entries — that run still holds a
copy of the audited tree, including its .env. Never claim the codebase is "secure."
Then bring the persistent board up to date and report what this run actually changed:
node "<PLUGIN_ROOT>/skills/issues/scripts/sync.mjs" --project "<projectRoot>"
Report its seven summary numbers verbatim — new, repeat, reopened, suppressed,
ambiguous, refuted, unrefuted — under these rules:
repeat is a finding the board already knows about. Never describe it as new.suppressed counts observations matching an issue a human already marked a false positive.
They stay archived and are not raised again.reopened counts issues a human had marked done that this run found again.ambiguous counts observations whose cross-run identity could not be established with
confidence; they need an explicit human merge decision on the board.refuted counts findings this run reported that the audit itself refuted — Challenge said
NOT-A-DEFECT, or Trace said UNREACHABLE. They go straight to the board's archive on the
audit's own verdict and are never anyone's triage work.unrefuted counts issues an earlier run had refuted that this run observed without refuting.
They are back in the inbox and do need triage.unavailable run and its reason rather than omitting it.Open the board with secaudit:issues to triage.
Fallback (no Workflow engine, e.g. Codex): follow
<PLUGIN_ROOT>/skills/secaudit-orchestrator/SKILL.md stage-by-stage instead.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub tss-blue-ai-lab/tss-plugins --plugin secaudit23 skills in this plugin
/issuesOpen the secaudit Workbench: sync the persistent issue board with every discoverable run in this project, then serve it locally so triage decisions (confirm, done, false positive) persist across audits and restarts./sast-analysisPerform codebase analysis and architecture mapping as the first phase of a security assessment. Explores the tech stack, frameworks, entry points, data flows, and trust boundaries. Outputs sast/architecture.md. Run this before any vulnerability detection skill. Use when asked to analyze a codebase for security or when sast/architecture.md does not yet exist./sast-hunter-businesslogicDetect business logic vulnerabilities in a codebase using an inline three-phase method: threat modeling (domain analysis and attack scenarios via references/sinks.md), verify (check exploitable gaps via references/examples.md), and merge (write results). Covers price manipulation, workflow bypass, limit violations, race conditions, reward abuse, etc. Requires sast/architecture.md (run sast-analysis first). Outputs findings to sast/businesslogic-results.md. Use when asked to find business logic, logic flaws, or abuse-of-function bugs.Other plugins' skills for the same job