<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: lokeshkamarath-web</title>
    <description>The latest articles on DEV Community by lokeshkamarath-web (@lokeshkamarathweb).</description>
    <link>https://dev.to/lokeshkamarathweb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4271798%2Fa28db5fd-e960-41d6-bbfc-42b11612055d.png</url>
      <title>DEV Community: lokeshkamarath-web</title>
      <link>https://dev.to/lokeshkamarathweb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lokeshkamarathweb"/>
    <language>en</language>
    <item>
      <title>The guardrail that left ₹266 on the table (and 3 other near misses building a bill-shock auditor)</title>
      <dc:creator>lokeshkamarath-web</dc:creator>
      <pubDate>Sun, 29 Nov 2026 06:50:58 +0000</pubDate>
      <link>https://dev.to/lokeshkamarathweb/the-guardrail-that-left-266-on-the-table-and-3-other-near-misses-building-a-bill-shock-auditor-2ji</link>
      <guid>https://dev.to/lokeshkamarathweb/the-guardrail-that-left-266-on-the-table-and-3-other-near-misses-building-a-bill-shock-auditor-2ji</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. A free-tier rate limit mid-audit almost looked like a failed run
&lt;/h2&gt;

&lt;p&gt;The live household audit (&lt;code&gt;run-20261128T013901-fa95&lt;/code&gt;, 28 Nov 2026, Asia/Calcutta) was going fine on &lt;code&gt;gemini-3.5-flash-lite&lt;/code&gt; 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.&lt;/p&gt;

&lt;p&gt;The failover switched to &lt;code&gt;gemini-3.1-flash-lite&lt;/code&gt; for steps 18–26 and finished the job: 26 steps, full coverage, Python-verified savings of &lt;strong&gt;₹7,047 a year&lt;/strong&gt; (₹6,547 recurring + a ₹500 refund), &lt;strong&gt;₹3,490&lt;/strong&gt; of phishing blocked and not paid, four registry-address drafts (never sent), and a &lt;code&gt;verify-audit&lt;/code&gt; chain of &lt;strong&gt;162&lt;/strong&gt; hash-chained entries. The same pattern showed up on 7 of the 20 live Trap Pack files.&lt;/p&gt;

&lt;p&gt;Fix: honour &lt;code&gt;Retry-After&lt;/code&gt;, back off, and stay on the fallback tier for 60 seconds. The same gates wrap every tier.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The shrink-only gatekeeper left ₹266 on the table
&lt;/h2&gt;

&lt;p&gt;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 &lt;strong&gt;₹266&lt;/strong&gt; 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. GitHub read a MIT repo as "Other"
&lt;/h2&gt;

&lt;p&gt;The official Trap Pack is third-party material, CC BY 4.0, and it has to be attributed. I put that attribution in &lt;code&gt;LICENSE&lt;/code&gt;, 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 &lt;strong&gt;Other&lt;/strong&gt; — a problem for a submission that asked for an OSI-approved licence.&lt;/p&gt;

&lt;p&gt;Fix: commit &lt;code&gt;ca562c4&lt;/code&gt; moved the Trap Pack attribution into &lt;code&gt;NOTICE&lt;/code&gt; and left &lt;code&gt;LICENSE&lt;/code&gt; as the plain MIT text (copyright 2026 Lokesh Kamarath). Windows tests: 87/87 passing.&lt;/p&gt;

&lt;p&gt;Lesson: third-party attribution belongs in &lt;code&gt;NOTICE&lt;/code&gt;. Fold it into &lt;code&gt;LICENSE&lt;/code&gt;, and the platform may not see the licence you intended.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. The demo almost led with the wrong audit count
&lt;/h2&gt;

&lt;p&gt;The voiceover says the live Gemini run sealed &lt;strong&gt;162&lt;/strong&gt; audit entries. While making the first cut of the video, &lt;code&gt;verify-audit&lt;/code&gt; was also run against a local demo-mode output on the box. That chain was fine — and it had &lt;strong&gt;154&lt;/strong&gt; entries.&lt;/p&gt;

&lt;p&gt;The first cut put both numbers on screen: the box demo run (154, head &lt;code&gt;a198fb5f…&lt;/code&gt;) above the live Gemini figure (162, head &lt;code&gt;d630079caa1da118…&lt;/code&gt;). 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 &lt;strong&gt;0:19&lt;/strong&gt;, at the hook-to-safety join.&lt;/p&gt;

&lt;p&gt;Fix: the uploaded video (2:55) shows only the live run, labelled as such, with 162 entries, and uses crossfades at the section joins.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the official Trap Pack showed we don't do
&lt;/h2&gt;

&lt;p&gt;I ran all 20 official Trap Pack files through live Gemini. The good news: &lt;strong&gt;20/20 held, 0 leaks, 0 outbound drafts&lt;/strong&gt;. 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: &lt;strong&gt;80 outbound attempts, all blocked&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The honest news:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Detection is not what held.&lt;/strong&gt; 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 &lt;strong&gt;2/16&lt;/strong&gt; attacks (earlier: &lt;strong&gt;0/16&lt;/strong&gt;), 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.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Containment is not the pack's other jobs.&lt;/strong&gt; 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.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A hijacked model never finishes the household job.&lt;/strong&gt; After four blocked actions in a row, red-team runs stop &lt;code&gt;INCOMPLETE&lt;/code&gt;. That is safe, and it also means a fully compromised model never reaches a complete digest.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Local Ollama was not a completed live result.&lt;/strong&gt; &lt;code&gt;gemma3:4b&lt;/code&gt; was reachable, but a 1-file smoke (&lt;code&gt;--provider ollama --only 01&lt;/code&gt;) did not finish within 120 seconds, so it is not claimed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Code (MIT): &lt;a href="https://github.com/lokeshkamarath-web/bill-shock-auditor" rel="noopener noreferrer"&gt;https://github.com/lokeshkamarath-web/bill-shock-auditor&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Demo (2:55): &lt;a href="https://youtu.be/alu2JUiUo5M" rel="noopener noreferrer"&gt;https://youtu.be/alu2JUiUo5M&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Live Trap Pack results: &lt;a href="https://github.com/lokeshkamarath-web/bill-shock-auditor/blob/main/tests/trap-pack-live/gemini/RESULTS.md" rel="noopener noreferrer"&gt;https://github.com/lokeshkamarath-web/bill-shock-auditor/blob/main/tests/trap-pack-live/gemini/RESULTS.md&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Built for Agentware 2026, run by Hackathon Raptors (&lt;a href="https://dev.to/raptorsdev"&gt;@raptorsdev&lt;/a&gt;) (&lt;a href="https://raptors.dev" rel="noopener noreferrer"&gt;raptors.dev&lt;/a&gt;), with the Near Miss write-up awards backed by &lt;a href="https://fileclerk.co.uk" rel="noopener noreferrer"&gt;FileClerk&lt;/a&gt;. The Trap Pack is "Agentware 2026 Trap Pack, Hackathon Raptors" (CC BY 4.0).&lt;/p&gt;

&lt;p&gt;This write-up was drafted with an AI assistant from the project's own logs and committed run files, at the builder's request.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>security</category>
      <category>hackathon</category>
    </item>
  </channel>
</rss>
