/appsec-advisor:ask-security-assessmentfrom appsec-advisor
Answers natural-language questions about a repo's threat model from threat-model.yaml. Covers existence, severity, findings, and meta concepts like STRIDE. Read-only, cites F-ids.
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 answer a user's concrete question about the threat model in their
repository. This skill is read-only — it does not analyze code, does
not spawn agents, and does not write files. It reads the committed
threat-model.yaml and answers.
Correct first, then fast. The answer must be grounded and accurate —
every claim traceable to the model, cited by F-id, never hallucinated,
half-true, or inflated. When the model does not contain the answer, say so;
that is a correct answer. Given that, keep it quick: the common case is one
model/query_threat_model.py call (a pure YAML read, no network, no agents) and a
short reply — so don't run the freshness probe, re-read the big rendered report,
or spawn anything unless the question actually needs it (see Step 3b). Speed
never justifies guessing: if answering correctly needs another read, do it.
This is the "just ask" surface. It is distinct from its siblings:
show can never answer a question its fixed block does not already contain.
So a misroute into this skill is recoverable and a misroute into show is a
dead end — when in doubt, answer here./appsec-advisor:analyze-threats <question> for the design advice; never
start it yourself.Decide which of three kinds the user's question is. You may answer more than one in a turn if they asked more than one.
Presence ("is there a threat model?", "gibt es hier ein bedrohungsmodell?")
is a data question and belongs here — answer it tersely from the loader's
exit code: exit 1 means no (surface the tool's appsec-analyzer hint),
otherwise yes plus where it lives. Do not dump the overview at someone who
asked a yes/no question; offer it instead ("want the full summary?").
If a request is actually an action ("fix F-003", "accept this risk", "re-scan", "export to PDF"), this skill does not do that — briefly answer any question part, then point the user at the right sibling skill (see Plugin knowledge → Sibling skills). Do not edit code or regenerate anything here.
--help — help (early exit)If the user's arguments contain --help or -h as a flag (not as part of a
natural-language question), run the following Bash command, output its stdout
verbatim, then exit. Do not read any other file besides HELP.txt.
cat "<base-dir>/HELP.txt"
Unlike show-security-assessment, most invocations of this skill carry a
natural-language question as the arguments. Do not hard-fail on non-flag
tokens — that text IS the question you must answer.
Recognized flags (everything else is the user's question, kept verbatim):
--repo <path> --output <path> --grep <term> --id <id> --severity <level>
--component <name> --evidence-state <state> --json
--help | -h
REPO_ROOT to the current working directory; --repo overrides.OUTPUT_DIR to the repository's assessment directory, resolved in Step 2; --output overrides.--grep <term> sets an optional topic pre-filter, --severity <level> an
exact severity filter, --component <name> a component filter, and
--evidence-state <state> an exact evidence-state filter. They compose with
AND semantics. --id <id> is a precise lookup and cannot be combined with
the other filters; --json is a boolean toggle.QUESTION — the thing you answer in Step 4.CLAUDE_PLUGIN_ROOTif [ -z "${CLAUDE_PLUGIN_ROOT:-}" ] \
|| [ ! -f "$CLAUDE_PLUGIN_ROOT/.claude-plugin/plugin.json" ] \
|| [ ! -f "$CLAUDE_PLUGIN_ROOT/scripts/model/query_threat_model.py" ]; then
echo "Error: CLAUDE_PLUGIN_ROOT is missing or does not identify a valid appsec-advisor plugin." >&2
exit 2
fi
[ -n "${OUTPUT_DIR:-}" ] || OUTPUT_DIR=$(python3 "$CLAUDE_PLUGIN_ROOT/scripts/shared/assessment_location.py" locate --repo "$REPO_ROOT") || exit 2
On exit 2, print the resolver's Error: ... line and stop; never fall back to
docs/security.
When the user asked for the summary block itself (Step 0 kind 1), run the same
pipeline show-security-assessment runs and print its output verbatim as the whole
deliverable. This keeps the overview a deterministic render — an LLM
paraphrase of a fixed block is strictly worse, and re-composing pre-rendered
output is a known cost sink in this plugin. Do not add commentary; the block
already names the follow-up lanes. Then stop — Step 3 is for questions the
block cannot answer.
python3 "$CLAUDE_PLUGIN_ROOT/scripts/model/threat_model_health.py" \
--repo-root "$REPO_ROOT" --output-dir "$OUTPUT_DIR" --json 2>/dev/null \
| python3 "$CLAUDE_PLUGIN_ROOT/scripts/renderers/summarize_threat_model.py" \
--output-dir "$OUTPUT_DIR" --repo-root "$REPO_ROOT" --health-json -
EXIT=$?
This path costs a git change-detection probe (~1s) that Step 3 avoids. Use it only for a genuine overview request — never as a fallback for a specific question.
For a data question, load the facts once. Pick the narrowest mode that
answers it — the digest grows with the finding count, so on a thorough model
the unfiltered read is large:
--id <F-/T-/M-/W-NNN> — the question names one identifier ("what's the
fix for F-003?", "why is W-002 a problem?"). Returns that record with its
cross-links (finding ↔ mitigation ↔ weakness). Cheapest and most precise;
prefer it over every other filter whenever an id is present.--severity <level> — use for questions such as "what are the Critical
findings?". It avoids loading unrelated findings; the severity histogram and
worst-case block remain global.--component <name> — use for questions about a named service or
component. It matches both the component id and its display name.--evidence-state <state> — use when the question distinguishes verified,
ambiguous, or unchecked evidence.--grep <term> — the question centers on one keyword (a component name, a
vulnerability class). Note the severity histogram and worst-case block stay
global, so a filtered read still answers "how bad is it overall?".quick/standard model; on a large one
prefer a targeted filter. Note the attack-surface entry list is only
rendered under --grep — the default shows its shape alone.QUERY_ARGS=(--output-dir "$OUTPUT_DIR" --repo-root "$REPO_ROOT")
if [ -n "$ID_QUERY" ]; then
QUERY_ARGS+=(--id "$ID_QUERY")
else
[ -n "$GREP_TERM" ] && QUERY_ARGS+=(--grep "$GREP_TERM")
[ -n "$SEVERITY_QUERY" ] && QUERY_ARGS+=(--severity "$SEVERITY_QUERY")
[ -n "$COMPONENT_QUERY" ] && QUERY_ARGS+=(--component "$COMPONENT_QUERY")
[ -n "$EVIDENCE_STATE_QUERY" ] && QUERY_ARGS+=(--evidence-state "$EVIDENCE_STATE_QUERY")
fi
[ "$JSON_MODE" = "true" ] && QUERY_ARGS+=(--json)
python3 "$CLAUDE_PLUGIN_ROOT/scripts/model/query_threat_model.py" "${QUERY_ARGS[@]}"
EXIT=$?
Exit-code reference:
0 — model present, facts emitted1 — no model found (the tool prints the appsec-analyzer hint; surface it)2 — error (unreadable, unparseable, or contract-invalid model)If --json was requested, print the tool's output as the deliverable and stop.
Only when the question is about currency — "is it still up to date?", "is this stale/outdated?", "has the code changed since?" — run the freshness probe. It is the slow path (git change-detection over the repo), so never run it for an ordinary content question.
python3 "$CLAUDE_PLUGIN_ROOT/scripts/model/threat_model_health.py" \
--repo-root "$REPO_ROOT" --output-dir "$OUTPUT_DIR" --json 2>/dev/null
Report freshness.verdict + freshness.reason + freshness.recommend in plain
language (e.g. "Stale — 194 security-relevant files changed since the scan;
recommend re-running appsec-analyzer"). This is the same change-detection
that drives the incremental-scan decision — do not re-implement or second-guess it.
Answer QUESTION only from the facts you just loaded (data) and the Plugin
knowledge below (meta). Rules:
F-003) — they match what the reader sees in the rendered
report. Reference mitigations by M-id and components by name.SYSTEM block (components, assets and
their classification, trust boundaries) and a CONTROLS block (assessed
effectiveness per domain) — all cross-linked to the findings that evidence
them. The one deliberate gap is the attack-surface entry list: only its
shape (total, how many unauthenticated, protocol mix) is in the default digest
because it routinely runs past 100 entries. Re-run with --grep <path or keyword> to list matching entry points instead of claiming the model records
none. Narrative depth that no index carries (full asset write-ups, the
architecture prose) lives in the rendered report: §4 Assets, §5 Attack
Surface, §6 Security Architecture.The threat model is produced by the appsec-advisor plugin. Use this to answer "how do I read/act on this" questions and to route actions.
Presence & metadata. "Is there a threat model?" is answered by the loader
itself: exit 1 + "No threat model found" means no (surface the tool's
appsec-analyzer hint and stop, whatever the question was); a rendered digest
means yes. Answer that tersely — see Step 0. The digest header + the
META block carry the model's own metadata — when it was generated
(generated), the plugin version, scan mode (full/incremental), assessment
depth, the models used, the analyst, repo URL, owner, asset classification,
compliance scope, and whether requirements were checked. Answer "when/how/by
what was this generated?" and "who owns it / what scope?" straight from those
values; report only fields the model actually carries.
Verdict (quick). For "what's the verdict?" / "how bad is it?" / "what's the
worst case?", use the TOP RISK block — the model's curated worst-case
(critical_findings) — plus the severity histogram. That is the fast verdict;
you do not need to read the whole model. Do not synthesise a new risk rating.
Abuse cases. The ABUSE CASES block lists the recorded outcome of every technical and business abuse case the run checked: verdict, kind, linked findings, open questions, cases that did not apply, and cases not performed with the reason. --grep <case id or keyword> narrows it to one case. Report a verdict only as recorded; an inconclusive or not-performed case is unresolved, not safe. Step-by-step evidence lives in §9 of the rendered report. This skill cannot run a case. For an inconclusive or not-performed case, you may suggest /appsec-advisor:analyze-threats --abuse-case <ID>; never start it yourself.
Identifiers. Findings are cited as F-NNN in the report (stored as T-NNN
in the yaml). Mitigations are M-NNN. Components have names/ids. Cite the
F-/M- forms — those are what the user sees.
Severity. Critical > High > Medium > Low > Informational. The effective
severity is the composer's effective_severity → risk → severity — a stored,
capped value, not something this skill computes. Be conservative; never inflate.
STRIDE. Each finding is tagged with one STRIDE category: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege — the threat class it represents.
Mitigation priority. P1 / P2 / P3 is the remediation priority of a
proposed fix (P1 = do first). It is severity-independent and never contradicts
the severity histogram. A finding with no mitigation_ids has no proposed
fix and usually needs a human decision.
Evidence state. evidence_check marks whether the cited evidence was
verified (verified / verified-prior / ambiguous / unchecked / …). Report
it honestly; do not upgrade an unchecked finding to "confirmed".
Custom requirements. When the team integrated their own requirement
catalog at scan time (appsec-analyzer --requirements <url>), the digest
carries a REQUIREMENTS block: how many were checked and which are violated,
by which findings. Individual findings show violates: REQ-…, and --grep REQ-AUTH-01 finds the findings that break that id. Answer compliance questions
("welche requirements verletzen wir?", "erfüllen wir REQ-042?") from that block
and cite both the requirement id and the F-ids.
Two honesty rules here, both load-bearing:
Document structure (the rendered threat-model.md). Top matter is a
Management Summary (exec-level verdict + top risks + posture) and a
Critical Findings by Root Cause (Critical findings grouped by weakness). Then numbered sections:
§1 System Overview · §2 Architecture Diagrams · §3 Attack Walkthroughs
(attacker-POV narratives of key findings) · §4 Assets · §5 Attack Surface ·
§6 Security Architecture · §7 Weakness Register (systemic/design weaknesses,
W-NNN) · §8 Findings Register (the individual findings F-NNN, as
severity-grouped cards) · §9 Abuse Cases (verifiable abuse-scenario chains) ·
§10 Mitigation Register (the fixes M-NNN, priority-ordered) · §11 Out of Scope
· Appendices (Run Statistics, Attack Vector Taxonomy). "Where do I find X?" → a
specific finding lives in §8, its fix in §10, the big picture in the
Management Summary. Depth/section presence varies by scan depth
(quick|standard|thorough).
Prioritization. Two independent axes, deliberately kept separate so they
never contradict: findings are ranked by severity (Critical→Low, risk-based),
mitigations by remediation priority (P1→P3, "what to do first"). The
Management Summary surfaces the worst-case findings first; show/review
present the remediation backlog along the P1→P2→P3 spine. When asked "what
should we fix first?", lead with P1 mitigations and Critical findings,
and say plainly when a finding has no proposed fix.
Options (what the plugin can do). appsec-analyzer runs at three depths —
quick / standard / thorough (more STRIDE turns, diagrams, QA the deeper you
go); reassesses a changed repository with --full, and supports custom
requirements compliance and CI presets. Siblings export/publish (PDF/
HTML), check health/freshness, and evaluate model quality. Point the user at the
right one; this skill does not run them.
Limitations. The model is LLM-assisted discovery,
not an exhaustive audit or a pentest — absence of a finding is not proof of
safety. Findings carry an evidence_check state (verified … unchecked); do
not present an unchecked one as confirmed. Coverage is bounded by scan depth
and scope. The verdict section is a report render, not always
in the semantic model. Freshness needs git and is only checked on request
(Step 3b). When a question exceeds what the model records, say so plainly.
Sibling skills (route actions here — this skill only answers):
show-security-assessment — display command for the summary block. Never route a
question there; if the user wants that block, emit it yourself via Step 3a.triage-security-assessment — triage console: apply a fix, accept a risk, or
build a remediation plan. This is where "fix these" / "accept" go.appsec-analyzer — generate or update the model (analyzes code).appsec-analyzer --full — refresh an existing model.export-security-assessment — render/share (PDF/HTML).security-assessment-health — freshness / CI probe.eval-security-assessment — artifact-quality evaluation of the model itself.When an answer implies an action, name the exact skill, e.g.: "To apply the fix
for F-003, run /appsec-advisor:triage-security-assessment."
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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./analyze-threatsAdvisory threat analysis on request: a planned design, selected code changes, a concrete threat hypothesis against named files or directories at a Git revision, or a defined abuse case by its ID. Combines source evidence with requirements, business context, and an optional threat model. Reports findings, scenarios, assumptions, and questions whose answers change the assessment. Hypothesis checks distinguish supported, not confirmed in scope, and unresolved; no result proves safety. Answers can be saved explicitly to a feature file. Never edits code, changes the threat model, or grants security approval./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./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