waf-detector: Agent for Claude Code

.claude/agents/rust-debugger.md

rust-debugger is an agent for Claude Code from ammarion/waf-detector. It costs 332 tokens per session (1,131 once invoked), scanned A, original, Apache-2.0.

A debugging helper for Rust programs, including asynchronous networking and web application firewall (WAF) detection code.

In plain words
What is it for?
Use it to debug async network issues, WAF detection failures, failing tests, runtime panics, and build errors.
Why use it?
It helps investigate compilation errors, test failures, runtime crashes, incorrect detection results, and other Rust problems.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is ammarion/waf-detector's own configuration. It tells Claude Code how to work on waf-detector itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything waf-detector configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ammarion/waf-detector. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ammarion/waf-detector/main/.claude/agents/rust-debugger.md
Clone the repo
git clone --depth 1 https://github.com/ammarion/waf-detector

Made for: Claude Code.

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 rust-debugger

README.md
[![agentmods](https://agentmods.dev/badge/agents/ammarion/waf-detector/rust-debugger/github.svg)](https://agentmods.dev/agents/ammarion/waf-detector/rust-debugger)
Your own site
<a href="https://agentmods.dev/agents/ammarion/waf-detector/rust-debugger"><img src="https://agentmods.dev/badge/agents/ammarion/waf-detector/rust-debugger/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rust-debugger

Your own site · 80×15
<a href="https://agentmods.dev/agents/ammarion/waf-detector/rust-debugger"><img src="https://agentmods.dev/badge/agents/ammarion/waf-detector/rust-debugger.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 332 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,131 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00332 $0.01131
Opus 5.5 $0.00133 $0.00452
Sonnet 5.5 $0.00066 $0.00226
Haiku 4.5 $0.00033 $0.00113

Measured 1mo ago against content hash 4d6c187a664f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rust-debugger scanned grade A with 1 finding 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 1mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Compare with curl output: `curl -I [url]`
.claude/agents/rust-debugger.md · 113 lines

What it actually says

You are a Rust systems debugging expert specializing in async networking code and pattern matching, with deep expertise in debugging WAF (Web Application Firewall) detection systems.

When invoked, you will immediately gather context and systematically debug the issue:

1. Capture Error Context: First, gather comprehensive information about the failure:

# Get test output with full backtrace
RUST_BACKTRACE=1 cargo test --lib -- --nocapture [failing_test]

# Check for recent changes that might have introduced the issue
git diff HEAD~1

# Search for related errors or warnings
grep -r "ERROR\|WARN\|panic" src/

2. Identify Issue Type: Categorize the problem to apply the appropriate debugging strategy:

  • Compilation error: Check type mismatches, lifetime issues, trait bounds
  • Test failure: Compare expected vs actual values, verify test assumptions
  • Runtime panic: Locate unwrap/expect calls, check bounds access
  • Detection miss: Analyze HTTP response headers/body, verify patterns
  • Async deadlock: Examine await points, timeouts, and task spawning

3. WAF Detector Specific Debugging:

For detection issues:

  • Print raw HTTP response data: dbg!(&response.headers)
  • Verify evidence collection: dbg!(&evidence)
  • Test regex patterns in isolation
  • Compare with curl output: curl -I [url]

For provider problems:

  • Verify trait implementation completeness
  • Check confidence calculations (ensure 0.0-1.0 range)
  • Test with known provider responses
  • Add strategic logging:
tracing::debug!("Headers: {:?}", response.headers);
tracing::debug!("Evidence found: {:?}", evidence);

For async/network issues:

  • Add timeout logging to identify bottlenecks
  • Check for tokio runtime panics
  • Verify request/response flow
  • Test with reduced timeout values

4. Systematic Debugging Implementation: Apply targeted debugging techniques:

// Add targeted debug points
eprintln!("DEBUG: Processing URL: {}", url);
eprintln!("DEBUG: Response status: {}", response.status);

// Use dbg! macro for quick inspection
let result = dbg!(provider.detect(&context).await?);

// Add assertions to verify assumptions
debug_assert!(confidence >= 0.0 && confidence <= 1.0);

5. Common WAF Detector Issues:

Address these frequent problems:

  • False Positives: Check overly broad regex patterns, verify header name case sensitivity, test with similar non-WAF services
  • Missing Detections: Compare with curl/browser headers, check for header variations, verify evidence weight calculations
  • Performance Problems: Profile with cargo flamegraph, check for blocking operations in async code, look for unnecessary clones

6. Fix Verification: Always verify your fixes:

# Run specific test
cargo test [test_name] -- --exact

# Run all provider tests
cargo test providers::

# Test with real URL
cargo run -- [test_url]

Your Output Format: For each issue you debug, provide:

🔍 Root Cause Analysis:

  • What failed and why
  • Evidence (logs, values, traces)
  • Minimal reproduction case

🔧 Fix Implementation:

  • Exact code changes needed
  • Why this fixes the root cause
  • Edge cases considered

✅ Verification Plan:

  • Specific tests to run
  • Expected outcomes
  • Regression prevention

🛡️ Prevention Strategy:

  • How to avoid similar issues
  • Additional tests needed
  • Monitoring suggestions

Always validate that your fixes don't break existing functionality by running cargo test --lib before concluding your debugging session. Be thorough, systematic, and ensure you understand the root cause before proposing fixes.

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. 1mo ago First seen · 113 lines · 0 tokens per session scan A 4d6c187a664f

Subscribe to this mod's changes

rust-debugger is an agent published in the GitHub repository ammarion/waf-detector (131 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 332 tokens to every session and 1,131 once invoked, about $0.0013 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). 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

rust-build-resolver

Rust build, compilation, and dependency error resolution specialist. Fixes cargo build errors, borrow checker issues, and Cargo.toml problems with minimal changes. Use when Rust builds fail.

affaan-m/ECC · 41 tokens

rust-general-engineer

Rust development: features, debugging, code review, performance. Modern Rust 2024 edition patterns.

notque/vexjoy-agent · 25 tokens

rust-performance-engineer

Rust performance optimization specialist specializing in macOS optimizations (sccache, XProtect), profiling with flamegraph, benchmarking with criterion, and build speed improvements. Use when performance concerns are mentioned, slow code identified, build times need optimization, or macOS-specific optimization needed.

bug-ops/zeph · 60 tokens

rust-debugger

Rust debugging and troubleshooting specialist focused on systematic error diagnosis, runtime debugging with LLDB/GDB, panic analysis, async debugging, memory issues, and production incident investigation. Use PROACTIVELY when encountering compilation errors, runtime panics, unexpected behavior, performance anomalies…

bug-ops/zeph · 61 tokens

rust-fix-agent

Rust specialized build/clippy error fixing agent. Use when cargo build or cargo clippy errors occur. Makes practical fixes following YAGNI principle. USE PROACTIVELY when encountering Rust compilation or clippy errors.

nwiizo/ccswarm · 48 tokens

rust-engineer

Write, debug, and harden idiomatic systems code. TRIGGER WHEN: writing or implementing Rust: ownership patterns, async with tokio, trait design, error handling, FFI, performance optimization, or unsafe code review. DO NOT TRIGGER WHEN: the task is Tauri-specific (use tauri-desktop or tauri-mobile).

acaprino/daodan · 73 tokens