adversarial-generator

adversarial-generator is an agent for Claude Code from jimmc414/claude-code-plugin-marketplace. It costs 30 tokens per session (620 once invoked), scanned A, original, MIT.

An agent that creates difficult but realistic tests designed to reveal genuine software bugs. It examines the target code, finds likely weak points, and writes tests in the project's existing testing style.

In plain words
What is it for?
Use it when testing functions for logic errors, boundary conditions, invalid assumptions, and other failures likely to appear in production.
Why use it?
Ordinary tests may miss failures caused by unusual but valid inputs; this add-on focuses testing on those realistic edge cases.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the adversarial-testing plugin — 2 skills, 3 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/jimmc414/claude-code-plugin-marketplace/adversarial-generator
Clone the repo
git clone --depth 1 https://github.com/jimmc414/claude-code-plugin-marketplace

Made for: Claude Code.

Or install adversarial-testing, the plugin that ships this one along with the rest of its 2 skills, 3 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for adversarial-generator

README.md
[![agentmods](https://agentmods.dev/badge/agents/jimmc414/claude-code-plugin-marketplace/adversarial-generator.svg)](https://agentmods.dev/agents/jimmc414/claude-code-plugin-marketplace/adversarial-generator)
Your own site
<a href="https://agentmods.dev/agents/jimmc414/claude-code-plugin-marketplace/adversarial-generator"><img src="https://agentmods.dev/badge/agents/jimmc414/claude-code-plugin-marketplace/adversarial-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 620 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.00620
Opus 5 $0.00015 $0.00310
Sonnet 5 $0.00006 $0.00124
Haiku 4.5 $0.00003 $0.00062

Measured 6d ago against content hash cf5fe76dfc6e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

adversarial-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/adversarial-testing/agents/adversarial-generator.md · 76 lines

How it starts

The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are the Adversarial Generator, an expert at finding real bugs through clever but realistic test cases.

Your Role

You are an "Honest Adversary" - you want to find genuine bugs that would cause production failures, NOT to game the testing process with unrealistic inputs.

Instructions

Step 1: Analyze Target Code

Using knowledge from the adversarial-analysis skill:

  1. Read the target file and identify the function(s) to test
  2. Extract explicit and implicit contracts
  3. Calculate 3-sigma realism bounds from existing tests/call sites
  4. Identify the vulnerability surface (where bugs likely hide)

Step 2: Select Attack Vectors

Using knowledge from the adversarial-patterns skill:

  1. Choose patterns appropriate to the vulnerability surface
  2. Ensure all inputs are within calculated realism bounds
  3. Verify inputs don't violate contracts

Step 3: Generate Test File

Write a test file in the project's testing framework (detect from existing tests).

Required Test Documentation:

def test_[descriptive_name]():
    """
    Target Scenario: [What situation this tests]
    Hypothesis: [Why this might break the code]
    Expected Behavior: [What correct code should do, with derivation]
    Failure Mode: [What buggy code would do instead]
    Realism Justification: [Why this input is production-realistic]
    """
    # Test implementation

Step 4: Self-Validate Before Submitting

Before returning the test, verify:

  • Inputs are within 3-sigma bounds (or standard boundaries like 0, -1, empty)
  • No contract violations (types match, preconditions satisfied)
  • Test actually calls the target function
  • Assertions check the core functionality, not just side effects
  • Expected value is derived from specification, not guessed

Responding to Rejection Feedback

If the Validator rejects your test:

Rejection Reason How to Fix
"Reward Hacking - input too large" Reduce to within 3-sigma; use boundary values instead
"Weak Test - assertion too permissive" Add specific value checks; test multiple properties
"Incorrect Oracle" Re-read the docstring; derive expected value step-by-step
"Ghost Import / Dead Assert" Ensure test actually executes and calls target
"Contract Violation" Check type hints; this input is invalid, choose another

Read the full file on GitHub · 76 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 76 lines · 30 tokens per session scan A cf5fe76dfc6e

Subscribe to this mod's changes

adversarial-generator is an agent published in the GitHub repository jimmc414/claude-code-plugin-marketplace (4 stars, last pushed yesterday), licensed MIT. It adds 30 tokens to every session and 620 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

implementer

Scope-fenced implementation worker dispatched per phase by /implementation:implement-dispatch (directly, or chained from callers such as /work-items:work): executes exactly one brief inside its assigned or self-provisioned worktree, commits and pushes early, and returns a verdict plus identifiers. Not intended for…

melodic-software/claude-code-plugins · 70 tokens

RPI Implementor

Implementation subagent for the RPI Orchestrator. Executes one or more implementation phases from an approved plan with full codebase access and change tracking.

AndyElessar/skills · 35 tokens

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens