Build a webhook delivery service and have the agent attack its own tests

Sumit Verma had Claude build HookRelay, a FastAPI webhook sender with 396 passing tests, in approved phases; breaking its own code and a final review turned up six real bugs nobody planned.

Done withClaude· Nov 25, 2026

What they did

Sumit Verma wanted a realistic codebase to test Anthropic's pull request review agents on, so he had Claude build one first. He gave it a written brief and thirteen working rules: stay local-only, block private network destinations, never log signing secrets, compare signatures in constant time, test retry limits at their edges, and never call the code secure just because tests pass. Claude worked through a plan and eight phases, from skeleton to signed delivery, retries, security tests, CI and docs, and Verma approved each phase before the next. The result is HookRelay, a Python 3.12, FastAPI and SQLite service of about 1,250 lines of code and 3,070 lines of tests. Claude then removed or weakened one protection at a time and reran the suite to see which test caught it.

How it went

The suite reached 396 passing tests. Six real bugs surfaced while Claude attacked its own work and in a closing review: a token in a URL leaking into HTTP client logs, a body size limit on only one route, validation and the HTTP client parsing the same URL separately, international hostnames crashing delivery, resolved addresses re-sorted as strings, and a database file of secrets readable by every user. All six were fixed with regression tests. Earlier, Claude reported that every deliberate break was caught, until it reread the raw output and found one test failing on a typo before any assertion ran.

Worth knowing

Read the raw test output, not the agent's summary of it; the first perfect score came from a broken test. Verma names only a Claude model, not the harness it ran in, and he used Claude to help draft the post. HookRelay is a local test bench with plaintext secrets and no authentication, not a production service.

Try it

With Claude· 3 parts to fill in

Build [a small service] in [language and framework] in phases: write a plan first, then implement one phase at a time and stop for my approval after each. Follow these rules: [my security and design rules]. Write tests for every rule, including boundary cases. When the suite passes, remove or weaken one protection at a time, rerun the full suite, and record which test failed first, reading the raw test output rather than summarising it. List any bugs you find with evidence and a regression test for each. Never say the code is secure because tests pass; say what was and was not checked.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related