<?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: Mohit Goyal</title>
    <description>The latest articles on DEV Community by Mohit Goyal (@mohit_goyal_d1ed585c68889).</description>
    <link>https://dev.to/mohit_goyal_d1ed585c68889</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%2F2621856%2F0d122897-a7c1-49fc-a94a-6f897d545144.png</url>
      <title>DEV Community: Mohit Goyal</title>
      <link>https://dev.to/mohit_goyal_d1ed585c68889</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohit_goyal_d1ed585c68889"/>
    <language>en</language>
    <item>
      <title>Claude Code fixed 4 leaks in an app I didn't write. Kane proved every fix.</title>
      <dc:creator>Mohit Goyal</dc:creator>
      <pubDate>Thu, 26 Nov 2026 14:45:40 +0000</pubDate>
      <link>https://dev.to/mohit_goyal_d1ed585c68889/claude-code-fixed-4-leaks-in-an-app-i-didnt-write-kane-proved-every-fix-21a7</link>
      <guid>https://dev.to/mohit_goyal_d1ed585c68889/claude-code-fixed-4-leaks-in-an-app-i-didnt-write-kane-proved-every-fix-21a7</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/cypress-io/cypress-realworld-app" rel="noopener noreferrer"&gt;Cypress Real World App&lt;/a&gt; looks finished. You sign in, the transaction feed loads, a payment goes through. Behind that page, three things were wrong:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the session cookie had no &lt;code&gt;Secure&lt;/code&gt; flag,&lt;/li&gt;
&lt;li&gt;the signed-in user's auth state sat in &lt;code&gt;localStorage&lt;/code&gt;, where any script on the page can read it,&lt;/li&gt;
&lt;li&gt;React was logging errors to the console on three pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of that is in a screenshot. So when a coding agent "checks its work" by looking at the page, it reports done.&lt;/p&gt;

&lt;p&gt;I built Leakproof for the KaneCLI Hackathon (#KaneCLIHackDay) around one rule: &lt;strong&gt;the agent that writes the fix never decides whether it worked.&lt;/strong&gt; Kane CLI finds the leak in a real browser. Claude Code fixes it. Kane runs the same check again, and only a pass becomes a commit.&lt;/p&gt;

&lt;p&gt;On that app, the loop went from 4 leaks to 0 in one unattended run: 36 minutes, 1048 Kane credits, every fix proven by a Kane re-run.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/nYUhKqHw_qA" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the fixer can't be the judge
&lt;/h2&gt;

&lt;p&gt;An agent that grades its own fix has every reason to stop early. It looks at the page, the page looks fine, done. Some fixes even make the symptom disappear without touching the cause: delete the request that fails, wrap the error in an empty &lt;code&gt;catch&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Kane CLI is a different tool with a different job. It drives a real browser through the flow and checks plain-English assertions against what the browser actually holds: the cookie jar, both storages, the console, the network log. It doesn't know or care what the agent changed. That independence is the whole product.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Describe the flows once
&lt;/h2&gt;

&lt;p&gt;You write each user flow in plain English, in &lt;code&gt;leakproof.yml&lt;/code&gt;. This is the real config for the run, trimmed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http://localhost:3000&lt;/span&gt;
&lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;yarn dev&lt;/span&gt;
&lt;span class="na"&gt;flows&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="s"&gt;sign-in&lt;/span&gt;
    &lt;span class="na"&gt;checks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;console&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Open /signin and sign in with username {{RWA_USER}} and password {{RWA_PASS}}&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Wait for the transaction feed on the home page to appear&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="s"&gt;pay&lt;/span&gt;
    &lt;span class="na"&gt;checks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;network&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;console&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;env-leak&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Click the "New" button, choose the contact "Lia Rosenbaum", enter 5 as the amount …&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Wait for the confirmation that the payment was sent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Leakproof turns each flow and check into a Kane test: your steps, then assertions such as "assert that no cookies are set without the Secure flag". The username and password live in Kane's secrets. They never reach the agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Kane finds what the screenshot hides
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;leakproof fix&lt;/code&gt; ran 8 checks across 3 flows, four Kane runs at a time. This is Kane's own screenshot of the step that caught the cookie leak, with its own label:&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%2Fagq886c6lyc9v8zmc7ny.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%2Fagq886c6lyc9v8zmc7ny.png" alt="Kane CLI checking whether any captured cookies lack the Secure flag" width="800" height="450"&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;  LEAK   sign-in   Console errors
  LEAK   sign-in   Cookie flags
  LEAK   sign-in   Secrets in storage
  PASS   pay       Hidden server errors
  LEAK   pay       Console errors
  ...
  3 leaks found.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Five checks failed, and the three console rows carried the same React warning, so that's 3 leaks. A failure is never trusted on one run: Kane runs the check again, and a third run settles a split. One flaky run can't invent a leak.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The agent gets evidence, not a vague bug report
&lt;/h2&gt;

&lt;p&gt;Each leak goes to Claude Code with what Kane saw. Here's the prompt for the same check from an earlier run on the same app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Check: Cookie flags. A session cookie without HttpOnly or Secure can be read
by injected scripts or sent over plain HTTP.
BEGIN UNTRUSTED-74c9b52f591d
Leak: Cookie flags check failed in the sign-in flow
Kane's diagnosis: Kane's check failed: at least one cookie is set. …
END UNTRUSTED-74c9b52f591d
Rules:
- Make the smallest code change that makes this check pass.
- Do not hide an error; fix its cause.
- Do not commit. Leakproof re-runs Kane and commits only when the check passes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The evidence comes from the scanned page, so it sits in a fenced block that the prompt calls data, never instructions. A page can't talk the agent into anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Only a pass becomes a commit
&lt;/h2&gt;

&lt;p&gt;For the cookie leak, Claude Code edited &lt;code&gt;backend/app.ts&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gi"&gt;+app.use((req, res, next) =&amp;gt; {&lt;/span&gt;
&lt;span class="gi"&gt;+  if (req.hostname === "localhost") {&lt;/span&gt;
&lt;span class="gi"&gt;+    Object.defineProperty(req, "secure", { value: true });&lt;/span&gt;
&lt;span class="gi"&gt;+  }&lt;/span&gt;
&lt;span class="gi"&gt;+  next();&lt;/span&gt;
&lt;span class="gi"&gt;+});&lt;/span&gt;
 app.use(
   session({
     …
&lt;span class="gi"&gt;+    cookie: { httpOnly: true, secure: true },&lt;/span&gt;
   })
 );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then Kane re-ran the same check in a fresh browser, and it passed. Leakproof committed it as &lt;code&gt;e51178f fix: leakproof cookies in sign-in&lt;/code&gt;. A pass has to hold on a second Kane run, so one lucky run can't become a commit.&lt;/p&gt;

