red-team-adversarial
Skill65 starsChanged 3 months agoMITView on GitHub
Adversarial security and resilience analysis — auto-triggered during /review and /test based on task classification. Provides attack surface analysis, boundary testing, auth bypass attempts, dependency chain attacks, and Beast Mode stress testing.
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Severity honesty: Only mark CRITICAL when there is a concrete, exploitable attack path with evidence (file:line).
- Distinctive: line 79
Check for missing locks, atomic operations, or serialization
- Very specific: line 156
HIGH: Does NOT block. MUST record risk decision in Work Log (## Red Team Findings section).
- Very specific: line 163
All Red Team findings MUST be recorded in the Work Log under ## Red Team Findings:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Red Team / Adversarial Testing
Overview
This skill applies adversarial thinking to code changes: instead of checking against a compliance list (that's what security_guardrails.md does), it actively asks "how would an attacker exploit this change?" and "what breaks under extreme conditions?"
It complements — never replaces — the existing OWASP security scan in /review.
Ironclad Rules
- No bypass of governance: This skill executes within
/reviewand/testphases only. It cannot override gates, skip phases, or alter classification. - Severity honesty: Only mark CRITICAL when there is a concrete, exploitable attack path with evidence (file:line). Speculative risks are HIGH at most.
- Additive only: Red Team findings supplement existing security findings — never contradict or override them.
When to Use (Auto-Trigger Matrix)
AI MUST check the task classification from the Work Log and apply this matrix automatically:
Classification │ /review │ /test
──────────────────────┼──────────────────┼─────────────────
tiny-fix │ — │ —
quick-win │ — │ —
hotfix │ Lite Red Team │ Lite Adversarial (1-2 cases)
feature │ Full Red Team │ Adversarial Cases
architecture-change │ Full Red Team │ Adversarial Cases + Beast ModeAuto-trigger logic: During /review or /test, read Classification: from the active Work Log. If classification is hotfix, feature, or architecture-change, execute the corresponding mode below. No user action required.
Modes
Lite Red Team (hotfix)
Minimal overhead (≤300 tokens output). Focus exclusively on the fix point:
- Fix-Point Attack Vector: Does the fix itself introduce a new attack surface? (e.g., a validation fix that changes error behavior, a permission fix that alters fallback logic)
- Regression Attack: Could an attacker exploit the old behavior to bypass the fix? (e.g., race condition in the fix window)
Output: 1-2 findings max, using the Red Team Report format below.
Full Red Team (feature / architecture-change)
Comprehensive adversarial analysis of all changed files:
- Attack Surface Analysis: What new attack vectors does this change expose?
- New endpoints, inputs, or data flows
- Changed trust boundaries
- New external dependencies or integrations
- Boundary Testing: What happens at the extremes?
- Empty/null/undefined inputs
- Maximum-length strings, overflow values
- Special characters, unicode edge cases
- Type confusion (string where number expected, etc.)
- Authorization Bypass Attempts: Can the validation logic be circumvented?
- Direct object reference (IDOR)
- Privilege escalation paths
- Missing checks on alternative code paths
- Token/session manipulation
- Dependency Chain Attacks: Are new dependencies trustworthy?
- Known CVEs in added packages
- Typosquatting risk
- Unmaintained dependencies
- Transitive dependency risks
Output: All findings using the Red Team Report format below.
Beast Mode (architecture-change only)
In addition to Full Red Team, analyze systemic resilience:
- Concurrency: Race conditions, deadlocks, TOCTOU vulnerabilities
- Identify shared mutable state across the change
- Check for missing locks, atomic operations, or serialization
- File:line references for each scenario
- Resource Exhaustion: Memory leaks, unbounded growth, CPU-intensive loops
- Unbounded collections or caches
- Missing pagination or limits
- Recursive calls without depth guards
- Fault Injection: What happens when dependencies fail?
- Database connection drops mid-transaction
- External API returns 500/timeout
- File system full or permissions denied
- Network partition scenarios
Output: Use the Beast Mode Analysis format below.
Output Formats
Red Team Report (embedded in /review output, after Security Findings)
## Red Team Findings
### [CRITICAL|HIGH|MEDIUM|LOW] — [Attack Vector]: [Brief Description]
- **File**: [path:line]
- **Attack Scenario**: [1-2 line attack narrative]
- **Impact**: [What attacker gains]
- **Mitigation**: [Concrete fix]Adversarial Test Cases (embedded in /test output)
## Adversarial Test Cases
| # | Category | Input / Scenario | Expected Behavior | Priority |
|---|----------|------------------|--------------------|----------|
| 1 | Boundary | [extreme input] | [should reject/handle] | HIGH |
| 2 | AuthZ Bypass | [bypass attempt] | [should deny] | CRITICAL |Beast Mode Analysis (architecture-change only, embedded in /test output)
## Beast Mode Analysis
### Concurrency
- [race condition scenarios with file:line references]
### Resource Exhaustion
- [memory/CPU/disk scenarios]
### Fault Injection
- [what happens if dependency X fails? if network drops?]Heading-Scoped Read Note
For phase-entry loading, read only:
Ironclad RulesWhen to Use (Auto-Trigger Matrix)Modes
Load Output Formats, Blocking Rules, Work Log Integration, Red Team Findings, and Common Mistakes on full read or cache miss only.
Blocking Rules (Different from Security Guardrails)
Red Team findings use a graduated blocking model:
│ Security Guardrails (OWASP) │ Red Team Skill
────────────────────┼─────────────────────────────┼──────────────────
CRITICAL │ Hard block │ Hard block
HIGH │ Hard block │ Soft block (record decision)
MEDIUM │ Flag, proceed allowed │ Advisory
LOW │ Informational │ Advisory- CRITICAL: Blocks
/reviewverdict. MUST fix before proceeding. - HIGH: Does NOT block. MUST record risk decision in Work Log (
## Red Team Findingssection). Recommend using/decideto document accept/defer rationale. - MEDIUM / LOW: Advisory only.
Rationale: Red Team analysis is inherently more speculative than OWASP checklist scanning. Hard-blocking on HIGH would create excessive false positives. But CRITICAL findings (e.g., a directly exploitable auth bypass path) must be treated as blocking.
Work Log Integration
All Red Team findings MUST be recorded in the Work Log under ## Red Team Findings:
## Red Team Findings
- [date] /review: [N] findings ([severity breakdown])
- [date] /test: [N] adversarial cases generated
- HIGH risk decisions: [accepted/deferred — see /decide #N]Common Mistakes
- Marking speculative risks as CRITICAL without a concrete file:line attack path.
- Running Full Red Team on tiny-fix or quick-win (wastes tokens, no value).
- Treating Red Team findings as replacements for OWASP checks (they are complementary).
- Skipping Beast Mode on architecture-change (this is where systemic failures hide).
Other versions1 project uses a version of this.
Word for word · 1
- KbWen/agentic-os★ 224100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- api-designSkill
- auth-securitySkill
- database-designSkill
- dispatching-parallel-agentsSkill
- doc-lookupSkill
- frontend-patternsSkill
- karpathy-principlesSkill
- production-readinessSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-git-worktreesSkill
- verification-before-completionSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

