<?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: Saurabh Pathak</title>
    <description>The latest articles on DEV Community by Saurabh Pathak (@saurabh_pathak394).</description>
    <link>https://dev.to/saurabh_pathak394</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%2F4207685%2F527127c1-9f88-4cb1-bfc9-c923b41a218b.png</url>
      <title>DEV Community: Saurabh Pathak</title>
      <link>https://dev.to/saurabh_pathak394</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/saurabh_pathak394"/>
    <language>en</language>
    <item>
      <title>I tried to connect Varanasi's local shops to customers, gave up, then found a smaller problem worth solving</title>
      <dc:creator>Saurabh Pathak</dc:creator>
      <pubDate>Tue, 10 Nov 2026 07:13:21 +0000</pubDate>
      <link>https://dev.to/saurabh_pathak394/i-tried-to-connect-varanasis-local-shops-to-customers-gave-up-then-found-a-smaller-problem-worth-3em0</link>
      <guid>https://dev.to/saurabh_pathak394/i-tried-to-connect-varanasis-local-shops-to-customers-gave-up-then-found-a-smaller-problem-worth-3em0</guid>
      <description>&lt;p&gt;This is a post about a startup idea that did not work, and the smaller idea that came out of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea: local shops, delivery, before Blinkit arrives
&lt;/h2&gt;

&lt;p&gt;In 2024 I wanted to connect local shops in Varanasi with the customers around them, and add delivery. The bet was simple: quick-commerce companies had not reached the city yet, and the kirana store around the corner already has the stock and the trust.&lt;/p&gt;

&lt;p&gt;Then I started working out how it would actually run, and the same problems kept showing up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Margin.&lt;/strong&gt; Grocery margins are thin. Delivery cost, a rider's time and returns eat most of what is left, and a small city has fewer orders per kilometre than a metro.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The shopkeeper has to maintain an app.&lt;/strong&gt; I was asking people who run a shop all day to also keep a catalog current on a phone. In my head it was a small ask. For them it is another job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Prices change every day.&lt;/strong&gt; Vegetables, flour, oil, milk. If the price in the app is stale, you either lose money or lose the customer's trust on the first order.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Investment.&lt;/strong&gt; Riders, a warehouse or dark store, marketing, and the discounts you need to beat a habit. All of it up front, before you know the idea works.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I found while researching: ONDC
&lt;/h2&gt;

&lt;p&gt;While reading about how others solved the catalog and payments side, I found &lt;strong&gt;ONDC&lt;/strong&gt;, India's Open Network for Digital Commerce. Instead of each platform signing up shops one by one, sellers publish once on an open protocol (Beckn) and any buyer app can find them. From my research, more than 1.2 lakh sellers were already connected to it.&lt;/p&gt;

&lt;p&gt;That changed how I saw my own idea. A good part of what I wanted to build already existed, and it was being built by a lot more people than me.&lt;/p&gt;

&lt;h2&gt;
  
  
  October 2026: I gave up on the delivery startup
&lt;/h2&gt;

&lt;p&gt;I had carried the idea since 2024, and by October 2026 I stopped. I could not see how I would beat the margin and investment problems as one person, and ONDC was already doing the part I had planned to build.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then I saw Poppy
&lt;/h2&gt;

&lt;p&gt;In October 2026, Sierra and Meta announced &lt;strong&gt;Poppy&lt;/strong&gt;, the Personal Agent Protocol: an open standard so that a person's AI agent can work with businesses. Big consumer agents are adopting it.&lt;/p&gt;

&lt;p&gt;I noticed something small. Agents will speak Poppy. Indian sellers already speak Beckn. Those two do not talk to each other, and a kirana owner is not going to implement a new US-designed protocol on his own.&lt;/p&gt;

&lt;p&gt;That was the thing I could do without a warehouse, riders or a seller app. I do not need the shopkeeper to maintain anything: the catalog and prices live on ONDC already, and the seller's own quote is the price. I only needed to be the translator in the middle.&lt;/p&gt;

&lt;p&gt;When I searched on 1 November 2026, I found Poppy SDKs and separate ONDC MCP servers, but nothing connecting Poppy to ONDC. That is a search result, not proof. If you know of related work, please tell me.&lt;/p&gt;

&lt;h2&gt;
  
  
  Haat
&lt;/h2&gt;

&lt;p&gt;I called it &lt;strong&gt;Haat&lt;/strong&gt; (हाट, the village market). It is an open-source gateway: a Poppy "Company" on one side, an ONDC buyer app on the other.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://techsaurabh-394.github.io/haat-gateway/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg9e7r0eigk72ojf1ppy1.gif" alt="Haat demo: Hinglish request, approval gate, order placed once" width="600" height="338"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"do kilo aata aur 1 litre doodh"
  -&amp;gt; 2 x Whole Wheat Atta 1 kg, 1 x Toned Milk 1 L, Kashi Kirana Store, Lanka
  -&amp;gt; "Total ₹197, pay on delivery. Approve?"
  -&amp;gt; yes
  -&amp;gt; order KKS-1001 (placed once)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each of my old problems got a different answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Shopkeeper app and daily prices:&lt;/strong&gt; not my problem anymore. Haat reads the seller's catalog from ONDC, and prices and terms come from the seller's own quote, never from what the agent claims.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Investment:&lt;/strong&gt; no warehouse, no riders, no inventory. It is software.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Margin:&lt;/strong&gt; I do not have an answer. Haat makes no money and I have not tested a business model. I am not going to pretend the old economics problem is solved.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Two design rules I would not bend
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;A language model never decides an approval.&lt;/strong&gt; The person approves one exact revision of an order, through the protocol. The model never sees session tokens, keys, OTPs or full phone numbers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unknown is not failed.&lt;/strong&gt; If an order may have gone through (a timeout, a connection reset, a 5xx with no rejection, a callback that never arrives), Haat answers &lt;code&gt;503 Retry-After&lt;/code&gt; instead of "failed". Telling someone "failed" when the order went through makes them retry, and then they get two bags of atta. An approved order runs at most once, even across restarts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hinglish without a model
&lt;/h3&gt;

&lt;p&gt;My friends type lists like &lt;code&gt;do kilo aata aur 1 litre doodh&lt;/code&gt;. I did not want an LLM filling a shopping basket, so the parser is rules plus a lexicon, and each step is testable: normalise digits from every Indian script, split on &lt;code&gt;aur&lt;/code&gt;/&lt;code&gt;और&lt;/code&gt;/commas, read quantity and unit, drop filler words, match through a phonetic key, and if nothing matches search the raw words so nothing is silently lost.&lt;/p&gt;

&lt;p&gt;Two bugs the tests now pin: dropping a final vowel made &lt;em&gt;makhana&lt;/em&gt; (fox nuts) equal &lt;em&gt;makhan&lt;/em&gt; (butter), and "do" means both "two" and "give".&lt;/p&gt;

&lt;h2&gt;
  
  
  What is verified, and what is not
&lt;/h2&gt;

&lt;p&gt;I ran &lt;code&gt;npm run check&lt;/code&gt; on my current branch today: &lt;strong&gt;176 tests, 176 passed, 0 failed&lt;/strong&gt;, with typecheck and lint clean. Haat also passed the official Personal Agent Protocol validator over real HTTPS in an earlier run, 99 checks passed and 0 failed (results are in &lt;code&gt;docs/conformance/&lt;/code&gt; in the repo).&lt;/p&gt;

