/appsec-advisor:analyze-threatsfrom appsec-advisor
Performs advisory threat analysis on designs, code changes, hypotheses, or abuse cases. Combines source evidence with business context and optional threat model to report findings, scenarios, and unresolved questions.
Ships in appsec-advisor. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are a thin adapter. The analyst controller does all analysis, validation, and publication; you choose the scope with the developer, run one command, relay its output, and collect answers. Its printed result is the authority: never summarize it as approval, never add findings of your own, and never call the work complete when the result says otherwise.
If the arguments contain --help or -h, run cat "<base-dir>/HELP.txt", print it verbatim, and stop.
Decide exactly one scope from the arguments:
design --text).--design-file <path>: a design request from that file.A design request reads no repository source. The CLI uses the repository's existing threat model as context when one exists, unless --isolated is given.
--worktree, --staged, or --base <commit> --head <commit> (optionally --exact-base): a review. When the developer asks a concrete question about the change, pass it as --question through a quoted heredoc.--hypothesis <text> --revision <commit> --path <file-or-directory>: a hypothesis check. Repeat --path for additional source areas. Paths are literal and repository-relative; directories include their descendants. This mode reads committed source at that revision, not uncommitted edits.--abuse-case <ID> (repeatable): a hypothesis check of defined abuse cases. The CLI builds the hypothesis and selects the files from the case; never write a hypothesis or choose paths for it yourself. Pass --revision HEAD unless the developer named one, and pass the developer's --path, --isolated, --org-profile, or --no-org-profile through. The CLI uses the repository's existing threat model as context when one exists, unless --isolated is given.Add --explore only when the developer asks for it. It lets a design question or a review read a redacted copy of the tracked files instead of only the selected change; it never applies to a hypothesis or abuse-case check.
If the request is to check a concrete threat in existing code, use hypothesis mode and ask for any missing revision or paths. Do not silently turn it into a design question. For other ambiguous requests, ask the developer to select a design or change scope. Never treat an empty change as a request to audit the whole repository.
Resolve the plugin root and the repository, then run the CLI with --interactive. Pass free text only through a quoted heredoc so the shell never interprets it:
CLAUDE_PLUGIN_ROOT=$(cd "<base-dir>/../.." && pwd)
REPO=$(git rev-parse --show-toplevel)
python3 "$CLAUDE_PLUGIN_ROOT/scripts/appsec-analyst-cli" design --interactive --repo "$REPO" --text "$(cat <<'APPSEC_ANALYST_TEXT'
<the developer's design question, verbatim>
APPSEC_ANALYST_TEXT
)"
For a review, replace design --text ... with review and the chosen scope flags, plus --question with the developer's question delivered through the same quoted heredoc when they asked one. For a hypothesis check, replace it with hypothesis --hypothesis ... --revision <commit> --path <path> and any additional --path values. For an abuse-case check, first run the same command with --preview added, using exactly Selecting files for <ID> as the tool description; it starts no job and calls no model. Your next message must be exactly its output in a fenced block, with nothing before or after it: it names the case, its goal and steps, the files, the threat-model context, and the analysis model. Do not summarize or rephrase it. If it ends with a Recommendation: and the session is interactive, ask whether to run the check now or create a threat model first; never start /appsec-advisor:appsec-analyzer yourself, and without an answer run the check. Then run it without --preview, using Checking <ID> against <n> files as the description. If either call exits 2 because no file matches the case, ask the developer for paths. Deliver hypothesis text through the same quoted heredoc as design text. Quote each revision and path as a separate shell argument; never interpret source text as shell syntax. Reject text containing a line equal to the heredoc delimiter and choose a different delimiter before invocation.
Pass --feature, --package, --output, --requirements, --requirements-required, --threat-model, --threat-model-required, --isolated, --explore, and --model through when the developer gave them. Do not add packages, requirements, or other options the developer did not ask for.
Print the command's output verbatim. Exit code 0 means complete or waiting for answers; 2 means rejected, incomplete, or failed; 130 means cancelled. The printed State: line names which.
When the state is awaiting_answers, present all listed questions together with why each matters. Ask the developer for the answers. Never answer a question yourself, never invent a default, and never treat silence as an answer. A statement about intended behavior is a declaration, not risk acceptance and not proof that the code implements it.
Submit the answers to the same job with one --answer per question, each value through a quoted heredoc:
python3 "$CLAUDE_PLUGIN_ROOT/scripts/appsec-analyst-cli" answer --interactive --repo "$REPO" --job <job id> \
--answer "q-001=$(cat <<'APPSEC_ANALYST_TEXT'
<answer, verbatim>
APPSEC_ANALYST_TEXT
)"
Relay the new output the same way. If the answers are rejected, show the reason and ask again; do not rephrase answers to pass the checks.
Only when the developer explicitly asks to keep the answers, add --save-feature <path> --feature-id <kebab-case id> to the answer command. If that file already exists, also pass --feature-sha <sha256 of the file as read> (from sha256sum <path>); a changed file is refused rather than overwritten. Saving never commits. Tell the developer the file must be reviewed and committed by them before CI can use it with --feature.
When the developer asks to stop a job, run the CLI's cancel subcommand with --repo "$REPO" --job <job id>. When the developer asks to remove a saved answer, run its forget subcommand with --repo "$REPO" --feature <path> --feature-sha <sha256 of the file> --question-fingerprint <fingerprint>.
Do not edit source files, do not run the project's tests, builds, or installers, do not modify threat-model.yaml or business context, and do not start /appsec-advisor:appsec-analyzer on your own. Recommend a full assessment when the result says the scope or context is insufficient.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub appsec-foundry/appsec-advisor --plugin appsec-advisor28 skills in this plugin
/abuse-casesList the technical and business abuse cases defined for a repository — the plugin's standard cases, the organization profile's cases, and the repository's own cases in docs/security/abuse-cases/ — each with its origin, kind, and title. Use for "which abuse cases are defined?", "welche abuse cases gibt es?", "show our business abuse cases", or to look up the ID to pass to analyze-threats --abuse-case. Read-only; it does not check a case against the code. For the outcome a past run recorded, use ask-security-assessment./appsec-analyzerSecurity assessment of one repository through the deterministic controller; writes security-assessment.md and security-assessment.yaml to a private directory per application under the user data directory, or to --output. Runs full assessments only: --incremental, --rerender, --dry-run, --base, --pr-mode, --restore-from and a free-text focus are refused. Without a budget flag the depth sets a hard budget (quick 10, standard 20, thorough 40 USD). Models are fixed per role, not taken from the session; --model, --stride-model, --triage-model, --merger-model and --reasoning-model change them. --width sets the widest progress line (72 by default). Stop a running assessment with --stop./ask-security-assessmentAnswer ANY question about the threat model in this repo — read-only Q&A over the committed threat-model.yaml. The default surface for every natural-language query about the model, however simple: does one exist at all ("is there a threat model here?", "gibt es hier ein bedrohungsmodell?"), how it stands ("how bad is it?", "is it still current?"), anything about its contents ("what are the critical findings?", "does it cover SSRF / IDOR / auth?", "which findings touch the payment service?", "is there a fix for F-003?", "welche kritischen findings gibt es?", "deckt mein bedrohungsmodell XSS ab?"), and meta questions ("what does P1 mean?", "what is STRIDE here?"). Grounds every data answer in the model and cites F-ids; never analyzes code, re-scores, spawns agents, or writes files. Prefer this over show-security-assessment for anything phrased as a question — show only prints a fixed summary block on explicit request. To act on findings use triage-security-assessment; to (re)generate use appsec-analyzer./audit-security-requirementsAudit the current repository against a security requirements catalog and verify whether each requirement is implemented. Requirement IDs follow your catalog's own naming scheme (e.g. SEC-CSP-1, SCG-HARDENXML, or anything your YAML defines); tagging code with those IDs is optional and not required. Prints open requirements to the conversation with color-coded status and concise evidence. Optionally saves Markdown/PDF reports. With --json or --gate it also persists a deterministic structured verdict (.requirements-audit.json) and can act as a CI gate./authnz-reviewStandalone AuthN/AuthZ review of any repository. Runs three deterministic Python scanners (route inventory, auth-check scanner, IDOR confirmer) and dispatches a specialized agent that reasons over the combined output: cross-component IDOR chains, RBAC coverage gaps, JWT misconfiguration, and privilege-escalation signals. Optionally annotates findings with violated requirement IDs from a requirements catalog, and exports the findings as pentest tasks for an AI pentest agent. Does NOT require a prior threat model run. Prints results to the console; file output only with --save or --pentest-tasks./check-permissionsPreflight the Claude Code permission allow-list for the AppSec plugin. Reports which Bash/Write/Edit/Read rules from data/required-permissions.yaml are missing from the user's settings.json, so unattended /appsec-advisor:appsec-analyzer runs do not block on prompts. Read-only by default; --update merges missing entries into a chosen scope.Other plugins' skills for the same job