/appsec-advisor:audit-security-requirementsfrom appsec-advisor
Audits a repository against a YAML-defined security requirements catalog, verifying implementation of each requirement. Prints color-coded open findings with evidence and optionally saves Markdown/PDF reports or a structured JSON verdict for CI gating.
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 auditing whether security requirements are implemented in the current repository. Follow the steps below exactly.
This skill produces an audit report — present it like a tool, not a chat. The
user-visible output is, in order: the AppSec Requirements Audit title +
Requirements Source banner (Step 1b), then the Results block and open
requirements (Step 3), and the saved-file lines (Step 4). Between those, scan
the repository silently.
Between the banner and the results the only permitted output is the batch
progress line specified in Step 2 — one per batch. Internal caveats (e.g. an empty violated_requirements
map) are not surfaced as prose — they simply produce empty cross-links.
No prose summary of the verdict. The result is exactly two things: the fixed
Results count block (Step 3a) and the per-requirement open-finding blocks
(Step 3b). Never collapse the counts into a sentence ("Of 64: 28 FAIL, 8
PARTIAL, …"), never narrate which requirements passed or why some are N/A, never
write a closing paragraph. PASS / UNVERIFIABLE / NOT_APPLICABLE items are counted
in the block and never described. If it is not the count block, an open-finding
block, or the footer, it does not belong in the output.
Saved files are always reported. Whenever a report or verdict is written, the last lines of the output name each written path (Steps 4a–4c) — so the user always sees where output went.
--quiet mode. When quiet_mode is set, suppress the Step 1b banner and the
entire Step 3 render (no count block, no findings, no footer). Still grade, still
write the requested saves. The ONLY output is a single status line followed by
the saved path(s):
audit: 64 graded · 28 fail · 8 partial · 5 pass · 10 unverifiable · 13 n/a
saved:
<AUDIT_OUTPUT_DIR>/appsec-requirements-report.md
In --quiet with --gate, also print the one-line requirements-gate: verdict
and honour its exit code. If --quiet is given without any save flag, there is
nothing to write — print just the status line.
--help — help (early exit)If the user's arguments contain --help or -h, do not scan the repository. Run the following Bash command, output its stdout verbatim, then exit with status 0. Do not read any other file besides HELP.txt.
cat "<base-dir>/HELP.txt"
The user may pass arguments after the skill name. Parse them now:
-- (e.g. AUTH, SQL) — grade ONLY requirements whose ID or category contains this string. It narrows scope. An unfiltered run grades the whole catalog.--md — save results as appsec-requirements-report.md in AUDIT_OUTPUT_DIR after rendering--pdf — save appsec-requirements-report.pdf in AUDIT_OUTPUT_DIR (converted from the Markdown report, which is written too)--json — save results as appsec-requirements-report.json in AUDIT_OUTPUT_DIR after rendering--save — save all formats (--md, --pdf, --json)--output <dir> — write the reports and run-state files to <dir> instead of the application's private directory outside the repository (Step 1b).--quiet — suppress the banner and the findings render; after grading + saving, print only a one-line status plus the saved file path(s). Intended with a save flag; the grading, verdict, and gate still run as requested.--requirements <src> — override the configured requirements_yaml_url for this run. <src> is an http(s):// URL (fetched remotely) or a local file path (absolute or relative). The source must load; there is no cache fallback when an explicit source is provided.--update — force a fresh re-fetch from the remembered/configured source and refresh the plugin cache before auditing.--cache-only — use the plugin cache only; never touch the network.--demo — audit against the packaged example catalog. The report is stamped DEMO.--status — mode flag: print the resolution banner (source, date, count, freshness) and exit. Do not scan the repository.--clear-requirements — mode flag: forget the remembered source and delete the cached catalog, then exit. Do not scan the repository.--gate — enforce a CI gate: exit non-zero when a gating requirement fails (default advisory, always exit 0). Decided deterministically by scripts/requirements/requirements_gate.py, not by the model.--gate-on <fail|partial> — what gates: fail (default) or fail+partial.--priority-floor <MUST|SHOULD|MAY> — lowest priority eligible to gate (default MUST).--org-profile <path> — use this org profile for source resolution instead of the packaged default.--preset <name> — use a specific preset when resolving the active org profile.--no-org-profile — ignore any packaged or env-pointed org profile for this run.Store the resolved flags: save_md, save_pdf, save_json, quiet_mode,
category_filter, output_dir_override, requirements_url_override, update, cache_only, demo,
status_mode, clear_requirements, gate_mode, gate_on (default fail),
priority_floor (default MUST), org_profile_override, preset_override,
no_org_profile.
--save sets save_md, save_pdf and save_json. --pdf implies save_md
(the PDF is converted from the Markdown report). --output, --gate-on and
--priority-floor each consume the following token as their value.
For the three gate knobs also remember whether the user passed the flag
explicitly this run (gate_mode_set, gate_on_set, priority_floor_set).
The active preset may supply defaults for them (Step 1b, after the org profile is
resolved), but an explicit CLI flag always wins — precedence is CLI > preset >
built-in default (advisory / fail / MUST).
Non-flag words (tokens that do not start with --) are always valid — they
are treated as the category_filter. But any token starting with -- that
is not one of the recognized flags above — or is not the value consumed by
--requirements or --output — is a hard error. DO NOT proceed. Do not read any files,
do not fetch requirements, do not scan the repository. Print the following
block verbatim to stderr, substituting <TOKEN> with the first unknown
flag, then exit with status 2:
Error: unknown argument '<TOKEN>'
/appsec-advisor:audit-security-requirements accepts only:
[CATEGORY_FILTER] Optional substring (e.g. AUTH, SQL) — no -- prefix
--md Save the rendered report as Markdown
--pdf Save the report as PDF (also writes the Markdown)
--json Copy the structured verdict to JSON
--save --md, --pdf and --json
--output <dir> Write reports to <dir> instead of the private directory
--quiet Suppress banner + findings; print status + saved paths
--requirements <url> Override the configured requirements YAML source
--update Force a fresh re-fetch and refresh the cache
--cache-only Use the plugin cache only; never touch the network
--demo Audit against the packaged example catalog (DEMO)
--status Show which requirements would be used, then exit
--clear-requirements Forget the remembered source + cache, then exit
--gate Enforce a CI gate (non-zero exit on a gating failure)
--gate-on <fail|partial> What gates (default fail)
--priority-floor <MUST|SHOULD|MAY> Lowest priority that may gate (default MUST)
--org-profile <path> Override the packaged org profile
--preset <name> Select an org-profile preset
--no-org-profile Ignore org-profile defaults
--help, -h Show full help and exit
Run `/appsec-advisor:audit-security-requirements --help` for details.
--requirements, --output, --org-profile, --preset, --gate-on, and
--priority-floor count as unknown when their value is missing — treat the flag
itself as the offending token in that case.
Find the plugin root:
if [ -z "$CLAUDE_PLUGIN_ROOT" ]; then
# <base-dir> from the invocation line. Never search the filesystem: several
# checkouts may exist and the first hit is arbitrary.
CLAUDE_PLUGIN_ROOT=$(cd "<base-dir>/../.." && pwd)
fi
export CLAUDE_PLUGIN_ROOT
if [ -z "$CLAUDE_PLUGIN_ROOT" ] || [ ! -d "$CLAUDE_PLUGIN_ROOT" ]; then
echo "Error: CLAUDE_PLUGIN_ROOT could not be resolved — install appsec-advisor or set the variable manually." >&2
exit 2
fi
Resolve the active org profile before resolving the requirements source. The
audit report output directory is the application's private directory outside
the repository (or --output <dir>); the resolver writes
.org-profile-effective.json there so the shared requirements resolver and
fetch gate see the same profile state as appsec-analyzer. A developer-authored
catalog stays a repository input: every resolver and fetch call passes
--catalog-dir "$PWD/docs/security" so a local requirements.yaml is still
found. If the private directory cannot be created, print the Error: ... line
and stop; never fall back to docs/security.
if [ -n "$OUTPUT_DIR_OVERRIDE" ]; then
AUDIT_OUTPUT_DIR="$OUTPUT_DIR_OVERRIDE"
mkdir -p "$AUDIT_OUTPUT_DIR" || exit 2
else
AUDIT_OUTPUT_DIR=$(python3 "$CLAUDE_PLUGIN_ROOT/scripts/shared/assessment_location.py" destination --repo "$PWD" --create) || exit 2
fi
CATALOG_DIR="$PWD/docs/security"
ORG_ARGS=()
[ -n "$ORG_PROFILE_OVERRIDE" ] && ORG_ARGS+=(--org-profile "$ORG_PROFILE_OVERRIDE")
[ -n "$PRESET_OVERRIDE" ] && ORG_ARGS+=(--preset "$PRESET_OVERRIDE")
[ "$NO_ORG_PROFILE" = "true" ] && ORG_ARGS+=(--no-org-profile)
python3 "$CLAUDE_PLUGIN_ROOT/scripts/runtime/resolve_org_profile.py" \
--output-dir "$AUDIT_OUTPUT_DIR" \
--emit-file \
"${ORG_ARGS[@]}" >/dev/null
ORG_RESOLVE_EXIT=$?
if [ "$ORG_RESOLVE_EXIT" -ne 0 ]; then
exit "$ORG_RESOLVE_EXIT"
fi
If an org profile is active and its selected preset carries a
requirements.gate block, use it as the default for any gate knob the user
did not set explicitly on the CLI. This runs here — before Step 2.5 / Step 5
— because a preset with mode: enforce turns the audit into a gate, which means
the structured verdict must be built. Precedence stays CLI > preset > built-in
default; a flag the user passed this run is never overwritten.
EFFECTIVE="$AUDIT_OUTPUT_DIR/.org-profile-effective.json"
if [ -f "$EFFECTIVE" ]; then
read PRESET_GATE_MODE PRESET_GATE_ON PRESET_FLOOR < <(python3 - "$EFFECTIVE" <<'PY'
import json, sys
d = (json.load(open(sys.argv[1])).get("defaults") or {}).get("requirements_gate") or {}
print(d.get("mode") or "", d.get("gate_on") or "", d.get("priority_floor") or "")
PY
)
[ "$GATE_MODE_SET" != "true" ] && [ "$PRESET_GATE_MODE" = "enforce" ] && GATE_MODE=true
[ "$GATE_ON_SET" != "true" ] && [ -n "$PRESET_GATE_ON" ] && GATE_ON="$PRESET_GATE_ON"
[ "$PRIORITY_FLOOR_SET" != "true" ] && [ -n "$PRESET_FLOOR" ] && PRIORITY_FLOOR="$PRESET_FLOOR"
fi
When a preset supplied any of these (and the user did not override it), surface
it once in the banner as a Gate : line (Step 1b banner rules) so the
effective policy is visible. Omit it when no preset gate is in effect.
--clear-requirements and --status exit earlyThese two flags are maintenance/inspection modes. Handle them before any
repository scan. If CLEAR_REQUIREMENTS is set, run the gate's clear mode and
exit; the skill does not audit on this invocation:
if [ "$CLEAR_REQUIREMENTS" = "true" ]; then
python3 "$CLAUDE_PLUGIN_ROOT/scripts/requirements/fetch_requirements.py" \
--caller audit-security-requirements --output-dir "$AUDIT_OUTPUT_DIR" \
--catalog-dir "$CATALOG_DIR" \
--plugin-root "$CLAUDE_PLUGIN_ROOT" --clear-requirements
exit 0
fi
Resolve the source first. When the active org profile configures a requirements
source but sets requirements.standalone_audit.enabled: false, that governance
decision wins — even if a local docs/security/requirements.yaml is present.
A passive in-repo catalog must not silently defeat the org policy. Only an
explicit per-run override — --requirements <src> or --demo (which resolve to
source cli / demo) — bypasses the block.
REQ_SOURCE_ARGS=(--caller audit-security-requirements --output-dir "$AUDIT_OUTPUT_DIR" --catalog-dir "$CATALOG_DIR" --plugin-root "$CLAUDE_PLUGIN_ROOT")
[ -n "$REQUIREMENTS_URL_OVERRIDE" ] && REQ_SOURCE_ARGS+=(--requirements "$REQUIREMENTS_URL_OVERRIDE")
[ "$DEMO" = "true" ] && REQ_SOURCE_ARGS+=(--demo)
REQ_SOURCE_JSON=$(python3 "$CLAUDE_PLUGIN_ROOT/scripts/requirements/resolve_requirements_source.py" "${REQ_SOURCE_ARGS[@]}")
REQ_SOURCE_KIND=$(printf '%s' "$REQ_SOURCE_JSON" | python3 -c "import json,sys;print(json.load(sys.stdin).get('source') or '')")
ORG_AUDIT_DISABLED=$(printf '%s' "$REQ_SOURCE_JSON" | python3 -c "import json,sys;print(str(json.load(sys.stdin).get('org_audit_disabled',False)).lower())")
# Block when the org disabled the standalone audit, unless an explicit per-run
# source (--requirements / --demo → source cli/demo) overrides it.
if [ "$ORG_AUDIT_DISABLED" = "true" ] && [ "$REQ_SOURCE_KIND" != "cli" ] && [ "$REQ_SOURCE_KIND" != "demo" ]; then
echo "✗ Requirements audit is disabled by the active org profile (standalone_audit.enabled: false)." >&2
if [ "$REQ_SOURCE_KIND" = "local" ]; then
echo " A local docs/security/requirements.yaml does not override this org policy." >&2
fi
echo " Override for this run with --requirements <src> or --demo, or set" >&2
echo " requirements.standalone_audit.enabled: true in the org profile." >&2
exit 2
fi
Resolution precedence (highest first): explicit --requirements <src> >
--demo > local docs/security/requirements.yaml > active org-profile source
(honouring standalone_audit.enabled) > legacy config > remembered source via
the plugin cache. A local repo catalog overrides the org profile and is
surfaced in the banner. The gate also writes a .requirements-resolution.json
sidecar describing the chosen source — render it as the startup banner.
Pass the user's source flags straight through to the gate. --status is a
no-fetch inspection mode; every other invocation loads the catalog:
FETCH_ARGS=(--caller audit-security-requirements --output-dir "$AUDIT_OUTPUT_DIR" --catalog-dir "$CATALOG_DIR" --plugin-root "$CLAUDE_PLUGIN_ROOT")
if [ -n "$REQUIREMENTS_URL_OVERRIDE" ]; then
FETCH_ARGS+=(--requirements "$REQUIREMENTS_URL_OVERRIDE")
else
FETCH_ARGS+=(--require)
fi
[ "$DEMO" = "true" ] && FETCH_ARGS+=(--demo)
[ "$UPDATE" = "true" ] && FETCH_ARGS+=(--update)
[ "$CACHE_ONLY" = "true" ] && FETCH_ARGS+=(--cache-only)
[ "$STATUS_MODE" = "true" ] && FETCH_ARGS+=(--status)
python3 "$CLAUDE_PLUGIN_ROOT/scripts/requirements/fetch_requirements.py" "${FETCH_ARGS[@]}"
REQ_FETCH_EXIT=$?
REQ_RESOLUTION="$AUDIT_OUTPUT_DIR/.requirements-resolution.json"
REQUIREMENTS_YAML="$AUDIT_OUTPUT_DIR/.requirements.yaml"
First-run / no-source handling (REQ_FETCH_EXIT == 2). The gate aborts with
exit 2 only when requirements were requested but nothing loaded — no configured
source, and an empty cache. This is the genuine first-run case. Do not proceed
to scan. Print the guidance below, then offer to run against the packaged demo
catalog. When running interactively you may ask the user with
AskUserQuestion whether to re-run with --demo; otherwise just print the hint
and exit 2:
No security requirements are configured yet, and the plugin cache is empty.
Tell the audit where your requirements live, one of:
• --requirements https://appsec.int.example.com/appsec-requirements.yaml (fetch + remember)
• drop a catalog at docs/security/requirements.yaml (local repo file)
• configure an org profile (see docs/org-profiles.md)
Or try it now against the bundled example catalog:
/appsec-advisor:audit-security-requirements --demo
For any other non-zero, non-2 exit, propagate it:
if [ "$REQ_FETCH_EXIT" = "2" ]; then
exit 2 # after printing the first-run guidance above
fi
if [ "$REQ_FETCH_EXIT" -ne 0 ]; then
exit "$REQ_FETCH_EXIT"
fi
The banner tells the user which catalog is in effect, how current it is, and
which requirements are about to be graded. renderers/render_requirements_banner.py
composes it from the run state; run it now and print its stdout verbatim as
the first user-visible output of the skill — nothing precedes it, no preamble,
no "loading…" narration, and nothing is re-derived or reworded here.
BANNER_ARGS=(--output-dir "$AUDIT_OUTPUT_DIR")
[ -n "$CATEGORY_FILTER" ] && BANNER_ARGS+=(--filter "$CATEGORY_FILTER")
[ -n "$PRESET_GATE_LINE" ] && BANNER_ARGS+=(--gate-line "$PRESET_GATE_LINE")
python3 "$CLAUDE_PLUGIN_ROOT/scripts/renderers/render_requirements_banner.py" "${BANNER_ARGS[@]}"
Set PRESET_GATE_LINE beforehand to <enforce|advisory> · gate-on=<fail|partial> · floor=<MUST|SHOULD|MAY> (from preset <name>) when — and only when — a preset
gate took effect (Step 1b "Seed the gate policy from the active preset") and the
user did not override it on the CLI; leave it empty otherwise.
Print it BEFORE Step 2 grading. Grading 60+ requirements takes minutes, and
a user who cannot see the catalog and the scope has no idea what is being
tested. Do not batch output until the end. Skip the banner entirely under
--quiet.
If demo is set in the resolution, the banner stamps the catalog line — every
report the run writes must then carry the same DEMO stamp (Steps 3a/4a).
After the banner, scan silently except for the Step 2 batch progress lines.
If STATUS_MODE is set, print the banner and stop here — do not scan the
repository, do not render findings, exit 0.
Use REQUIREMENTS_YAML as the loaded catalog in Step 1c. The skill cannot
produce meaningful results without this file.
From the loaded YAML, extract all requirements by iterating categories[].requirements[]. For each requirement record:
requirements[].id (e.g. SEC-SQL)categories[].idcategories[].titlerequirements[].textrequirements[].url (may be null in fallback mode)requirements[].priority (MUST / SHOULD / MAY)Apply the category filter from Step 1a if set.
If the YAML contains a top-level blueprints[] section, build a blueprint index:
For each blueprint in blueprints[], iterate its sections[]. For each section that has a references[] list, map every referenced requirement ID to the blueprint section:
blueprint_map[ref.id] → { bp_id, bp_title, section_title, section_url }
This map is used in Step 3b to show relevant blueprint guidance alongside violations.
Locate the assessment directory and read its model — security-assessment.yaml, or threat-model.yaml in a legacy docs/security set. This step is always non-fatal — if the locate call fails or no model file is present or readable, skip silently and continue to Step 2 with an empty req_to_threats map.
ASSESSMENT_DIR=$(python3 "$CLAUDE_PLUGIN_ROOT/scripts/shared/assessment_location.py" locate --repo "$PWD" 2>/dev/null)
Remember which report file sits next to the model (security-assessment.md or threat-model.md) as assessment_report, for the F-NNN links in Steps 3b and 4.
If the file exists and is valid YAML:
meta.generated and store as model_generated (ISO 8601 string, for display).req_to_threats map by iterating threats[]:
violated_requirements array, add an entry for each requirement ID in that array:
req_to_threats[req_id] → [{ f_id, risk, title }, ...]
id field as f_id, risk as the severity label, and title as the short label. Current threat-model.yaml exports use final F-NNN IDs; do not convert them back to internal T-NNN IDs.threats[] is missing or empty, req_to_threats remains empty — no error.This map is used in Step 3b to annotate violations with Threat Register links.
For each requirement, search the codebase for evidence using Grep and Read.
Grade in catalog order, in batches of up to 10 requirements (a batch ends at
a category boundary when one falls earlier). Search once per batch with a
combined Grep where the requirements share a signal, rather than one search
per requirement — the repeated single-requirement round trips are what make this
step take minutes.
After each batch, print exactly one line so the user sees the audit advancing, then continue silently:
[10/63] Frontend Security · ✅2 ⚠️1 ❌6 ❓1
[20/63] Hardening → Secure Data Access · ✅1 ❌9
Shape: [<graded>/<total>] <first category>[ → <last category>] · <tallies>.
List only non-zero tallies, in the order ✅ ⚠️ ❌ ❓ ➖. No other text, no
per-requirement lines, and no progress output at all under --quiet.
Assign one of four statuses:
| Status | Icon | Meaning |
|---|---|---|
| PASS | ✅ | Implementation found; code demonstrably satisfies the requirement |
| PARTIAL | ⚠️ | Some implementation exists but incomplete, inconsistent, or only partial |
| FAIL | ❌ | No implementation found, or existing code contradicts the requirement |
| UNVERIFIABLE | ❓ | Cannot be verified from static analysis alone |
| NOT_APPLICABLE | ➖ | The requirement does not apply to this repo (e.g. XML-parser hardening in a repo that parses no XML). Set in_scope: false; never gates. |
Collect for each requirement:
text from the catalog (Step 1c). Carry it through to the outputs unchanged — never replace it with the derived title or a paraphrase.[path:line](vscode://file/ABSOLUTE_REPO_ROOT/path:line)text (what it demands) and (b) the matched blueprint section from blueprint_map[<id>] (Step 1c-ii), the catalog's prescribed "how". The model's contribution is to map that prescribed control onto the exact file / function / config key in the repo (which call to change, which setting to set) — not to introduce a mechanism or requirement the catalog does not call for, and not generic best-practice padding. Reference exact file and function names; when a blueprint matched, name it and let the blueprint link carry the detail. For console output keep it to one to three concise lines; for Markdown output, include a short before/after code block when meaningful code evidence exists. If neither the requirement nor a blueprint prescribes a specific mechanism, state the minimal concrete change that satisfies the demand here and say so — do not over-specify.S (< 1 hour, isolated change), M (half day, several files), or L (multi-day, architectural change)Run this step ONLY when save_json or gate_mode is set — those are the two
modes that actually consume the structured verdict (--json exposes it, --gate
gates on it). For everything else — a plain run, or --md / --pdf (whose
human report is authored directly from your grading in Step 4a) — skip this
step and Step 5 entirely: do NOT build a verdict file and do NOT write helper scripts.
When it runs, read <base-dir>/verdict-and-gate.md in full now and follow its
Step 2.5. Keep it in context: its Step 5 runs after Step 4.
Print a concise console summary plus only open requirements. "Open" means
FAIL or PARTIAL. Do not print PASS or UNVERIFIABLE items anywhere in
the console output. Keep PASS and UNVERIFIABLE in internal stats and JSON
output only.
Colour primitive. This report is shown in the conversation as rendered Markdown, where raw ANSI escapes do not colourise. The reliable, real-colour indicator is the coloured-circle emoji, so each stats row and each open finding leads with a criticality circle:
| Status | Circle |
|---|---|
| FAIL | 🔴 |
| PARTIAL | 🟡 |
| PASS (stats only) | 🟢 |
| UNVERIFIABLE (stats only) | ⚪ |
This is the same house palette as the Markdown report (Step 4a), so console
and report read identically. Use exactly one circle per line — it carries the
colour; do not add box drawing or background fills. Render the finding title
in **bold** (Markdown bold renders in the conversation). Requirement and
blueprint references are real Markdown links (see Links rule in 3b).
The ANSI escape table below is a fallback for genuine ANSI-terminal / CLI
embedding only (where emoji may be undesirable); in the conversation the
coloured circles + Markdown bold/links carry the colour. When NO_COLOR is set
or colour is unavailable, the circles still render as distinct glyphs.
ANSI color rules:
| Field | Color |
|---|---|
● dot / [FAIL] | bold red (\033[1;31m) |
● dot / [PARTIAL] | bold yellow (\033[1;33m) |
● dot / PASS (stats only) | green (\033[32m) |
○ dot / UNVERIFIABLE (stats only) | dim gray (\033[2m) |
MUST | red (\033[31m) |
SHOULD | yellow (\033[33m) |
MAY | cyan (\033[36m) |
| Requirement ID | cyan (\033[36m) |
| Short title (first line) | bold (\033[1m) |
Effort S | green (\033[32m) |
Effort M | yellow (\033[33m) |
Effort L | red (\033[31m) |
Links (catalog URLs, F-NNN reference) | cyan (\033[36m) |
Field labels (Finding, Risk, etc.) | dim gray (\033[2m) |
| Paths / line references | dim gray (\033[2m) |
Keep the colour budget restrained: the dot + status + priority + ID anchor the
line, the bold title carries the eye, and the Effort badge mirrors the
red/yellow/green risk scale. Do not add box drawing, accent stripes, or
background colours — the report must stay clean and copy-paste friendly. When
colour is unavailable (NO_COLOR or unknown terminal) render the identical
text and glyphs without escapes.
The catalog source/provenance was already shown in the Step 1b banner, so the
results header does not repeat the title or the Source line — it opens the
verdict. Counts: if Step 2.5 ran (an artifact/gate was requested), use the
requirements/requirements_report.py stats line verbatim. Otherwise (plain run) tally them
directly from your grading.
Render this as a fixed block (see "No prose summary of the verdict" above): one header line, then one aligned count row per status, each led by its colour circle:
Results · <Project Name> · <total> requirements<, filter: <filter> if set>
🔴 FAIL <fail>
🟡 PARTIAL <partial>
🟢 PASS <pass>
⚪ UNVERIFIABLE <unverifiable>
➖ NOT_APPLICABLE <not_applicable> (omit this row when not_applicable is 0)
Use the canonical status token UNVERIFIABLE — the same label used in the
Step 2 status table. Do not invent synonyms such as "ignored" or "untestable".
Right-align the counts in a single column as shown. After this block go straight
to the open-requirement blocks (Step 3b) — no interstitial summary prose.
If demo: true, print one line immediately above the Results line (not
merged into it, not expanded into a paragraph):
⚠ DEMO catalog — results do not reflect your organization's requirements.
If not_applicable > 0, you MAY add a single terse scope line directly under the
block — at most one sentence, e.g. Scope: 13 N/A — no IaC/Terraform and no real LLM component in this repo. Never a multi-line rationale, never a list.
Print all open requirements (FAIL and PARTIAL) sorted in this order:
FAIL before PARTIALMUST, then SHOULD, then MAYIf there are zero open requirements, print:
Open Requirements
None. All verifiable requirements passed.
Otherwise print Open Requirements, a one-line legend, then one block per open
requirement:
Open Requirements
🔴 failed · 🟡 partial — worst-first (FAIL before PARTIAL, MUST before SHOULD)
Per-finding block:
🔴 MUST · `SEC-SQL` — **Parameterized SQL Queries**
> Use parameterized SQL/HQL queries or ORM methods for database queries to prevent SQL injection.
Finding : raw request input reaches sequelize.query() in routes/search.ts:23
Risk : attacker-controlled search terms can alter the SQL predicate
Evidence: routes/search.ts:23
Fix : replace string interpolation with bound parameters.
Use `sequelize.query(sql, { replacements: { term } })` or the ORM query builder.
Effort : M
Links : https://reqs.example/sec-sql · [F-014](/home/dev/.local/share/appsec-advisor/assessments/shop-1a2b3c4d/security-assessment.md#f-014)
Rules:
text from the catalog (parsed in Step 1c) as a Markdown
blockquote > …. This is the actual demand being graded — never the derived
title and never a paraphrase. If the catalog text is very long (> ~240 chars),
trim to its first sentence and append … for the console only; the Markdown
and JSON outputs keep the full text. If a catalog entry has no text, omit the
blockquote.<CIRCLE> <PRIORITY> · — **<Short Title>**. The two
axes are kept distinct and non-redundant: the circle is the audit verdict
(status) and the priority is the requirement's obligation — an orthogonal
pair, exactly like InSpec (result + impact) or Prowler (status + severity).
<CIRCLE> is the status: 🔴 for FAIL, 🟡 for PARTIAL. Do not also
print the word FAIL/PARTIAL on the line — it would duplicate the circle
(the list is already failures-only). The one-line legend above explains the
circles, so colour is never the sole signal.<PRIORITY> is MUST / SHOULD / MAY, followed by a middle dot ·.<ID> as an inline code span, then an em dash — before the
title.**bold** — it is
the visual anchor of the block.path:line entries. If there is no direct file evidence, use a concise process/config evidence phrase such as no .github/workflows SAST job found.text (the demand quoted above) and, when blueprint_map[<id>] matched (Step 1c-ii), follow that blueprint section's prescribed approach — name it and rely on the blueprint link for the "how". Do not substitute an unrelated or contradicting remedy.S, M, or L (in an ANSI terminal, colour it green / yellow / red).requirement /
blueprint label word in front (the URL is the link; a label plus URL just reads
doubled in most renderers). Order and sources:
requirements[].url (parsed in Step 1c). Omit the whole Links line when the catalog entry has no url and there is nothing else to link.section_url from blueprint_map[<id>] (Step 1c-ii), when one matched — appended as a second bare URL.[F-NNN](<ASSESSMENT_DIR>/<assessment_report>#f-nnn) (absolute path), only when req_to_threats[<id>] is non-empty (Step 1.5). Keep the F-NNN label here — it is an identifier pointing at a local anchor, not a web URL.
Separate the present links with ·.--- separators, box drawing, or accent stripes — keep it copy-paste clean.Always print one footer block after open requirements:
Output
Save Markdown: /appsec-advisor:audit-security-requirements --md
Save PDF : /appsec-advisor:audit-security-requirements --pdf
Save JSON : /appsec-advisor:audit-security-requirements --json
Save all : /appsec-advisor:audit-security-requirements --save
If one or more reports were saved in Step 4, print the written file paths instead of the save-command reminder.
When save_md, save_pdf or save_json is set, read <base-dir>/save-reports.md
in full and follow it. It holds the Markdown report template (4a), the JSON copy
(4b) and the PDF conversion (4c).
When no output flag is set, the save-command reminder is already covered by the
Step 3 footer. Do not print a second Save: line.
Only when the verdict was written in Step 2.5 (an artifact/gate was
requested). Follow Step 5 of verdict-and-gate.md, already loaded in Step 2.5.
A plain console run has no verdict file — skip this step entirely.
Note: the analyzed repository does not need to tag its code with requirement IDs. The [<ID>] bracket form (e.g. [SEC-CSP-1]) is just one optional convention; many teams use a different scheme or none, and finding zero inline references is fine — the loaded catalog is always graded in full from codebase evidence regardless of inline tags. The skill requires a requirements catalog to be available, resolved in this priority order: explicit --requirements, --demo, a local docs/security/requirements.yaml, the active org-profile source, the legacy configured source, or the remembered source served from the plugin cache. On a fresh machine with none of these, the skill prints first-run guidance and offers --demo instead of failing cryptically (Step 1b). A successful fetch from a configured/remembered source remembers the URL (.cache/requirements.source.json) and refreshes the cache; a fresh cache (< 30 days) is reused without a network round-trip, while a stale cache triggers a refresh attempt that falls back to the cache when the source is unreachable.
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./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./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