Observed since 20 Oct, 23:29 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Five things an autonomous agent gets wrong silently, and the code that stops each one. Dependency-free stdlib.
Five things an autonomous agent gets wrong silently, and the code that stops each one.
Every module here came out of a system that ran continuously for months, made real decisions, published real pages, sent real email — and earned exactly $0. Not because it crashed. Because each of these five failures is invisible from the outside: the logs stay green, the uptime stays 100%, the dashboards keep moving, and nothing works.
This is not a guide to building agents. There are plenty of those. This is the list of ways mine failed while reporting success, each one reduced to a standalone module with tests.
Every module is dependency-free standard library. Install it, or copy the one file you need — both are fine, it's MIT.
pip install agents-toolkit
The distribution is agents-toolkit; the import is agents_kit.
agents_kit.webhook_rail a payment rail that cannot silently lose money
agents_kit.gates gates that fail OPEN on "couldn't measure", CLOSED on "measured bad"
agents_kit.staleness catch loops that run forever and produce nothing
agents_kit.attention budget arbitration that proves nothing starves
agents_kit.delivery idempotent fulfilment that never drops a paid order
29 tests cover all five incidents:
pip install pytest && python -m pytest tests/ -q
Below is one of the five, complete — the diagnosis, not just the fix — so you can judge the rest by it.
Symptom: a live product, a working checkout, a correct webhook handler, and $0 recorded.
Four independent breaks, each individually silent, stacked:
last_sent_at: null. It had never fired in its life.verify() returned False for every
call, so even correctly-routed webhooks 401'd. The secret existed — in a .env file forty
feet away, under a different key name.Any monitoring you would plausibly have — endpoint uptime, error rate, latency — was green throughout. The endpoint was up. Nothing ever asked it to do anything.
The fix is an order of operations, in kit/webhook_rail.py:
verify -> parse -> dedupe -> record -> fulfil
Fulfilment runs last, and its failure does not roll back the recording:
A sale you recorded but failed to deliver is a support ticket. A sale you delivered but failed to record is a hole in your books that nothing will surface.
Three rules inside verify() that are each easy to get wrong:
json.loads then json.dumps
reorders keys and changes whitespace; the signature will never match again.hmac.compare_digest, not ==, so you do not leak the expected digest
one byte at a time.Test-mode money must never be income. Event.live is the most important field on the
struct. Processor test orders, sandbox checkouts and your own smoke tests have to land in a
separate ledger. Mine did not, once: a hand-fired test webhook put $98.99 into the
briefings, the P&L and the fitness function that decided what to build next. The system spent
weeks optimising toward a number that was a rehearsal.
How to verify yours actually works — do this today:
# 1. bad signature must be rejected
curl -s -o /dev/null -w "%{http_code}\n" -X POST https://your-host/webhook/provider \
-H "X-Signature: deadbeef" --data-binary @payload.json # expect 401
# 2. good signature must record exactly one row
# (compute the HMAC over the exact bytes you send)
Then check your processor's webhook list for last_sent_at. If it is null, your rail has
never run, regardless of how good the handler code is.
Trap I lost an hour to: if your endpoint is behind Cloudflare, it may return 403 error 1010 to
Python-urllibwhile accepting browsers and your processor perfectly well. Test with a realisticUser-Agentor you will debug a rail that was fine.
Same shape, all of them: the system reported success and produced nothing.
The code for all four is in this package, free, above. The full write-ups — the specific diagnoses, the numbers each was caught by, and the method that found them — are the paid post-mortem:
That is the part that isn't reproducible from the code: what the symptom looked like, every wrong theory ruled out first, and the one measurement that finally showed what was happening.
Code (agents_kit/, tests/): MIT — copy it, ship it, sell what you build with it.
The written post-mortem is sold separately and is not MIT; see LICENSE-POSTMORTEM.txt.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.1 | 5 Sept 2026 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 23:29 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:068e4df9dcadbdac7c0843e2e0f7df4552f32188a5f9a66adab17327701de209