Webhook Agent Gate: the one-action pattern and a ten-check handler scan (free sample)
by PaperChaseWebb
From Webhook Agent Gate: the five-step pattern that makes a webhook act once, six rules for agents that build or touch webhook code, and a read-only script that runs ten checks on a Python or JavaScript handler, from parsing before the signature check and plain string compares to missing duplicate protection and refunds inside the request.
- Price
- Free
- Difficulty
- Beginner
- Setup
- 5 min
- Format
- .md file
webhook-agent-gate-one-action-pattern-ten-check-handler-scan-free-sample.md · 23 KB · direct download, no signup
What you end up with
You know whether your webhook handler can act twice on one event, or act on a forged one, and what to fix first.
What you get
- The one-action pattern in five steps
- Six rules for agents that build or touch webhook code
- hook_mini.py: ten read-only checks for a handler file
Who it is for
Anyone who wants a quick check of a webhook handler before it starts an agent or moves money.
Works with
Solid chips: the agent is named in this listing's own tools list. Dashed chip: Plain Markdown, so it also pastes into other agents such as Grok Bot, Hermes, OpenClaw or Muse. We list those as compatible by format only, not as tested.
Tools needed
Cost to run: Free.
Time to result: About five minutes to a first scan
Sample prompts, free to use
Run python3 hook_mini.py on [handler file]. For every finding, explain the risk in one line and the smallest fix. Do not edit the file.
The rules and script are in the file.
Free preview of the file
# Webhook Agent Gate: the safe webhook pattern for agents and a ten-check handler scan (free sample) Version 1.0, 2026-10-31. By PaperChaseWebb. For anyone who lets a Stripe, GitHub, form or store webhook start an agent, a Zap, an n8n flow or a refund. One page and one Python 3 script, standard library only, read-only: it reads handler files and never runs them, sends nothing and reads no secrets. Tested with 3 unit tests and 41 planted faults (each of the ten checks fires) on Linux with Python 3.13, 3.12, 3.11, 3.9 and 3.8, and run on the eight Python and Node webhook servers in Stripe's public accept-a-payment samples. ## The pattern Providers send the same event more than once, out of order, and keep retrying when your handler is slow or answers with an error. That is normal and documented. It turns into a problem the day the handler starts an agent or moves money, because each copy can run the action again. The safe shape: 1. Verify the signature on the raw body, before parsing. A failed check answers 400 and stops. A missing secret stops the server from starting; it never means "skip the check". 2. Store the event once, under a unique key on the event id (INSERT OR IGNORE or ON CONFLICT DO NOTHING). Answer 200 quickly, including to a duplicate. 3. Do the work later, in a worker. Each action gets a key built from what it acts on (refund:ch_123), not from the event or the run. Two copies of one event, or two events about the same charge, land on one row. 4. Money and a
Test record
- Date
- Oct 31, 2026
- What was run
- tests/test_mini.py (clean handler, bought starter findings, file input) and the copy extracted from the sample page. Linux, Python 3.13, 3.12, 3.11, 3.9 and 3.8.
- Result
- 3 passed, 0 failed on all five versions; the extracted copy was identical to the tested script and found 8 findings in the made-up starter.
- Not run
- Replay against a running handler (the full kit's replay.py does that).
Copied from this item's dated test notes. What was not run stays in.
Worth knowing
- The sample checks handler files only. The gate, the ledger, the owner step, replay.py and the 17-check checker with event map, ledger and rules checks are in the full kit.
- On 2026-10-31 hook_mini.py passed 3 unit tests on Linux with Python 3.13, 3.12, 3.11, 3.9 and 3.8, and the copy extracted from the sample page was identical to the tested script.
Questions
Does it change my files?
No. It reads the files you name and prints findings. It opens no network connection and never runs your code.
What is in the full kit?
A webhook gate with four signature schemes, a ledger that acts once per action, owner-approved refunds, replay.py, a 17-check checker tested on Stripe's public samples, and setup for Grok Bot, Claude Code, Codex and Hermes. $29.
Details
Version 1.0 · Updated Oct 31, 2026 · Markdown version of this page
License: Personal and commercial use. Download terms
Related

Webhook Agent Gate: one action per event, owner-approved refunds and a checker for your handler
A small gate between Stripe, GitHub, form or store webhooks and the agent they start. It checks the signature on the raw body, stores each event once, keys every action on what it acts on so a duplicate, a retry or a crash cannot do it twice, and holds refunds for the owner at a terminal the agent cannot use. Includes replay.py to fire duplicates and forged deliveries at your own handler, and a read-only checker for handlers, event maps, ledgers and agent rules.

MCP Server Kit: the two-step write pattern and a ten-check tool scan (free sample)
From MCP Server Kit: the two-step write pattern that keeps an MCP server from changing anything until the owner approves, six rules for agents that build or install servers, and a read-only script that runs ten checks on a tool list or agent config, from write tools marked read only and poisoned descriptions to live keys and unpinned packages.

n8n with AI Agents: the Approve pattern and a ten-check workflow scan (free sample)
From n8n with AI Agents: the three-node Approve pattern that stops an n8n workflow sending anything until you click, five rules for agents that draft workflows, and a read-only script that runs ten checks on any workflow export, from open webhooks and keys in the file to sends with no Approve step.