agentleFS
michael-muirmichael-muir/agentic-dev-kit/skills/adversarial-attack/SKILL.md

adversarial-attack

Skill1 starsChanged 13 days agoMITView on GitHub

Use when red-teaming a change as the adversary, for a catalogue of attack angles, property-based, fuzz and mutation techniques per stack, and the rule that every finding is a failing test or a reproduction.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Done when: every survivor is killed, or marked equivalent with a reason.

    line 15
  2. Distinctive:

    Done when: every section is marked tried or not applicable in your findings.

    line 20
  3. Distinctive:

    When a tool isn't installed, write an example-based test for the same idea, and note the missing tool for the retro.

    line 56
  4. Distinctive:

    Stop at full catalogue coverage, or 5 critical/major findings, whichever comes first.

    line 60

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

Adversarial attack

Assume the code is wrong. Your output is tests that fail (findings) and tests that pass (hardening). Write every test so it would still be correct for any valid implementation.

Steps

  1. Start from the leads. Mutation survivors and advisory failures from the verifier point at weakly tested code. For each survivor, write a test that kills it, or explain why the mutant is equivalent. Done when: every survivor is killed, or marked equivalent with a reason.
  2. Hunt for spec loopholes. For each AC, ask how an implementation could satisfy its words and still be wrong for the user. Write that case as a test. Done when: each AC has at least one loophole test, or a note saying why there isn't one.
  3. Work through the catalogue below, choosing the sections that apply to the change. Done when: every section is marked tried or not applicable in your findings.
  4. Generalise with properties. Where behaviour has an invariant (round-trips, ordering, idempotency, conservation, bounds), write a property-based test, and fuzz parsers or decoders of untrusted input. Done when: each invariant you identified has a property test, or a note on why not.
  5. Review the existing tests for the smells in test-driven-slices: tautological, assertion-free, over-mocked. Each one is a finding against the test, routed to the test-designer.
  6. File findings. Each failing test becomes one finding row, with the test name as its evidence.

Attack catalogue

AreaTry
Boundaries0, 1, max, max+1, empty, single element, exactly-at-limit, off-by-one on ranges
Absencenull/None/nil, missing keys, empty strings vs missing, optional fields omitted
Sizevery large inputs, deep nesting, long strings, many small items
TextUnicode (combining marks, RTL, emoji, normalisation), case, whitespace, line endings, encodings
Numbersnegative, zero, NaN, ±Inf, overflow, underflow, precision loss, rounding modes, unit mix-ups, integer division
Timetime zones, DST transitions, leap days/seconds, clock going backwards, epoch boundaries, timeouts
Order & concurrencydifferent orderings, duplicates, concurrent calls, re-entrancy, races on shared state, cancellation
Failure pathsdependency errors, partial writes, retries, idempotency of retried operations, cleanup after failure
Statecalling things in the wrong order, calling twice, using after close/dispose, stale caches
Platformpath separators, case-insensitive file systems, permissions, locale, 32/64-bit, endianness
Contractswhat callers of a changed interface assume (types, error behaviour, performance)
Hostile inputinjection-shaped strings, path traversal (../), oversized headers, malformed encodings

Tools by stack

StackProperty-basedFuzzMutation
pythonhypothesisatherismutmut
javascript / typescriptfast-checkjsfuzz / fast-checkStrykerJS
rustproptest, quickcheckcargo-fuzzcargo-mutants
gorapid, testing/quickgo test -fuzzgo-mutesting
dotnetFsCheck, CsCheckSharpFuzzStryker.NET
cppRapidChecklibFuzzer, AFL++Mull
lualua-quickcheck——

When a tool isn't installed, write an example-based test for the same idea, and note the missing tool for the retro.

Limits

  • Stop at full catalogue coverage, or 5 critical/major findings, whichever comes first.
  • Behaviour changes are the implementer's job. If a fix would require the spec to change, file needs-human.

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.