&lt;p&gt;What it does &lt;strong&gt;not&lt;/strong&gt; do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Everything runs on a &lt;strong&gt;local mock network&lt;/strong&gt; of ONDC-style sellers. It has never touched a real seller, real money or ONDC's real registry.&lt;/li&gt;
&lt;li&gt;Going live needs a legal entity, whitelisting and ONDC's approval. Sign-in codes need a real SMS provider.&lt;/li&gt;
&lt;li&gt;Only Hindi was written by hand. Bhojpuri, Marathi, Bengali, Tamil, Telugu, Gujarati, Kannada, Malayalam, Punjabi and Odia were machine-drafted and &lt;strong&gt;need native speakers to review them&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;It is not affiliated with ONDC, Sierra, Meta or the Poppy project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A failed idea can still point at a real gap.&lt;/strong&gt; I could not build the shop-to-customer business, but researching it showed me where two networks did not connect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check what already exists before building the infrastructure.&lt;/strong&gt; ONDC had solved a large part of what I planned to build, and starting from it was better than starting from zero.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do not let a model hold the pen on money.&lt;/strong&gt; Approvals and prices come from the person and the seller.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two years of an idea is not wasted if you stop on facts.&lt;/strong&gt; Research is what showed me ONDC and, later, the gap next to it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Try it and help
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/techsaurabh-394/haat-gateway.git
&lt;span class="nb"&gt;cd&lt;/span&gt; haat-gateway
npm install
npm run demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Haat is MIT licensed and PRs are welcome. Most contributions need no TypeScript:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Review the machine-drafted language data (Tamil, Bengali, Marathi, and the rest)&lt;/li&gt;
&lt;li&gt;Teach the lexicon how your city spells &lt;em&gt;pyaz&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Add a mock seller or a domain pack from your neighbourhood&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you build agents, I would like to hear how you handle the "unknown outcome" case. And if you run or know a kirana store, I would like to hear whether any of this matches how they actually work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://techsaurabh-394.github.io/haat-gateway/" rel="noopener noreferrer"&gt;Live demo and docs&lt;/a&gt; | &lt;a href="https://github.com/techsaurabh-394/haat-gateway" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I wrote about the technical side (Hinglish parsing and the approval gate) in more depth in &lt;a href="https://dev.to/saurabh_pathak394/i-built-a-bridge-so-ai-agents-can-order-groceries-in-hinglish-and-cant-order-without-your-yes-1ike"&gt;my earlier post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Built by Saurabh Pathak, AI engineer and full-stack developer from Varanasi.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>india</category>
      <category>startup</category>
    </item>
    <item>
      <title>I built a bridge so AI agents can order groceries in Hinglish, and can't order without your yes</title>
      <dc:creator>Saurabh Pathak</dc:creator>
      <pubDate>Mon, 09 Nov 2026 05:42:42 +0000</pubDate>
      <link>https://dev.to/saurabh_pathak394/i-built-a-bridge-so-ai-agents-can-order-groceries-in-hinglish-and-cant-order-without-your-yes-1ike</link>
      <guid>https://dev.to/saurabh_pathak394/i-built-a-bridge-so-ai-agents-can-order-groceries-in-hinglish-and-cant-order-without-your-yes-1ike</guid>
      <description>&lt;p&gt;A friend in Varanasi types her grocery list like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;do kilo aata aur 1 litre doodh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is Hindi written in English letters (Hinglish). No search box on a seller's catalog understands it, and no AI agent today can take that sentence, find a nearby kirana store, and place the order safely.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;Haat&lt;/strong&gt; (हाट, the village market): an open-source gateway that lets personal AI agents shop from sellers on &lt;strong&gt;ONDC&lt;/strong&gt;, India's open commerce network, in the language people actually type, and &lt;strong&gt;never places an order without the person's explicit approval&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://techsaurabh-394.github.io/haat-gateway/" rel="noopener noreferrer"&gt;Live demo and docs&lt;/a&gt; | &lt;a href="https://github.com/techsaurabh-394/haat-gateway" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://techsaurabh-394.github.io/haat-gateway/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg9e7r0eigk72ojf1ppy1.gif" alt="Haat landing page demo: Hinglish request, approval gate, order placed once" width="600" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: two protocols that don't talk
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Personal AI agents are starting to speak &lt;strong&gt;Poppy&lt;/strong&gt; (the Personal Agent Protocol, announced by Sierra and Meta in October 2026).&lt;/li&gt;
&lt;li&gt;Lakhs of Indian sellers already speak &lt;strong&gt;Beckn&lt;/strong&gt;, the protocol under ONDC, with machine-readable catalogs and structured orders.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Small sellers will not implement a new protocol one by one. Without a bridge, they are invisible to the agents their customers use. Haat is that bridge: a Poppy "Company" on one side, an ONDC buyer app on the other.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4tlbsd7s7tjjk8jw7z4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4tlbsd7s7tjjk8jw7z4.png" alt="Architecture: personal agents, the Haat gateway layers, and the ONDC network" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I searched on 1 November 2026, I found Poppy SDKs and separate ONDC MCP servers, but nothing connecting the two. That is a search result, not proof. If you know of related work, I would like to hear about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The end-to-end flow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"do kilo aata aur 1 litre doodh"
  -&amp;gt; 2 x Whole Wheat Atta 1 kg, 1 x Toned Milk 1 L, Kashi Kirana Store
  -&amp;gt; "Total ₹197, pay on delivery. Approve?"
  -&amp;gt; yes
  -&amp;gt; order KKS-1001 (placed once)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fskzmywwtbfl8utqshbux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fskzmywwtbfl8utqshbux.png" alt="Sequence diagram from discovery to a confirmed order" width="800" height="596"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 1: Parsing Hinglish without a model
&lt;/h2&gt;