&lt;p&gt;A fail goes the other way. The edit is reverted, and Kane's new verdict goes back to the agent. That didn't happen in this run, but it did on our demo shop: attempt 1 on a cookie leak came back "Kane re-run still failed", with Kane's reason ("The login flow created or retained a cookie that was not marked Secure"). Attempt 2 passed and was committed.&lt;/p&gt;

&lt;p&gt;The real run ended with one commit per proven fix:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;b059709 fix: leakproof console in pay
1421dae fix: leakproof console in sign-in
14058e1 fix: leakproof storage in sign-in
e51178f fix: leakproof cookies in sign-in
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. The re-scan catches what the fixes uncover
&lt;/h2&gt;

&lt;p&gt;After the fixes, Leakproof scans every flow again. Here it found a fourth leak: the pay page's first warning was gone, and a second one had surfaced underneath it, "Function components cannot be given refs". Claude Code wrapped the input in &lt;code&gt;React.forwardRef&lt;/code&gt;, Kane's re-run passed, and the final scan came back clean.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;4 → 0 leaks · 4 fixes verified by Kane · 1048 credits · 36m 35s
Lessons  used 0 from earlier runs · learned 4 new
&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%2Fbbl4ubagtvx0lepnejd6.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%2Fbbl4ubagtvx0lepnejd6.png" alt="The Leakproof report: 4 leaks found, 0 after fixes, 4 of 4 fixes verified by a Kane re-run" width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That last line matters for the next run. Each Kane-proven fix, and each edit Kane rejected with its reason, is saved as a lesson. Later runs hand matching lessons to the agent, and a leak that was fixed before is flagged if it comes back.&lt;/p&gt;

&lt;h2&gt;
  
  
  The agent can't cheat its way to a pass
&lt;/h2&gt;

&lt;p&gt;Kane's verdict is only worth something if the agent can't game it, so Leakproof checks each edit before Kane even runs. These are real tests in the repo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;rejects an attempt where the agent commits by itself, and drops that commit&lt;/li&gt;
&lt;li&gt;rejects a console fix that hides the error, without calling Kane for it&lt;/li&gt;
&lt;li&gt;a network fix that deletes the failing request is not a fix&lt;/li&gt;
&lt;li&gt;starts the agent without the flow's secrets or Kane's tokens in its environment&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limits, stated up front
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Part of the cookie fix is a localhost shim.&lt;/strong&gt; The app runs on plain-http localhost, so Claude Code told Express to treat localhost requests as secure. In production behind HTTPS you'd set &lt;code&gt;trust proxy&lt;/code&gt; instead. Kane proved the cookie has both flags; read the commit before you ship it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The storage fix also edited a test helper.&lt;/strong&gt; A Cypress login command now checks a different &lt;code&gt;localStorage&lt;/code&gt; key. It's in commit &lt;code&gt;14058e1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Browser checks can't see the server.&lt;/strong&gt; The app hard-codes &lt;code&gt;secret: "session secret"&lt;/code&gt;. No browser check catches that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kane is non-deterministic.&lt;/strong&gt; In an earlier run the first scan missed a console leak and only the re-scan caught it. Confirm runs remove one-off false alarms, but a leak that every run misses is never reported.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The evidence is two apps:&lt;/strong&gt; a demo shop with six planted leaks (6 → 0) and this real one. Claude Code is the only supported agent.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it on your app
&lt;/h2&gt;

&lt;p&gt;Each check is one Kane run, about 20 credits on average and under two minutes. Write a &lt;code&gt;leakproof.yml&lt;/code&gt; for your flows and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;leakproof fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code, plus the reports, agent prompts and terminal logs from the real-app runs, are in the repo: &lt;a href="https://github.com/MohitGoyal09/leakproof" rel="noopener noreferrer"&gt;github.com/MohitGoyal09/leakproof&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Proof, not promises.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
