Path Resolution
<skill-root> means the directory containing this SKILL.md.
- Resolve
scripts/... and references/... relative to <skill-root>, not the caller's current working directory.
- When executing local helpers, use explicit paths such as
<skill-root>/scripts/....
Constraints
- Do NOT modify implementation code. Write only the adversarial report and attack test files. Reason: modifying code during adversarial verification would invalidate evidence and conflate "finding vulnerabilities" with "fixing them."
- Attack test files must be clearly separated from production tests (use a dedicated directory or naming convention such as
*_adversarial_test.*).
Precondition Check
Before starting adversarial verification, confirm preconditions:
- Verify all target files exist in the repository. If any target file is missing, stop as
BLOCKED.
- Verify
<skill-root>/references/attack-vectors.md exists. If missing, stop as BLOCKED.
Tier-Based Invocation Policy
| Risk Tier |
Invocation |
Minimum Probes |
Attack Scope |
| Critical |
Mandatory |
3 |
All applicable categories |
| Sensitive |
Mandatory |
2 |
Category 1 (Input Boundary) + most relevant 1 additional category |
| Standard (impl) |
Conditional Mandatory |
1 |
Most relevant 1 category |
| Standard (non-impl) |
Optional |
— |
User-selected |
Implementation file definition: Standard (impl) applies when at least one target file is implementation code rather than docs/tests-only scaffolding.
Input
- Target files (required): Repository-relative paths of files to verify.
- Change description (required): Description of what changed, its impact scope, and the rationale behind the change.
- Risk tier (optional): Critical / Sensitive / Standard. Defaults to Sensitive when omitted.
Procedure
- Generate Header: Write verification metadata directly:
- Mode: adversarial-verify
- Target Files: list of target files
- Risk Tier: Critical / Sensitive / Standard
- Verified At: UTC timestamp (obtain via
date -u +"%Y-%m-%dT%H:%M:%SZ")
- Load Context: Read all user-provided target files and
<skill-root>/references/attack-vectors.md (including the optional ## Maintainer-Curated Extension Vectors section when present).
- Select Attack Categories: Based on the change description and the content of target files, select applicable attack categories from the reference. Do NOT blindly apply all categories — choose only those relevant to the actual change. If
## Maintainer-Curated Extension Vectors contains vectors matching the change characteristics, include them as additional probe targets regardless of the selected categories.
- Execute Attacks: For each selected attack vector:
- Design a concrete test or probe targeting the implementation.
- Create the test file (naming:
*_adversarial_test.* or in a dedicated adversarial/ directory).
- Execute the test/probe.
- Record: attack vector, test file, command executed, exit code, result (DEFENDED / VULNERABLE), evidence.
- Enforce tier minimums:
- Critical: execute at least 3 probes.
- Sensitive: execute at least 2 probes including Category 1 (Input Boundary) and the most relevant additional category.
- Standard (impl): execute at least 1 probe using the most relevant category.
- Standard (non-impl): no minimum probe count.
[required] vector coverage — this step defines coverage obligations; attack-vectors.md provides the tags. [required] marks minimum-coverage vectors; non-required vectors remain applicable and should be probed when relevant — the tag does not grant skip permission.
- Critical / Sensitive: cover all
[required] vectors within selected categories. For each: (a) execute a probe, or (b) document why it is non-applicable. Uncovered [required] vectors without documented rationale → Overall Verdict: FAIL.
- Standard (impl): cover the single most relevant
[required] vector in the selected category.
- Standard (non-impl): no
[required] coverage obligation.
- Coverage Gate: Verify
[required] vector coverage procedurally:
- Identify all
[required] vectors within selected categories from attack-vectors.md.
- Cross-reference each against the Attack Summary table entries.
- Standard: no
[required] coverage obligation — proceed.
- Sensitive / Critical: if any
[required] vector is uncovered without documented N/A rationale → Overall Verdict: FAIL.
- Compute Verdict:
Overall Verdict: PASS only when ALL attack probes result in DEFENDED and the Coverage Gate is PASS. Any VULNERABLE or coverage FAIL → Overall Verdict: FAIL.
- Write Report: Output to
adversarial-report.md.
- Write file paths in repository-relative form. If you mention a skill helper command, render it as
scripts/<name>.sh, never an absolute filesystem path.
Edge Cases
- Zero applicable attack categories: If the Selection Guidance table yields no relevant categories for the change area, apply tier-based fallbacks:
- Critical / Sensitive: categories 1 (Input Boundary) and 2 (Error Handling) as baseline.
- Standard (impl): category 1 (Input Boundary) only (1 probe minimum).
- Standard (non-impl): user judgment (optional invocation).
Record the rationale for limited applicability in the report.
- Missing test infrastructure: If the project lacks a test framework or runtime needed to execute attack probes, stop as
BLOCKED and request the user to set up the necessary infrastructure. Do not skip attacks because tooling is absent.
- Attack probe budget:
- Critical: minimum 3 probes, target 3-8, cap at 15.
- Sensitive: minimum 2 probes, target 2-4, cap at 8.
- Standard (impl): minimum 1 probe, target 1-2, cap at 4.
- Standard (non-impl): choose probe count by scope and document rationale.
On FAIL
- Report specific vulnerabilities with reproduction steps.
- The user is responsible for fixing identified vulnerabilities and re-running adversarial verification.
- If the run reveals a reusable attack vector, record it in the adversarial report and propose a separate skill-maintenance task. Do NOT edit
<skill-root>/references/attack-vectors.md during adversarial verification.
Output Format
# Adversarial Verification Report
## Verification Metadata
- **Mode**: adversarial-verify
- **Target Files**: [list]
- **Risk Tier**: [tier]
- **Verified At**: [UTC timestamp]
- **Overall Verdict**: PASS | FAIL
## Attack Summary
| # | Category | Attack Vector | Required? | Test File | Command | Exit Code | Result | Evidence |
|---|----------|--------------|-----------|-----------|---------|-----------|--------|----------|
| 1 | [category] | [vector] | yes/no | [file] | `[command]` | [code] | DEFENDED/VULNERABLE | [brief evidence] |
## Vulnerabilities Found
<!-- Only present when Overall Verdict is FAIL -->
| # | Attack Vector | Severity | Reproduction | Suggested Fix |
|---|--------------|----------|--------------|---------------|
| 1 | [vector] | [critical/high/medium] | [steps] | [suggestion] |
## Decision
- Adversarial verification: PASS/FAIL
- Reason: [rationale]
1---2name: adversarial-verify3description: Adversarial verification of code changes — probes target files for vulnerabilities through edge cases, error paths, security boundaries, and concurrency attacks. Use when you want to stress-test implementation correctness or validate defensive robustness before shipping.4---56## Path Resolution78- `<skill-root>` means the directory containing this `SKILL.md`.9- Resolve `scripts/...` and `references/...` relative to `<skill-root>`, not the caller's current working directory.10- When executing local helpers, use explicit paths such as `<skill-root>/scripts/...`.1112## Constraints1314- Do NOT modify implementation code. Write only the adversarial report and attack test files. Reason: modifying code during adversarial verification would invalidate evidence and conflate "finding vulnerabilities" with "fixing them."15- Attack test files must be clearly separated from production tests (use a dedicated directory or naming convention such as `*_adversarial_test.*`).1617## Precondition Check1819Before starting adversarial verification, confirm preconditions:20211. Verify all target files exist in the repository. If any target file is missing, stop as `BLOCKED`.222. Verify `<skill-root>/references/attack-vectors.md` exists. If missing, stop as `BLOCKED`.2324## Tier-Based Invocation Policy2526| Risk Tier | Invocation | Minimum Probes | Attack Scope |27|-----------|------------|----------------|--------------|28| Critical | Mandatory | 3 | All applicable categories |29| Sensitive | Mandatory | 2 | Category 1 (Input Boundary) + most relevant 1 additional category |30| Standard (impl) | Conditional Mandatory | 1 | Most relevant 1 category |31| Standard (non-impl) | Optional | — | User-selected |3233**Implementation file definition**: Standard (impl) applies when at least one target file is implementation code rather than docs/tests-only scaffolding.3435## Input3637- **Target files** (required): Repository-relative paths of files to verify.38- **Change description** (required): Description of what changed, its impact scope, and the rationale behind the change.39- **Risk tier** (optional): Critical / Sensitive / Standard. Defaults to Sensitive when omitted.4041## Procedure42431. **Generate Header**: Write verification metadata directly:44 - **Mode**: adversarial-verify45 - **Target Files**: list of target files46 - **Risk Tier**: Critical / Sensitive / Standard47 - **Verified At**: UTC timestamp (obtain via `date -u +"%Y-%m-%dT%H:%M:%SZ"`)482. **Load Context**: Read all user-provided target files and `<skill-root>/references/attack-vectors.md` (including the optional `## Maintainer-Curated Extension Vectors` section when present).493. **Select Attack Categories**: Based on the change description and the content of target files, select applicable attack categories from the reference. Do NOT blindly apply all categories — choose only those relevant to the actual change. If `## Maintainer-Curated Extension Vectors` contains vectors matching the change characteristics, include them as additional probe targets regardless of the selected categories.504. **Execute Attacks**: For each selected attack vector:51 - Design a concrete test or probe targeting the implementation.52 - Create the test file (naming: `*_adversarial_test.*` or in a dedicated `adversarial/` directory).53 - Execute the test/probe.54 - Record: attack vector, test file, command executed, exit code, result (DEFENDED / VULNERABLE), evidence.55 - Enforce tier minimums:56 - Critical: execute at least 3 probes.57 - Sensitive: execute at least 2 probes including Category 1 (Input Boundary) and the most relevant additional category.58 - Standard (impl): execute at least 1 probe using the most relevant category.59 - Standard (non-impl): no minimum probe count.60 - `[required]` vector coverage — this step defines coverage obligations; `attack-vectors.md` provides the tags. `[required]` marks minimum-coverage vectors; non-required vectors remain applicable and should be probed when relevant — the tag does not grant skip permission.61 - Critical / Sensitive: cover **all** `[required]` vectors within selected categories. For each: (a) execute a probe, or (b) document why it is non-applicable. Uncovered `[required]` vectors without documented rationale → `Overall Verdict: FAIL`.62 - Standard (impl): cover the **single most relevant** `[required]` vector in the selected category.63 - Standard (non-impl): no `[required]` coverage obligation.645. **Coverage Gate**: Verify `[required]` vector coverage procedurally:65 - Identify all `[required]` vectors within selected categories from `attack-vectors.md`.66 - Cross-reference each against the Attack Summary table entries.67 - Standard: no `[required]` coverage obligation — proceed.68 - Sensitive / Critical: if any `[required]` vector is uncovered without documented N/A rationale → `Overall Verdict: FAIL`.696. **Compute Verdict**: `Overall Verdict: PASS` only when ALL attack probes result in DEFENDED and the Coverage Gate is PASS. Any VULNERABLE or coverage FAIL → `Overall Verdict: FAIL`.707. **Write Report**: Output to `adversarial-report.md`.718. Write file paths in repository-relative form. If you mention a skill helper command, render it as `scripts/<name>.sh`, never an absolute filesystem path.7273## Edge Cases7475- **Zero applicable attack categories**: If the Selection Guidance table yields no relevant categories for the change area, apply tier-based fallbacks:76 - Critical / Sensitive: categories 1 (Input Boundary) and 2 (Error Handling) as baseline.77 - Standard (impl): category 1 (Input Boundary) only (1 probe minimum).78 - Standard (non-impl): user judgment (optional invocation).79 Record the rationale for limited applicability in the report.80- **Missing test infrastructure**: If the project lacks a test framework or runtime needed to execute attack probes, stop as `BLOCKED` and request the user to set up the necessary infrastructure. Do not skip attacks because tooling is absent.81- **Attack probe budget**:82 - Critical: minimum 3 probes, target 3-8, cap at 15.83 - Sensitive: minimum 2 probes, target 2-4, cap at 8.84 - Standard (impl): minimum 1 probe, target 1-2, cap at 4.85 - Standard (non-impl): choose probe count by scope and document rationale.8687## On FAIL8889- Report specific vulnerabilities with reproduction steps.90- The user is responsible for fixing identified vulnerabilities and re-running adversarial verification.91- If the run reveals a reusable attack vector, record it in the adversarial report and propose a separate skill-maintenance task. Do NOT edit `<skill-root>/references/attack-vectors.md` during adversarial verification.9293## Output Format9495```markdown96# Adversarial Verification Report9798## Verification Metadata99100- **Mode**: adversarial-verify101- **Target Files**: [list]102- **Risk Tier**: [tier]103- **Verified At**: [UTC timestamp]104- **Overall Verdict**: PASS | FAIL105106## Attack Summary107108| # | Category | Attack Vector | Required? | Test File | Command | Exit Code | Result | Evidence |109|---|----------|--------------|-----------|-----------|---------|-----------|--------|----------|110| 1 | [category] | [vector] | yes/no | [file] | `[command]` | [code] | DEFENDED/VULNERABLE | [brief evidence] |111112## Vulnerabilities Found113114<!-- Only present when Overall Verdict is FAIL -->115116| # | Attack Vector | Severity | Reproduction | Suggested Fix |117|---|--------------|----------|--------------|---------------|118| 1 | [vector] | [critical/high/medium] | [steps] | [suggestion] |119120## Decision121122- Adversarial verification: PASS/FAIL123- Reason: [rationale]124```