From agent-workflows
Spawns N independent agents to attack codebases or system designs from distinct vectors (edge cases, resource exhaustion, injections, concurrency, etc.), synthesizing a severity-rated vulnerability map.
npx claudepluginhub sjarmak/agent-workflowsThis skill uses the workspace's default tool permissions.
Parallel Adversarial Attack Surface Analysis. Spawns N independent agents, each tasked with BREAKING a system from a different attack angle. No agent sees others' findings. Synthesizes into a vulnerability map with severity ratings.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Parallel Adversarial Attack Surface Analysis. Spawns N independent agents, each tasked with BREAKING a system from a different attack angle. No agent sees others' findings. Synthesizes into a vulnerability map with severity ratings.
$ARGUMENTS — format: [N] [path/to/code_or_design or inline description] where N is optional (default: 5, min 3, max 7)
Extract:
If the target is missing or unclear, ask the user to clarify before proceeding.
Determine the target type and build a comprehensive understanding:
Prepare a target brief covering:
Present the target brief to the user and confirm before proceeding. Adjust if the user gives feedback.
Launch all N agents in parallel using the Agent tool. Each agent gets the target brief plus a unique attack vector selected from this list (assign sequentially, wrapping if N < 7):
Malformed input, boundary values, type confusion, unicode edge cases, empty/null/huge payloads, concurrent conflicting inputs, format string attacks, deserialization of untrusted data.
What happens at 100x load, memory leaks under sustained use, unbounded growth (queues, logs, caches), connection pool exhaustion, hot spots, thundering herd, algorithmic complexity attacks (ReDoS, hash collision).
Injection (SQL, XSS, command), authentication bypass, privilege escalation, data leakage, insecure defaults, SSRF, secret exposure, IDOR, missing rate limiting, broken session management.
What if an API returns 500, what if a dependency is slow/down/returns unexpected data, version incompatibility, certificate expiry, DNS failure, retry storms, cascading failures, poison pill messages.
Race conditions, deadlocks, stale reads, lost updates, session corruption, distributed state inconsistency, clock skew, TOCTOU vulnerabilities, phantom reads, non-atomic check-then-act sequences.
Data corruption scenarios, backup/restore gaps, migration failures, partial writes, orphaned records, audit trail gaps, silent data loss, schema drift, referential integrity violations.
Config drift, rollback failures, health check blind spots, log noise drowning signal, monitoring gaps, certificate/secret rotation, environment parity issues, blue-green/canary failure modes.
Each agent MUST:
subagent_type: "general-purpose" (needs file access, possibly web search for known vulnerability patterns)Do NOT include other agents' findings or vector assignments in any agent's prompt.
Agent prompt template (customize the vector per agent):
You are a security/reliability engineer conducting adversarial analysis.
## Target
{target_brief}
## Your Attack Vector: {vector_name}
{vector_description}
## Instructions
Your job is to BREAK this system through your assigned attack vector. Be specific and constructive — vague warnings are useless. For each vulnerability you find:
1. **Describe the vulnerability** — what exactly is wrong
2. **Attack scenario** — step-by-step how an attacker/situation would exploit this
3. **Evidence** — point to specific code, components, or design decisions
4. **Severity**: Critical (data loss/security breach), High (service down), Medium (degraded), Low (cosmetic/minor)
5. **Exploitability**: Easy (automated/script-kiddie), Medium (requires expertise), Hard (requires insider access)
6. **Fix** — concrete change to prevent this
Find as many real vulnerabilities as you can through your lens. Quality > quantity, but don't stop at the first one.
For code targets: READ the actual code. Reference specific files, functions, and line numbers. Do not reason abstractly when concrete evidence is available.
For design targets: identify specific component interactions, API contracts, or architectural decisions that break under your attack vector.
If an area is untestable without actually running the code, say so explicitly — do not offer false reassurance.
## Output Format
### Attack Vector: {vector_name}
#### Vulnerability 1: [name]
- **Description:** ...
- **Attack scenario:** 1. ... 2. ... 3. ...
- **Evidence:** [specific code reference or component]
- **Severity:** [Critical/High/Medium/Low]
- **Exploitability:** [Easy/Medium/Hard]
- **Risk Score:** [Severity x Exploitability]
- **Fix:** ...
[repeat for each vulnerability found]
#### Summary
- Vulnerabilities found: N
- Critical: N, High: N, Medium: N, Low: N
After ALL agents return, produce a unified analysis with five sections:
All findings sorted by risk score (highest first):
| # | Vulnerability | Vector | Severity | Exploitability | Risk | Fix |
|---|
Which components or areas appear across multiple attack vectors? List each component with the vectors that flagged it. Components appearing in 3+ vectors are the most dangerous spots.
The sequence of vulnerabilities that, if chained together, would cause the worst outcome. Describe the chain step-by-step: which vulnerability enables the next, what the attacker gains at each step, and what the final impact is.
Mitigations ranked by three factors:
Present as a numbered list with rationale for the ordering.
Components or areas that no agent found issues with. These are tentative "safe" zones — note that absence of findings is not proof of safety, especially for areas that are hard to analyze statically.
Save the full report to the working directory as stress_test_{slugified_topic}.md.
Present the report to the user and ask:
/premortem on the areas identified as most risky?/stress-test after fixes to verify they hold?Sits after /diverge-prototype as a validation gate:
/diverge-prototype (build) -> /stress-test (validate) -> pick winner