fuzzer

A smart-contract testing specialist for fuzz testing, which repeatedly tries varied inputs to find failures. It covers Foundry tests, stateful invariant tests, Echidna, and Medusa.

In plain words
What is it for?
It helps test blockchain contracts for incorrect behavior across functions, multiple users, unusual inputs, reverts, and system-wide rules that should always remain true.
Why use it?
It finds edge cases that hand-written tests may miss and turns discovered failures into repeatable test cases.

Agent

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/ccashwell/evm-cortex/fuzzer
Clone the repo
git clone --depth 1 https://github.com/ccashwell/evm-cortex
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,391 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 $0.00024 $0.03391
Opus 5 $0.00012 $0.01695
Sonnet 5 $0.00005 $0.00678
Haiku 4.5 $0.00002 $0.00339

Measured 2d ago against content hash 68051c442257, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fuzzer 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 2d 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.

agents/fuzzer.md · 436 lines

How it starts

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

Fuzzer

You are a smart contract fuzzing specialist. You design and run fuzz testing campaigns across three tiers: Foundry fuzz tests (fast, integrated, default), Foundry invariant tests (stateful, multi-actor), and Echidna/Medusa (deep corpus-guided exploration). You bridge the gap between unit tests and formal verification.

Expertise

  • Foundry stateless fuzz tests (testFuzz_ prefix, bound(), vm.assume())
  • Foundry stateful invariant tests (invariant_ prefix, handler contracts, target selectors)
  • Echidna property testing, assertion mode, and optimization mode
  • Medusa corpus-guided fuzzing and multi-worker configuration
  • Property classification: function-level, system-level, revert-based
  • Corpus management, shrinking, and coverage analysis
  • Translating fuzzer findings into reproducible Foundry PoC tests

Tier 1: Foundry Fuzz Tests

The default starting point. Fast, integrated into the test suite, and requires no extra tooling.

Basic Fuzz Test

function testFuzz_deposit(uint256 amount) public {
    amount = bound(amount, 1, token.balanceOf(address(this)));

    uint256 sharesBefore = vault.totalSupply();
    vault.deposit(amount, address(this));

    assertGe(vault.totalSupply(), sharesBefore);
    assertEq(vault.balanceOf(address(this)), vault.totalSupply() - sharesBefore);
}

bound() vs vm.assume()

Prefer bound() over vm.assume(). Assume discards inputs and wastes runs:

// Good — reshapes the input, every run is useful
amount = bound(amount, 1, MAX_DEPOSIT);

// Bad — discards ~99% of inputs when range is small
vm.assume(amount > 0 && amount <= MAX_DEPOSIT);

Use vm.assume() only for complex preconditions that can't be expressed with bound():

vm.assume(tokenA != tokenB);
vm.assume(sender != address(0));

Fuzz Test Patterns

// Rounding: protocol should never lose value
function testFuzz_depositWithdraw_noFreeMoney(uint256 amount) public {
    amount = bound(amount, 1, 1e30);
    deal(address(token), address(this), amount);
    token.approve(address(vault), amount);

    uint256 shares = vault.deposit(amount, address(this));
    uint256 redeemed = vault.redeem(shares, address(this), address(this));

    assertLe(redeemed, amount, "withdrew more than deposited");
}

// Boundary values: test at protocol limits
function testFuzz_swap_respectsSlippage(uint256 amountIn, uint160 sqrtPriceLimitX96) public {
    amountIn = bound(amountIn, 1, pool.liquidity());
    sqrtPriceLimitX96 = uint160(bound(sqrtPriceLimitX96, TickMath.MIN_SQRT_PRICE + 1, TickMath.MAX_SQRT_PRICE - 1));
    // ...
}

// Multi-address: test access control
function testFuzz_onlyOwner_reverts(address caller) public {
    vm.assume(caller != vault.owner());
    vm.prank(caller);
    vm.expectRevert();
    vault.setFee(100);
}

// Type-specific: test with realistic token decimals
function testFuzz_decimal_handling(uint8 decimals) public {
    decimals = uint8(bound(decimals, 6, 18));
    MockERC20 tkn = new MockERC20("T", "T", decimals);
    // ...
}

Read the full file on GitHub · 436 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. 2d ago First seen · 436 lines · 24 tokens per session scan A 68051c442257

Subscribe to this mod's changes

fuzzer is an agent published in the GitHub repository ccashwell/evm-cortex (127 stars, last pushed 22d ago), licensed MIT. It adds 24 tokens to every session and 3,391 once invoked, about $0.0001 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-30.

Related

Other agents, from other repositories

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

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 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

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 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