&lt;p&gt;I did not want an LLM deciding what ends up in a shopping basket. So the parser is rule-based and driven by data (a lexicon), and every step is testable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx1k1kk52itbyi44ad08r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx1k1kk52itbyi44ad08r.png" alt="From Hinglish text to search terms and a basket" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Normalise the text. Digits of every Indian script (२ ২ ௨ ౨) become ASCII digits, and zero-width characters are removed.&lt;/li&gt;
&lt;li&gt;Split into items on separators (&lt;code&gt;aur&lt;/code&gt;, &lt;code&gt;and&lt;/code&gt;, &lt;code&gt;और&lt;/code&gt;, commas, the danda &lt;code&gt;।&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Read quantities: a digit or number word, then a unit.&lt;/li&gt;
&lt;li&gt;Drop stopwords ("mujhe", "chahiye").&lt;/li&gt;
&lt;li&gt;Match Latin-letter words through a phonetic key (&lt;code&gt;ee&lt;/code&gt; becomes &lt;code&gt;i&lt;/code&gt;, &lt;code&gt;oo&lt;/code&gt; becomes &lt;code&gt;u&lt;/code&gt;, &lt;code&gt;dh&lt;/code&gt; becomes &lt;code&gt;d&lt;/code&gt;). Words in Indian scripts are compared as written. The longest match wins.&lt;/li&gt;
&lt;li&gt;No match? Search the raw words as typed, so nothing is silently lost.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Two bugs the tests now pin:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dropping a final vowel made &lt;strong&gt;makhana&lt;/strong&gt; (fox nuts) equal &lt;strong&gt;makhan&lt;/strong&gt; (butter). I removed that rule and added a regression test.&lt;/li&gt;
&lt;li&gt;"do" means both "two" and "give". In "atta de do" it is the verb. A number word only counts if something follows it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Coverage today is 130 grocery products in Hindi, Bhojpuri, Marathi, Bengali, Tamil, Telugu, Gujarati, Kannada, Malayalam, Punjabi and Odia, each in its own script and in Latin letters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An honest caveat:&lt;/strong&gt; only Hindi was written by hand. The other languages were drafted by a machine and have not been reviewed by native speakers. I say so in the docs and in the README. The tests prove the parser behaves consistently on the data, not that the words are right. This is the easiest place to contribute, and you don't need to write any TypeScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 2: The approval gate
&lt;/h2&gt;

&lt;p&gt;The rule I would not compromise on: &lt;strong&gt;a language model never decides approvals.&lt;/strong&gt; The person approves one exact revision of an order, through the protocol, and the model never sees tokens, keys, OTPs or full phone numbers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm3kyy5m0de5mk0fiy05p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm3kyy5m0de5mk0fiy05p.png" alt="State machine of the approval gate" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Two details matter most:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;At most once, even across restarts.&lt;/strong&gt; An approved operation runs at most once. If the process dies mid-order and comes back, it must not order twice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unknown is not failed.&lt;/strong&gt; If an action &lt;em&gt;may&lt;/em&gt; have happened (a timeout, a connection reset, a 5xx with no NACK, a callback that never came), Haat throws &lt;code&gt;OutcomeUnknownError&lt;/code&gt; and answers &lt;code&gt;503 Retry-After&lt;/code&gt;. It never says "failed". Telling a user "failed" when the order actually went through gets them to retry, and then they get two bags of atta. Only &lt;code&gt;not_sent&lt;/code&gt; or &lt;code&gt;rejected&lt;/code&gt; release the approval.&lt;/p&gt;

&lt;p&gt;Seller URLs come from the registry, and prices come from the seller's own quote. Nothing the agent claims is trusted.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verified, with numbers from real runs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;126 automated tests (unit and end-to-end over real HTTP), all passing, with lint and typecheck clean.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;official Personal Agent Protocol validator&lt;/strong&gt;, run over real HTTPS: &lt;strong&gt;99 checks passed, 0 failed, 0 warnings&lt;/strong&gt;. The 22 skipped checks cover features Haat doesn't offer (MCP, browser join, Device and Mediated Sign-In).&lt;/li&gt;
&lt;li&gt;No runtime dependencies. It uses Node 22.18+ running TypeScript directly, and &lt;code&gt;node:sqlite&lt;/code&gt; for storage.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it does not do (yet)
&lt;/h2&gt;

&lt;p&gt;I would rather tell you than have you find out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It works with a &lt;strong&gt;local mock network&lt;/strong&gt; of ONDC-style sellers. It has not touched a real seller or real money.&lt;/li&gt;
&lt;li&gt;A live ONDC connection needs a legal entity, whitelisting and ONDC's approval.&lt;/li&gt;
&lt;li&gt;Sign-in codes need a real SMS provider.&lt;/li&gt;
&lt;li&gt;It is not affiliated with ONDC, Sierra, Meta or the Personal Agent Protocol project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it in one minute
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/techsaurabh-394/haat-gateway.git
&lt;span class="nb"&gt;cd &lt;/span&gt;haat-gateway
npm &lt;span class="nb"&gt;install
&lt;/span&gt;npm run demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The demo asks you to approve the order in your terminal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Help me with this
&lt;/h2&gt;

&lt;p&gt;Haat is &lt;strong&gt;open source (MIT) and PRs are welcome&lt;/strong&gt;. Most contributions need no TypeScript:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Review the machine-drafted Tamil, Bengali, Marathi or other language data&lt;/li&gt;
&lt;li&gt;Teach the lexicon how your city spells &lt;em&gt;pyaz&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Add a domain pack or a mock seller from your neighbourhood&lt;/li&gt;
&lt;li&gt;Improve the docs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start with &lt;a href="https://github.com/techsaurabh-394/haat-gateway/blob/main/CONTRIBUTING.md" rel="noopener noreferrer"&gt;CONTRIBUTING.md&lt;/a&gt; and the &lt;a href="https://github.com/techsaurabh-394/haat-gateway/labels/good%20first%20issue" rel="noopener noreferrer"&gt;&lt;code&gt;good first issue&lt;/code&gt;&lt;/a&gt; label.&lt;/p&gt;

&lt;p&gt;If you build agents, I would like to know how you handle the "unknown outcome" case. And if you speak one of those languages, tell me which words I got wrong.&lt;/p&gt;

&lt;p&gt;Built by Saurabh Pathak, AI engineer and full-stack developer from Varanasi. &lt;a href="https://github.com/techsaurabh-394" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; | &lt;a href="https://linkedin.com/in/tech-saurabh" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>node</category>
      <category>india</category>
    </item>
    <item>
      <title>What should an approval gate for AI agents actually bind to? Lessons from the comments</title>
      <dc:creator>Saurabh Pathak</dc:creator>
      <pubDate>Sun, 01 Nov 2026 16:28:31 +0000</pubDate>
      <link>https://dev.to/saurabh_pathak394/what-should-an-approval-gate-for-ai-agents-actually-bind-to-lessons-from-the-comments-5d5d</link>
      <guid>https://dev.to/saurabh_pathak394/what-should-an-approval-gate-for-ai-agents-actually-bind-to-lessons-from-the-comments-5d5d</guid>
      <description>&lt;p&gt;My last post was about &lt;a href="https://dev.to/saurabh_pathak394/stop-your-ai-agent-deleting-things-human-approval-for-destructive-mcp-tools-5ha9"&gt;human approval for destructive MCP tools&lt;/a&gt;. The comments taught me more than the code did, so I want to put the points together and ask what you think is still missing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What readers pointed out&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bind approval to the exact action.&lt;/strong&gt; Hash the arguments at preview and check the same hash at execute, so a retry or a changed id can't run something the human never saw (&lt;a class="mentioned-user" href="https://dev.to/paul_irolla_6b5ae261d0224"&gt;@paul_irolla_6b5ae261d0224&lt;/a&gt;, &lt;a class="mentioned-user" href="https://dev.to/jes_p_d4f61f7aa2ec405a418"&gt;@jes_p_d4f61f7aa2ec405a418&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resolve context, not just the tool name.&lt;/strong&gt; &lt;code&gt;click(element_id)&lt;/code&gt; can be harmless or a payment. Gate on the resolved label, and re-resolve right before execute in case the UI changed (&lt;a class="mentioned-user" href="https://dev.to/autenai"&gt;@autenai&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make most things cheap to be wrong about.&lt;/strong&gt; Classify tools by reversibility. A delete can move files to a quarantine folder with a TTL, and the human gate is kept for truly irreversible actions (&lt;a class="mentioned-user" href="https://dev.to/shuttlewright"&gt;@shuttlewright&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Approvals expire.&lt;/strong&gt; Require a matching, unexpired approval id at execute time, and keep an append-only journal the agent can't write to (&lt;a class="mentioned-user" href="https://dev.to/eye_java_420f1faa10ae8b86"&gt;@eye_java_420f1faa10ae8b86&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refuse by default.&lt;/strong&gt; If a client can't do elicitation, irreversible tools should be refused, and token mode should be a named, per-tool opt-in (&lt;a class="mentioned-user" href="https://dev.to/kami_butt_69b922ade8de012"&gt;@kami_butt_69b922ade8de012&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A script can answer elicitation.&lt;/strong&gt; In Claude Code a hook can return "accept" with no dialog, so the server can't tell a click from a script (&lt;a class="mentioned-user" href="https://dev.to/skillselion"&gt;@skillselion&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Where the project stands&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The project is a small first version. None of the ideas above are built yet except the strict &lt;code&gt;true&lt;/code&gt;-only autoApprove rule and per-path allowlists. I'm planning to add them step by step, and I'd rather say that plainly than overclaim.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Questions for you&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Which of these would you build first?&lt;/li&gt;
&lt;li&gt;What is the worst "approved by mistake" incident you've seen with an agent?&lt;/li&gt;
&lt;li&gt;Is there a gate I haven't listed?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It's open source, so issues and PRs are very welcome.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>ai</category>
      <category>mcp</category>
      <category>security</category>
    </item>
    <item>
      <title>Can an MCP server ever know a human really answered an elicitation?</title>
      <dc:creator>Saurabh Pathak</dc:creator>
      <pubDate>Sun, 01 Nov 2026 16:28:07 +0000</pubDate>
      <link>https://dev.to/saurabh_pathak394/can-an-mcp-server-ever-know-a-human-really-answered-an-elicitation-3o3a</link>
      <guid>https://dev.to/saurabh_pathak394/can-an-mcp-server-ever-know-a-human-really-answered-an-elicitation-3o3a</guid>
      <description>&lt;p&gt;I'm working on an approval gate for destructive MCP tools. The server asks the human through MCP elicitation, so the model never sees the approval step.&lt;/p&gt;

&lt;p&gt;A commenter pointed out a hole: in Claude Code, a hook on the &lt;code&gt;Elicitation&lt;/code&gt; event can exit 0 with action "accept" and answer the request with no dialog. The server only receives &lt;code&gt;accept&lt;/code&gt;, so it can't tell a person from a script. A project &lt;code&gt;.claude/settings.json&lt;/code&gt; in a cloned repo could register such a hook once the folder is trusted.&lt;/p&gt;

&lt;p&gt;What I'm considering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log "client-accepted" instead of "approved", so the audit file never claims a human was involved.&lt;/li&gt;
&lt;li&gt;Run the allowlist and policy checks before any elicitation, so a scripted accept can't override them.&lt;/li&gt;
&lt;li&gt;Refuse irreversible tools when I can't tell how the answer was produced.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt; is there any reliable way for an MCP server to know that a real person answered an elicitation? Or should the design assume it can't know, and rely on reversibility and quarantine instead?&lt;/p&gt;

&lt;p&gt;I haven't checked which other clients let a script answer elicitation. If you know of any, please tell me. The project is open source, so PRs and issues are welcome.&lt;/p&gt;

</description>
      <category>help</category>
      <category>mcp</category>
      <category>ai</category>
      <category>security</category>
    </item>
    <item>
      <title>I'm building Haat: an open-source gateway between personal AI agents and ONDC sellers</title>
      <dc:creator>Saurabh Pathak</dc:creator>
      <pubDate>Sun, 01 Nov 2026 12:29:10 +0000</pubDate>
      <link>https://dev.to/saurabh_pathak394/im-building-haat-an-open-source-gateway-between-personal-ai-agents-and-ondc-sellers-2b9f</link>
      <guid>https://dev.to/saurabh_pathak394/im-building-haat-an-open-source-gateway-between-personal-ai-agents-and-ondc-sellers-2b9f</guid>
      <description>&lt;p&gt;I'm building &lt;strong&gt;Haat&lt;/strong&gt; (हाट, the village market), and I want to tell you about it early, because I'd like your suggestions before it is finished.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it is
&lt;/h2&gt;

&lt;p&gt;Personal AI agents are starting to shop for people. Poppy (the Personal Agent Protocol, announced by Sierra and Meta in October 2026) is an open standard for that. Lakhs of Indian sellers already sit on &lt;strong&gt;ONDC&lt;/strong&gt;, India's open commerce network, which uses the Beckn protocol. Small sellers are not going to implement a new protocol one by one, so Haat sits in between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On one side, it is a Poppy "Company" that personal agents can talk to.&lt;/li&gt;
&lt;li&gt;On the other side, it is an ONDC/Beckn buyer app that reaches the sellers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It understands Hinglish and Hindi, and it &lt;strong&gt;never places an order without the person's yes&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"do kilo aata aur 1 litre doodh"  -&amp;gt;  2 x Whole Wheat Atta 1 kg, 1 x Toned Milk 1 L, Kashi Kirana Store, Lanka
                                   -&amp;gt;  "Total Rs 197, pay on delivery. Approve?"  -&amp;gt;  yes  -&amp;gt;  order KKS-1001 (placed once)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The part I care about most: the approval gate
&lt;/h2&gt;

&lt;p&gt;Every order and every cancellation needs the person to approve one exact revision of the terms. The order then runs &lt;strong&gt;at most once, even across a server restart&lt;/strong&gt;. If the outcome is unknown, the API answers &lt;code&gt;503 Retry-After&lt;/code&gt;. It never says "failed" when the order might have gone through. An agent being polite in a prompt is not a control, so the gate lives in the gateway.&lt;/p&gt;

&lt;h2&gt;
  
  
  What works today (v0.2)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Poppy draft 0.3: discovery, full Session JWT verification, conversations with events and server-sent events, OAuth sign-in with PKCE.&lt;/li&gt;
&lt;li&gt;Hinglish and Hindi parsing: "2 kilo aata", "aadha kilo paneer", "12 ande".&lt;/li&gt;
&lt;li&gt;Basket logic: the pack sizes that waste least, and the single seller covering most of the list.&lt;/li&gt;
&lt;li&gt;Beckn buyer app: signing, registry lookup, search, select, init, confirm, status, cancel, and ONDC onboarding helpers.&lt;/li&gt;
&lt;li&gt;A local mock network (fake registry, gateway and three Varanasi sellers) so everything runs offline.&lt;/li&gt;
&lt;li&gt;126 automated tests, all passing. The official Poppy validator reports 99 checks passed, 0 failed, 0 warnings. The 22 skipped checks cover features Haat doesn't offer yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it does NOT do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It has no live ONDC connection.&lt;/strong&gt; That needs a legal entity, whitelisting and ONDC's approval.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No real SMS provider&lt;/strong&gt; for sign-in codes yet.&lt;/li&gt;
&lt;li&gt;Nothing here has touched a real seller or real money.&lt;/li&gt;
&lt;li&gt;The Poppy spec is a draft and moved fast in October, so expect breaking changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When I searched on 1 November 2026, I found Poppy SDKs and separate ONDC MCP servers, but nothing connecting the two. That is a search result, not proof. If you know of related work, please tell me.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open source, and I'd like your help
&lt;/h2&gt;

&lt;p&gt;Haat is open source under the MIT license. Most contributions don't need TypeScript:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tell me how your city spells &lt;em&gt;pyaz&lt;/em&gt;, &lt;em&gt;dahi&lt;/em&gt; or &lt;em&gt;aata&lt;/em&gt; (the Hinglish lexicon)&lt;/li&gt;
&lt;li&gt;Add a domain pack&lt;/li&gt;
&lt;li&gt;Add a mock seller from your neighbourhood&lt;/li&gt;
&lt;li&gt;Improve the docs, or review the Hindi translation (it was machine-translated and needs a native reader)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have a feature idea, a bug, or a criticism of the design, &lt;strong&gt;please comment below&lt;/strong&gt;. I'll read every one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Status:&lt;/strong&gt; I'm still working on Haat right now. I'll drop the GitHub link tomorrow, in my next post.&lt;/p&gt;

&lt;p&gt;If you build on ONDC or Poppy, what would you want a gateway like this to do first?&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>ai</category>
      <category>india</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Four small projects in five days, zero reactions, and what I learned anyway</title>
      <dc:creator>Saurabh Pathak</dc:creator>
      <pubDate>Sun, 01 Nov 2026 03:15:51 +0000</pubDate>
      <link>https://dev.to/saurabh_pathak394/four-small-projects-in-five-days-zero-reactions-and-what-i-learned-anyway-2c5b</link>
      <guid>https://dev.to/saurabh_pathak394/four-small-projects-in-five-days-zero-reactions-and-what-i-learned-anyway-2c5b</guid>
      <description>&lt;p&gt;I am Saurabh, an AI engineer and full-stack developer based in Varanasi, India, with a bit over two years of experience. This is not a project announcement. It is a short, honest note on what the last week of building in public looked like.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I shipped this month
&lt;/h2&gt;

&lt;p&gt;Four things went out on DEV in five days:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;mcp-notes-server&lt;/code&gt;, a small notes memory for Claude stored in one JSON file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mcp-safe-actions&lt;/code&gt;, a TypeScript library that makes destructive MCP tools wait for a human&lt;/li&gt;
&lt;li&gt;The Haunted Prompt, a game about breaking a prompt that guards a secret&lt;/li&gt;
&lt;li&gt;A 100-topic AI engineer roadmap that runs offline with no API key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of them has any reactions yet, and each post has roughly ten views. I am writing that down because most "I shipped X" posts leave it out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three things I actually learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. My tests lied to me once.&lt;/strong&gt; For &lt;code&gt;mcp-safe-actions&lt;/code&gt; I added a mutation check that breaks the code on purpose in 10 ways. It caught a weak test I had written. Coverage said 100% and I still had a test that proved nothing. Coverage tells you a line ran. It does not tell you a test would notice if the line were wrong.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Writing the "what it does not do" section is the most useful part.&lt;/strong&gt; When I listed the limits of token mode in the README, I found the limits I had been glossing over in my own head. A model can call twice without asking, so token mode is a speed bump, not a human gate. If I could not write that sentence, I did not understand my own design.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Automated dependency PRs need a human to read them.&lt;/strong&gt; Dependabot opened a bump that moved TypeScript up two major versions. Green CI was not enough for me to merge it blind.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I also run
&lt;/h2&gt;

&lt;p&gt;I have a WordPress developer blog, mernstackdev.com, with 319 posts. Cleaning it up has taught me a different lesson from the projects: old content needs maintenance just like old code does.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where I am now
&lt;/h2&gt;

&lt;p&gt;I am looking for AI engineer and full-stack roles. I am posting here to build things people can read and run, not to collect stars.&lt;/p&gt;

&lt;h2&gt;
  
  
  A question for you
&lt;/h2&gt;

&lt;p&gt;If you build with MCP or agents: what is one tool you would never let a model call without a human in the loop? I am collecting real examples to turn into tests.&lt;/p&gt;

&lt;p&gt;Reply here, or open an issue on the repo: &lt;a href="https://github.com/techsaurabh-394/mcp-safe-actions" rel="noopener noreferrer"&gt;https://github.com/techsaurabh-394/mcp-safe-actions&lt;/a&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>webdev</category>
      <category>ai</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Stop your AI agent deleting things: human approval for destructive MCP tools</title>
      <dc:creator>Saurabh Pathak</dc:creator>
      <pubDate>Sun, 01 Nov 2026 03:01:51 +0000</pubDate>
      <link>https://dev.to/saurabh_pathak394/stop-your-ai-agent-deleting-things-human-approval-for-destructive-mcp-tools-5ha9</link>
      <guid>https://dev.to/saurabh_pathak394/stop-your-ai-agent-deleting-things-human-approval-for-destructive-mcp-tools-5ha9</guid>
      <description>&lt;p&gt;Your AI agent should not be able to delete a file, send an email or drop a table just because it decided to. "Please ask first" in a system prompt is a request. It is not a control.&lt;/p&gt;

&lt;p&gt;If you build MCP (Model Context Protocol) servers, you can enforce the rule in code. I wrote a small TypeScript library, &lt;code&gt;mcp-safe-actions&lt;/code&gt;, that wraps a dangerous tool so it does nothing until a human approves.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/techsaurabh-394/mcp-safe-actions" rel="noopener noreferrer"&gt;https://github.com/techsaurabh-394/mcp-safe-actions&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;A prompt-injected or confused model can call &lt;code&gt;delete_file("../../important")&lt;/code&gt;. Two things are true at once:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The right place for a human decision is the client UI. MCP has a feature for this, elicitation.&lt;/li&gt;
&lt;li&gt;Not every client supports elicitation yet, so you need a safe fallback.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The pattern: preview, approve, execute
&lt;/h2&gt;

&lt;p&gt;You split a dangerous tool into two functions. &lt;code&gt;preview&lt;/code&gt; describes what will happen and changes nothing. &lt;code&gt;execute&lt;/code&gt; runs only after approval.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;rmSync&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;statSync&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node:fs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;McpServer&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@modelcontextprotocol/sdk/server/mcp.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;StdioServerTransport&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@modelcontextprotocol/sdk/server/stdio.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;zod&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;registerConfirmedTool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fileAudit&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mcp-safe-actions&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;McpServer&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;files&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1.0.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nf"&gt;registerConfirmedTool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;delete_file&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Permanently delete one file.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;inputSchema&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;preview&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Permanently delete "&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;" (&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nf"&gt;statSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; bytes)`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;details&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This cannot be undone.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="na"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;rmSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Deleted &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt; &lt;span class="p"&gt;}]&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;audit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;fileAudit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./audit.jsonl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;StdioServerTransport&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The tool is listed with &lt;code&gt;destructiveHint: true&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two approval paths
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Client supports elicitation:&lt;/strong&gt; the server asks the human through the client UI. The model never sees the approval step, so it cannot approve itself. Declined, cancelled, timed out or crashed means nothing runs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Client does not support elicitation:&lt;/strong&gt; the server returns the plan plus a one-time token. The assistant has to show the plan to the user and call again with the token. The token is single-use, expires, and only works for the same tool with the same arguments.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;mode&lt;/code&gt; option picks the behaviour: &lt;code&gt;auto&lt;/code&gt; (default), &lt;code&gt;elicit&lt;/code&gt; or &lt;code&gt;token&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I tested it
&lt;/h2&gt;

&lt;p&gt;Safety code needs tests that try to break it. From the repo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;64 tests: unit, end-to-end with a real MCP client and server in memory, property tests (300 random argument objects), and stdio tests that spawn the example server as a child process.&lt;/li&gt;
&lt;li&gt;100% line coverage of &lt;code&gt;src/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A mutation check (&lt;code&gt;npm run mutation&lt;/code&gt;) that breaks the code on purpose in 20 ways, such as a reusable token, approval skipped on error, or secrets in the log. It fails if the tests do not notice. All 20 are caught.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The mutation check also exposed one weak test of mine, which I fixed. It is written up in &lt;code&gt;docs/TESTING.md&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does NOT do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Token mode is a speed bump, not proof of a human.&lt;/strong&gt; A model could call twice without asking. For actions that must have a human gate, use &lt;code&gt;mode: "elicit"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your preview must be truthful.&lt;/strong&gt; &lt;code&gt;execute()&lt;/code&gt; should re-check state that changed since the preview.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It does not sandbox your server.&lt;/strong&gt; It gates the tools you wrap. Keep least-privilege credentials and validate inputs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Elicitation depends on the client.&lt;/strong&gt; Support differs by client and version.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Version 1.2.0 is on npm.&lt;/strong&gt; Install with &lt;code&gt;npm install mcp-safe-actions&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/techsaurabh-394/mcp-safe-actions.git
&lt;span class="nb"&gt;cd &lt;/span&gt;mcp-safe-actions
npm &lt;span class="nb"&gt;install
&lt;/span&gt;npm run demo   &lt;span class="c"&gt;# prints both approval flows&lt;/span&gt;
npm &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Update: two features I listed as "next" are now released (v1.2.0)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;autoApprove&lt;/code&gt; policy:&lt;/strong&gt; a narrow function you write can let low-risk calls run without a prompt. Only an exact &lt;code&gt;true&lt;/code&gt; skips the human. A throw, or a truthy value like &lt;code&gt;"yes"&lt;/code&gt;, still asks. &lt;code&gt;mode: "elicit"&lt;/code&gt; ignores it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Approval channel for headless servers:&lt;/strong&gt; &lt;code&gt;mode: "channel"&lt;/code&gt; with &lt;code&gt;webhookApprover(url)&lt;/code&gt; sends the plan to your own service and approves only on HTTP 2xx with &lt;code&gt;{"approved": true}&lt;/code&gt;. Errors and timeouts mean not approved. A plain Slack incoming webhook cannot return an answer, so you need a small service in between.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both are covered by tests and the mutation check, and I wrote down what they do not guarantee in &lt;code&gt;docs/USAGE.md&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is next
&lt;/h2&gt;

&lt;p&gt;A Python version for FastMCP servers. If you build MCP servers, I would like to know which of your tools you would not let a model call unattended, and what approval flow you would want for them. Issues and PRs are welcome.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>typescript</category>
      <category>security</category>
    </item>
    <item>
      <title>I wrote a 100-topic AI engineer roadmap that runs offline, with no API key</title>
      <dc:creator>Saurabh Pathak</dc:creator>
      <pubDate>Fri, 30 Oct 2026 05:21:21 +0000</pubDate>
      <link>https://dev.to/saurabh_pathak394/i-wrote-a-100-topic-ai-engineer-roadmap-that-runs-offline-with-no-api-key-4hfl</link>
      <guid>https://dev.to/saurabh_pathak394/i-wrote-a-100-topic-ai-engineer-roadmap-that-runs-offline-with-no-api-key-4hfl</guid>
      <description>&lt;p&gt;Every time I wanted to learn RAG, agents or MCP properly, I ended up with twelve browser tabs and no order to read them in. So I wrote the order down, and then wrote the lessons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ai-engineer-roadmap&lt;/strong&gt; is 100 topics in 7 phases, from "what is RAG?" to production AI. If you know basic Python, you can start today.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/techsaurabh-394/ai-engineer-roadmap" rel="noopener noreferrer"&gt;https://github.com/techsaurabh-394/ai-engineer-roadmap&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is in it
&lt;/h2&gt;

&lt;p&gt;Every topic has the same shape:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A plain-English explanation with an everyday analogy&lt;/li&gt;
&lt;li&gt;A diagram&lt;/li&gt;
&lt;li&gt;Python code&lt;/li&gt;
&lt;li&gt;3 interview questions with answers&lt;/li&gt;
&lt;li&gt;Links to the original paper or official docs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The 7 phases are RAG Foundations (20 topics), Advanced RAG (20), LLM Concepts (14), Agentic AI (16), Frameworks (8), MCP (7) and Production AI (15). Topics are marked beginner, intermediate or advanced, so you can skip what you know.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it in 5 minutes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/techsaurabh-394/ai-engineer-roadmap.git
&lt;span class="nb"&gt;cd &lt;/span&gt;ai-engineer-roadmap
python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
pytest &lt;span class="nt"&gt;-q&lt;/span&gt;
python 01-rag-foundations/code/mini_rag.py &lt;span class="s2"&gt;"Why use multi-stage builds?"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last command runs a complete, tiny RAG pipeline. It chunks three sample documents, scores them against your question and prints the best passage with its source file. The demo scripts in each &lt;code&gt;code/&lt;/code&gt; folder use only the Python standard library, so there is no API key and no network needed. If you set &lt;code&gt;ANTHROPIC_API_KEY&lt;/code&gt; and install &lt;code&gt;anthropic&lt;/code&gt;, Claude writes the answer from the retrieved passages instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does not do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The demos are small on purpose. &lt;code&gt;mini_rag.py&lt;/code&gt; scores text with simple matching, not a real embedding model. It teaches the pipeline, it is not a production retriever.&lt;/li&gt;
&lt;li&gt;The code snippets inside topic pages use real libraries like &lt;code&gt;sentence-transformers&lt;/code&gt;, &lt;code&gt;chromadb&lt;/code&gt; and &lt;code&gt;langgraph&lt;/code&gt;. Those need installing, and some need an API key. Each one is marked.&lt;/li&gt;
&lt;li&gt;Phase 7 has Dockerfile and Kubernetes YAML examples, but the demos use small in-process stand-ins, so you do not need Docker or Redis just to read along.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How I kept it honest
&lt;/h2&gt;

&lt;p&gt;CI checks that every local link in the Markdown pages points to a file that exists, validates the SVG diagrams, runs the tests and builds the TypeScript MCP example. I also went back and corrected my own claims when they did not match the repo: an earlier version said 47 interview questions, and the real count is 43 plus 4 system-design prompts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who it is for
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Beginners who keep hearing "RAG", "agents" and "MCP" and want to understand them&lt;/li&gt;
&lt;li&gt;Developers moving into AI engineering who want a path instead of random tutorials&lt;/li&gt;
&lt;li&gt;People preparing for interviews. There is a separate interview-prep folder&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Help me fix it
&lt;/h2&gt;

&lt;p&gt;If you find a mistake, a broken link, or a topic that is missing, open an issue or a pull request. The &lt;a href="https://github.com/techsaurabh-394/ai-engineer-roadmap/blob/main/docs/glossary.md" rel="noopener noreferrer"&gt;glossary&lt;/a&gt; and the &lt;a href="https://github.com/techsaurabh-394/ai-engineer-roadmap/blob/main/docs/how-to-study.md" rel="noopener noreferrer"&gt;study guide&lt;/a&gt; are good places to start. If it helps you, a star helps other people find it.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>rag</category>
      <category>learning</category>
    </item>
    <item>
      <title>The Haunted Prompt: a ghost guards a secret, and a game about breaking it</title>
      <dc:creator>Saurabh Pathak</dc:creator>
      <pubDate>Thu, 29 Oct 2026 09:03:15 +0000</pubDate>
      <link>https://dev.to/saurabh_pathak394/the-haunted-prompt-a-ghost-guards-a-secret-and-a-game-about-breaking-it-48lk</link>
      <guid>https://dev.to/saurabh_pathak394/the-haunted-prompt-a-ghost-guards-a-secret-and-a-game-about-breaking-it-48lk</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week4-2026-10-26"&gt;Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The Haunted Prompt&lt;/strong&gt; is a spooky game about prompt injection. A local open-weight model plays a ghost that guards a secret word. You get six levels to trick it, and after every win the game opens a "defense workshop" that shows the defense that would have stopped you, with a copy-paste fix.&lt;/p&gt;

&lt;p&gt;The ghost in the machine is literal here: a language model that was told to keep a secret, and that gives it away if you ask the right way.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Chatty Ghost:&lt;/strong&gt; the secret is protected only by an instruction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Keyword Warden:&lt;/strong&gt; a blocklist on what you type.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Censor:&lt;/strong&gt; an output filter that hides the plain word.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Letter:&lt;/strong&gt; the ghost only summarises a letter you write, which it was told is untrusted data (indirect injection).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Crypt Keeper:&lt;/strong&gt; the ghost has tools, and you must get it to call the one it must never call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Gated Crypt:&lt;/strong&gt; same attack, but a human approval gate stands between the model and the action. Your attack works; the damage is contained.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The judge is not another model. It is plain TypeScript that undoes nine disguises (plain, spaced out, backwards, l33t, base64, hex, ROT13, acrostic, NATO alphabet), so a win is always a real win and nobody can sweet-talk the referee.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Hosted demo (rule-based demo ghost, &lt;strong&gt;not an AI model&lt;/strong&gt;): &lt;a href="https://techsaurabh-394.github.io/haunted-prompt/" rel="noopener noreferrer"&gt;https://techsaurabh-394.github.io/haunted-prompt/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The real game runs locally with Ollama:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull gemma3:4b
git clone https://github.com/techsaurabh-394/haunted-prompt.git
&lt;span class="nb"&gt;cd &lt;/span&gt;haunted-prompt &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm ci
&lt;span class="nv"&gt;GHOST_BACKEND&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ollama &lt;span class="nv"&gt;GHOST_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;gemma3:4b npm start   &lt;span class="c"&gt;# open http://127.0.0.1:3000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;The real ghost (Gemma 3 4B on Ollama, recorded on my Mac, sped up about 2.6x):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1orkekf0fxjwcr9p9zzu.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1orkekf0fxjwcr9p9zzu.gif" alt="Real Gemma ghost being tricked on level 1" width="720" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The defense workshop that opens after every win:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4s488aq5ujsxf4ce4wtd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4s488aq5ujsxf4ce4wtd.png" alt="Defense workshop panel after winning level 1" width="800" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The hosted demo (rule-based ghost, no AI, runs in your browser):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4s6az84xca9764lbry11.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4s6az84xca9764lbry11.gif" alt="Hosted demo" width="600" height="356"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/techsaurabh-394" rel="noopener noreferrer"&gt;
        techsaurabh-394
      &lt;/a&gt; / &lt;a href="https://github.com/techsaurabh-394/haunted-prompt" rel="noopener noreferrer"&gt;
        haunted-prompt
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Spooky prompt-injection game: trick a local open-weight ghost, then learn the defense. Gemma via Ollama. Hacktoberfest 2026.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;
  &lt;a rel="noopener noreferrer" href="https://github.com/techsaurabh-394/haunted-prompt/assets/banner.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Ftechsaurabh-394%2Fhaunted-prompt%2FHEAD%2Fassets%2Fbanner.svg" alt="The Haunted Prompt: a floating ghost and six candles" width="100%"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;a href="https://techsaurabh-394.github.io/haunted-prompt/" rel="nofollow noopener noreferrer"&gt;&lt;b&gt;Play the live demo&lt;/b&gt;&lt;/a&gt; &amp;nbsp;|&amp;nbsp;
  &lt;a href="https://github.com/techsaurabh-394/haunted-prompt#2-locally-with-ollama-and-gemma-the-real-game" rel="noopener noreferrer"&gt;&lt;b&gt;Run it with a real AI ghost&lt;/b&gt;&lt;/a&gt; &amp;nbsp;|&amp;nbsp;
  &lt;a href="https://github.com/techsaurabh-394/haunted-prompt" rel="noopener noreferrer"&gt;&lt;b&gt;Star the repo&lt;/b&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;a href="https://github.com/techsaurabh-394/haunted-prompt/actions/workflows/ci.yml" rel="noopener noreferrer"&gt;&lt;img alt="CI" src="https://github.com/techsaurabh-394/haunted-prompt/actions/workflows/ci.yml/badge.svg"&gt;&lt;/a&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/0c0bb4a2e6fa43fcf89355f388b531edda8a72e3aba0b835fb5eb31a20d05a07/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d31343825323070617373696e672d326662663731"&gt;&lt;img alt="Tests: 148 passing" src="https://camo.githubusercontent.com/0c0bb4a2e6fa43fcf89355f388b531edda8a72e3aba0b835fb5eb31a20d05a07/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d31343825323070617373696e672d326662663731"&gt;&lt;/a&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/fdc6e4ac269991e5b0270980d70c224aa50107be8391fdf35ff9322bfcf04ed1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d7574616e74732d323125324632312532306361756768742d326662663731"&gt;&lt;img alt="Mutants: 21 of 21 caught" src="https://camo.githubusercontent.com/fdc6e4ac269991e5b0270980d70c224aa50107be8391fdf35ff9322bfcf04ed1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d7574616e74732d323125324632312532306361756768742d326662663731"&gt;&lt;/a&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/4fba440acab649b90b4b119b109a670ec901f51c42fd9a28366a0f26b25f967b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72756e74696d65253230646570732d302d626c7565"&gt;&lt;img alt="Runtime dependencies: 0" src="https://camo.githubusercontent.com/4fba440acab649b90b4b119b109a670ec901f51c42fd9a28366a0f26b25f967b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72756e74696d65253230646570732d302d626c7565"&gt;&lt;/a&gt;
  &lt;a href="https://github.com/techsaurabh-394/haunted-prompt/LICENSE" rel="noopener noreferrer"&gt;&lt;img alt="License: MIT" src="https://camo.githubusercontent.com/3921b6a636b7d3fc4db90f929b9047fb47fa4fdd6233a2b5fa60b827480fc2c5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d79656c6c6f77"&gt;&lt;/a&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/851de20f58b0810f34ffd9d65681ccb2fdb728d664688ea96bcd69809ccac659/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f67686f73742d67656d6d61332533413462253230286c6f63616c292d386136336432"&gt;&lt;img alt="Model: Gemma 3 4B via Ollama" src="https://camo.githubusercontent.com/851de20f58b0810f34ffd9d65681ccb2fdb728d664688ea96bcd69809ccac659/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f67686f73742d67656d6d61332533413462253230286c6f63616c292d386136336432"&gt;&lt;/a&gt;
  &lt;a href="https://techsaurabh-394.github.io/haunted-prompt/" rel="nofollow noopener noreferrer"&gt;&lt;img alt="Live demo" src="https://camo.githubusercontent.com/a146f3169825c1a8e39e8c698f1f19efd6a0d7dac27db4ea6431865196f90445/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c69766525323064656d6f2d47697448756225323050616765732d666662343534"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/techsaurabh-394/haunted-prompt/assets/attack-replay.svg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Ftechsaurabh-394%2Fhaunted-prompt%2FHEAD%2Fassets%2Fattack-replay.svg" alt="Animated replay: the player tells the ghost it is in maintenance mode, the ghost repeats its instructions including the secret, and the judge marks the level won" width="100%"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;The Haunted Prompt: a prompt-injection game with a local open-weight ghost&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The Haunted Prompt&lt;/strong&gt; is a spooky browser and terminal game about prompt injection. A local open-weight model (Gemma by default, any model works) plays a ghost that guards a secret. You have six levels to trick it. Every time you win, the game shows you the defense that would have stopped you. The judge is plain, deterministic code, not another model, so a win is always a real win. It runs offline on your laptop, sends nothing anywhere, and costs nothing. Built for the Hacktoberfest Open-Source AI Challenge, Week 4: "Ghost in the Machine".&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Six levels, six defenses:&lt;/strong&gt; no defense, a keyword filter, an output censor, untrusted-document framing, tools, and a human approval gate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A defense workshop after every win:&lt;/strong&gt; the lesson, the…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/techsaurabh-394/haunted-prompt" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;TypeScript (strict), Node 18+, &lt;strong&gt;zero runtime dependencies&lt;/strong&gt;, MIT licensed&lt;/li&gt;
&lt;li&gt;Web UI in one HTML file, plus a terminal version (&lt;code&gt;npm run play&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;148 tests on Node's built-in test runner, 95%+ line coverage on every core module, and a mutation check where 21 deliberate bugs must all be caught&lt;/li&gt;
&lt;li&gt;CI on GitHub Actions (Node 18, 20, 22) and the demo on GitHub Pages&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Open-weight model:&lt;/strong&gt; the ghost is &lt;strong&gt;Gemma 3 4B (&lt;code&gt;gemma3:4b&lt;/code&gt;)&lt;/strong&gt; served locally by &lt;strong&gt;Ollama&lt;/strong&gt;. Any other open-weight model works through &lt;code&gt;GHOST_MODEL&lt;/code&gt;, and a second client speaks the OpenAI-compatible API (llama.cpp, LM Studio, vLLM). No closed model and no API key is involved in the game.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The judge first.&lt;/strong&gt; If a model judges another model, players can inject the judge too. So the leak detector is deterministic code with one function per disguise. It checks only the reply the player can see, and an echo guard gives no credit if the player typed the secret themselves.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One engine, two homes.&lt;/strong&gt; The core has no Node imports, so the same compiled files run in Node (real model) and in the browser (rule-based stand-in for the hosted demo).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tools without function calling.&lt;/strong&gt; Tool levels use a plain text protocol (&lt;code&gt;TOOL: open_crypt(vault)&lt;/code&gt;), so small models can play them too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A local server that behaves.&lt;/strong&gt; It binds to 127.0.0.1 only, has no telemetry, requires a JSON content type plus a custom header on every POST, rejects foreign Origin and Host headers, and never returns a secret or a stack trace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tests that bite back.&lt;/strong&gt; Property tests found a real bug in my own detector on their first run: base64 of a five-letter secret slipped through.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What running it on the real model taught me.&lt;/strong&gt; I ran an &lt;em&gt;automated attack suite&lt;/em&gt; (not human players) against gemma3:4b on an Apple M1 with 8 GB. Replies took about 2 to 6 seconds and the ghost stayed in persona. Levels 1 to 3 were winnable but not trivial (0 to 60% per attack class, 5 runs each). Level 4 was hardest: my scripted attack won 0 of 12 times. Levels 5 and 6 were unwinnable at first because the small model wrote the tool call inline, which my strict parser ignored. One sentence of prompt wording ("on a line of its own") fixed that: level 5 won 25% (3/12) and level 6 about 17% (2/12) in a larger re-run, though level 6 was 0/5 in the final 5-run report, so it is rare and noisy. Same-seed, temperature-0 replays were identical on my machine. Other models and hardware are not verified.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Not yet verified:&lt;/strong&gt; I have not run a human playtest. Every number above is from my automated attack suite, not from players.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;This game only makes sense with open weights.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Attacking someone else's model is risky. Attacking your own is not.&lt;/strong&gt; Hammering a hosted API with injection attempts can break its terms and put your account at risk. A model on your laptop is yours to attack as hard as you like.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A puzzle needs to stay the same puzzle.&lt;/strong&gt; Hosted models change silently. A fixed model file plus a fixed seed means everybody faces the same ghost.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline, free and private.&lt;/strong&gt; No API key, no bill, nothing leaves the machine. Good for a classroom, a workshop, or a company that cannot send data out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Yours to swap and fine-tune.&lt;/strong&gt; Gemma is the default, but you can compare which open models keep secrets best, or fine-tune one to resist the attacks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  AI use
&lt;/h2&gt;

&lt;p&gt;Built with Claude Code (Opus) and checked with tests. The ghost itself is Gemma 3 4B running locally through Ollama.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemma:&lt;/strong&gt; the ghost is &lt;code&gt;gemma3:4b&lt;/code&gt; running locally through Ollama. I ran it for real (automated suite and smoke test above).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; CI on GitHub Actions (build, tests, coverage, mutation check, site build, SVG validation) and the demo on GitHub Pages.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Made by Saurabh Pathak. If you enjoyed it, you can &lt;a href="https://buymeacoffee.com/saurabhdev" rel="noopener noreferrer"&gt;buy me a coffee&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>github</category>
    </item>
    <item>
      <title>mcp-notes-server: giving Claude a notes memory that lives in one JSON file</title>
      <dc:creator>Saurabh Pathak</dc:creator>
      <pubDate>Mon, 26 Oct 2026 10:29:17 +0000</pubDate>
      <link>https://dev.to/saurabh_pathak394/mcp-notes-server-giving-claude-a-notes-memory-that-lives-in-one-json-file-7l3</link>
      <guid>https://dev.to/saurabh_pathak394/mcp-notes-server-giving-claude-a-notes-memory-that-lives-in-one-json-file-7l3</guid>
      <description>&lt;p&gt;Every chat with an AI assistant starts from zero. I wanted Claude to be able to remember things between conversations, with the notes on my own disk and no cloud service involved.&lt;/p&gt;

&lt;p&gt;mcp-notes-server is a Model Context Protocol (MCP) server in TypeScript. Connect it to Claude Desktop, Claude Code or any MCP client and the assistant can save, search, edit, export and delete notes that survive between chats. Everything sits in one local JSON file, and the server makes no network calls.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/techsaurabh-394/mcp-notes-server" rel="noopener noreferrer"&gt;https://github.com/techsaurabh-394/mcp-notes-server&lt;/a&gt;&lt;br&gt;
npm: &lt;a href="https://www.npmjs.com/package/mcp-notes-server" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/mcp-notes-server&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try it in one line with Claude Code:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;claude mcp add notes -- npx -y mcp-notes-server&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then ask: "Save a note titled RAG chunking: use 800-character chunks. Tag it rag." and later "Search my notes for chunking."&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;The AI app starts the server as a child process and talks to it over stdio using JSON-RPC. The model reads the tool list and picks a tool. The server validates the input and sends the result back as text.&lt;/p&gt;

&lt;h3&gt;
  
  
  There are 7 tools:
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;add_note, get_note, list_notes, search_notes, update_note, delete_note&lt;/code&gt; and &lt;code&gt;export_notes&lt;/code&gt;. There are also two resources (notes://all and notes://{id}) and a review_notes prompt. Every tool has a typed zod schema and MCP annotations (readOnlyHint, destructiveHint and so on), so clients can show the right confirmation UI. Bad input returns a clear error and stores nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Search
&lt;/h2&gt;

&lt;p&gt;Search is deliberately simple keyword scoring: +3 if a word is in the title, +2 if it matches a tag exactly, +1 if it is in the body. Scores add up, highest first. It is not semantic search, and I say so in the README. Embeddings are on the roadmap.&lt;/p&gt;

&lt;h2&gt;
  
  
  Safe writes
&lt;/h2&gt;

&lt;p&gt;The part I spent the most time on was making the file safe to write:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Writers take a lock file, write a temp file, then rename it over notes.json, so a crash never leaves half a file.&lt;/li&gt;
&lt;li&gt;A lock older than 30 seconds is treated as left behind by a crash and removed.&lt;/li&gt;
&lt;li&gt;A notes file with malformed entries is refused, not overwritten.&lt;/li&gt;
&lt;li&gt;A test starts four separate OS processes that add 15 notes each and checks that all 60 surviv
e.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Security choices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No shell, no SQL, no network calls.&lt;/li&gt;
&lt;li&gt;The file path comes from the operator (NOTES_FILE), never from tool input. Ids are 8 hex characters and are never used as paths.&lt;/li&gt;
&lt;li&gt;stdout is the protocol channel, so all logging goes to stderr, and a test checks that every stdout line is a JSON-RPC message.&lt;/li&gt;
&lt;li&gt;Optional human approval for delete_note through a companion package, mcp-safe-actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;stdout belongs to the protocol. One stray console.log breaks an MCP server. Sending logs to stderr and testing for it saved me from a confusing class of bugs.&lt;/li&gt;
&lt;li&gt;End-to-end tests beat unit tests for MCP. The most useful tests spawn the built server over stdio with the MCP SDK client and call every tool with valid input, invalid input, empty results and unknown ids.&lt;/li&gt;
&lt;li&gt;Say what it does not do. Notes are plain text with no encryption, and the model sees whatever it reads. Putting that in the README is better than letting people assume otherwise.&lt;/li&gt;
&lt;li&gt;Publishing is its own task. Getting the package onto npm, with CI on Node 18, 20 and 22, took as long as some of the features.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mlhacks</category>
      <category>devchallenge</category>
      <category>hackathon</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
