agentleFS
GabrieleDattileGabrieleDattile/agent-superpowers/skills/security/adversarial-duelist/SKILL.md

adversarial-duelist

Skill1 starsChanged 15 days agoMITView on GitHub

Adversarial red-team auditor. Generates malicious edge-case payloads, fuzzing vectors, and exploit scripts against proposed code before merge.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the function ungracefully crashed (Unhandled Exception / Fatal Error), the agent MUST harden the code with proper input sanitization, …

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

⚔️ Skill: Adversarial Duelist (The Code Arena)

1. When to Trigger (Routing)

  • TRIGGER WHEN:
    • The user requests a security review, pre-commit audit, or PR evaluation.
    • The user asks "is this code safe?", "can this break?", or "find edge cases in this function".
  • DO NOT TRIGGER WHEN:
    • The user is asking for simple formatting, docstrings, or boilerplate generation.

2. Fundamental Philosophy

"Standard AI code reviewers leave polite, superficial comments. Adversarial Duelist acts as an offensive red-teamer attempting to crash and break your logic."


3. Operational Protocol

Phase 1: Attack Surface Extraction

  1. Inspect the function signature, argument types, and external dependencies.
  2. Identify input boundaries: integers, strings, floats, collections, file descriptors.

Phase 2: Autonomous Fuzzing & Exploit Generation

Execute the Duelist engine against the target module:

python skills/security/adversarial-duelist/scripts/duelist.py --target <path_to_file.py> --func <function_name>

The duelist systematically tests against 6 attack vectors:

  1. Integer & Float Boundaries: 0, -1, -2^63, NaN, +Infinity, 1e308.
  2. String Explosions: Null bytes (\x00), 100,000-char strings, SQL/Command injection snippets, Unicode right-to-left overrides, zero-width spaces.
  3. Type & Structural Poisoning: Passing None, unexpected dicts, circular references.
  4. Concurrency & Race Conditions: Rapid async invocations.
  5. Division & Underflow: Zero division, precision loss.
  6. Resource Exhaustion: Memory pressure payloads.

Phase 3: Remediate or Defend

  1. Review the generated exploit report.
  2. If the function ungracefully crashed (Unhandled Exception / Fatal Error), the agent MUST harden the code with proper input sanitization, type guarding, and bounded constraints.
  3. Re-run Duelist until the defense score is 100% PASS.

4. Guardrails & Negative Constraints

  • ❌ NEVER approve code that throws raw unhandled exceptions on unexpected input.
  • ❌ NEVER assume inputs are sanitized upstream without explicit assertions or Pydantic validation.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.