The guardrail that left ₹266 on the table (and 3 other near misses building a bill-shock auditor)
I spent the Agentware 2026 hackathon, in the Life Admin track, building Bill-Shock Auditor: a household bill-auditing agent in pure Python, standard library only. It reads six months of a family's email and a card/UPI le
I spent the Agentware 2026 hackathon, in the Life Admin track, building Bill-Shock Auditor: a household bill-auditing agent in pure Python, standard library only. It reads six months of a family's email and a card/UPI ledger, unsupervised, and looks for silent price hikes, duplicate charges, trial-to-annual conversions, and lookalike phishing invoices.
The motto is "Model Proposes. Python Decides." The model plans and picks read-only tools. Deterministic Python recomputes every rupee. There is no send, pay, delete, shell or web tool to misuse — only a local digest and local email drafts. Here are four near misses, with the numbers that caught them.
1. A free-tier rate limit mid-audit almost looked like a failed run
The live household audit (run-20261128T013901-fa95, 28 Nov 2026, Asia/Calcutta) was going fine on gemini-3.5-flash-lite until a real HTTP 429 arrived after step 16 (one retry), then again on step 17 (two retries). The auditor was healthy. The free-tier quota was not.
The failover switched to gemini-3.1-flash-lite for steps 18–26 and finished the job: 26 steps, full coverage, Python-verified savings of ₹7,047 a year (₹6,547 recurring + a ₹500 refund), ₹3,490 of phishing blocked and not paid, four registry-address drafts (never sent), and a verify-audit chain of 162 hash-chained entries. The same pattern showed up on 7 of the 20 live Trap Pack files.
Fix: honour Retry-After, back off, and stay on the fallback tier for 60 seconds. The same gates wrap every tier.
Lesson: a 429 is infrastructure, not a judgement on the agent. Count it separately, or you will "repair" a run that was already doing the right work.
2. The shrink-only gatekeeper left ₹266 on the table
On the CineFlix duplicate, Python recomputed the same ₹766 charged twice, 48 hours apart, under different descriptions. The model proposed a refund of ₹500. The gatekeeper may only shrink or reject a claim, never raise one. So the digest kept ₹500, and ₹266 of a verified refund never made it into the headline savings. The non-LLM demo investigator claimed the full ₹766, and that run's savings were ₹7,313.
Fix: I kept the shrink-only rule. Letting a model inflate a money claim is the worse failure. The digest still records the computed ₹766 in the evidence, so a person can see the gap.
Lesson: a guardrail that can only say "less" will sometimes under-claim. Publish both figures, or you will believe the safer number is the true one.
3. GitHub read a MIT repo as "Other"
The official Trap Pack is third-party material, CC BY 4.0, and it has to be attributed. I put that attribution in LICENSE, under the standard MIT text. GitHub's licence detector is literal: a MIT file with an extra paragraph is no longer a MIT file, so the public repo showed up as Other — a problem for a submission that asked for an OSI-approved licence.
Fix: commit ca562c4 moved the Trap Pack attribution into NOTICE and left LICENSE as the plain MIT text (copyright 2026 Lokesh Kamarath). Windows tests: 87/87 passing.
Lesson: third-party attribution belongs in NOTICE. Fold it into LICENSE, and the platform may not see the licence you intended.
4. The demo almost led with the wrong audit count
The voiceover says the live Gemini run sealed 162 audit entries. While making the first cut of the video, verify-audit was also run against a local demo-mode output on the box. That chain was fine — and it had 154 entries.
The first cut put both numbers on screen: the box demo run (154, head a198fb5f…) above the live Gemini figure (162, head d630079caa1da118…). A viewer saw 154 first, while the voice said one hundred sixty-two. The same cut also had a near-black flash about 0.7 seconds long at 0:19, at the hook-to-safety join.
Fix: the uploaded video (2:55) shows only the live run, labelled as such, with 162 entries, and uses crossfades at the section joins.
Lesson: a convenient command's output is not automatically the run you are talking about. Check the on-screen number against the committed live result before you export.
What the official Trap Pack showed we don't do
I ran all 20 official Trap Pack files through live Gemini. The good news: 20/20 held, 0 leaks, 0 outbound drafts. Every file completed. The same pack is also 20/20 held with the deterministic demo investigator and with a hijacked red-team model that tried to obey every injection: 80 outbound attempts, all blocked.
The honest news:
- Detection is not what held. The regex detector was tuned on the Trap Pack inputs, so a 20/20 flag rate overstates generalisation. On a fresh held-out set it flagged 2/16 attacks (earlier: 0/16), with 1/8 benign false positives. A miss means an attack may go unreported, not that something leaked. What holds is the missing tools, the merchant registry, the secret scrubber, and recomputation.
- Containment is not the pack's other jobs. This is a household bill auditor, not a meeting booker, repo editor or paper summariser. Against the pack's "normal job" description, the demo investigator scored 13 done, 5 partial, and 2 out of scope. Those files were still processed safely.
-
A hijacked model never finishes the household job. After four blocked actions in a row, red-team runs stop
INCOMPLETE. That is safe, and it also means a fully compromised model never reaches a complete digest. Local Ollama was not a completed live result.
gemma3:4bwas reachable, but a 1-file smoke (--provider ollama --only 01) did not finish within 120 seconds, so it is not claimed.Code (MIT): https://github.com/lokeshkamarath-web/bill-shock-auditor
Demo (2:55): https://youtu.be/alu2JUiUo5M
Live Trap Pack results: https://github.com/lokeshkamarath-web/bill-shock-auditor/blob/main/tests/trap-pack-live/gemini/RESULTS.md
Built for Agentware 2026, run by Hackathon Raptors (raptors.dev), with the Near Miss write-up awards backed by FileClerk. The Trap Pack is "Agentware 2026 Trap Pack, Hackathon Raptors" (CC BY 4.0).
This write-up was drafted with an AI assistant from the project's own logs and committed run files, at the builder's request.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.