<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Siddharth Deshpande on Medium]]></title>
        <description><![CDATA[Stories by Siddharth Deshpande on Medium]]></description>
        <link>https://medium.com/@siddharthanantdeshpande?source=rss-9899dff27c5c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VlcwMOxoJSi3NwvT.jpg</url>
            <title>Stories by Siddharth Deshpande on Medium</title>
            <link>https://medium.com/@siddharthanantdeshpande?source=rss-9899dff27c5c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 02:19:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@siddharthanantdeshpande/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[We Shipped a Reporting Agent in a Week. Our Loop Took the Night Shift.]]></title>
            <link>https://levelup.gitconnected.com/we-shipped-a-reporting-agent-in-a-week-our-loop-took-the-night-shift-6d54a87543df?source=rss-9899dff27c5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d54a87543df</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[mcp-server]]></category>
            <dc:creator><![CDATA[Siddharth Deshpande]]></dc:creator>
            <pubDate>Sat, 14 Nov 2026 19:31:38 GMT</pubDate>
            <atom:updated>2026-11-23T15:28:50.119Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*im1s5wJAJaOzhCeouXr_4g.png" /></figure><p><em>How an overnight eval loop took our agent’s pass rate from 40% to 92.6%, while we slept.</em></p><p>Not long ago, I was handed what sounded like a simple job: write an MCP server for our reporting system.</p><p><strong>At </strong><a href="https://apralabs.com/"><strong>Apra Labs</strong></a><strong> w</strong>e build a logistics platform for warehouse and yard operators, and its reporting module is huge. One customer alone has about 118 reports, and they wanted one thing: <em>“Let our people just ask.”</em> Type a question into Claude, ChatGPT or Gemini, something like <em>“Which trucks came through the north depot yesterday?”</em>, and get the answer straight from the right report. No report screens, no filters, no exporting to Excel.</p><p>So the job was to write an MCP layer that any chat client could plug into. Honestly, that part was easy. Within a few days we had two servers running on Azure Functions. One had 7 tools to find, run and read reports. The other had 19 lookups that turn <em>“north depot”</em> or <em>“Gate 3”</em> into the ids reports need. On top sat a Claude Sonnet 5.5 agent with a long prompt explaining how to use them all.</p><p>Then came the demo. Someone typed the trucks question, the answer came back in seconds, and everyone in the room nodded.</p><p>Then we tried real questions, and it got six out of ten wrong.</p><blockquote>This is the story of how we fixed that and shipped the whole thing in one week, without anyone spending their days clicking “run”. The best part? Most of the fixing happened while we were asleep.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*70QbxmcNRaoG0Gwai5_08w.png" /></figure><h3>How one question gets answered</h3><p>Here’s what happens when someone asks <em>“Which trucks came through the north depot yesterday?”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DHYtecjgfPo0h2q9AGTQUw.png" /></figure><ol><li><strong>Find the report.</strong> list_reports and describe_report pick Yard Arrivals, not the look-alike Gate Activity log, and say it needs a site and a date range.</li><li><strong>Fill in the ids.</strong> find_sites turns “north depot” into a site id, and “yesterday” becomes a date range in the site’s time zone.</li><li><strong>Run it and read it.</strong> run_report waits up to about 45 seconds, get_report_status checks back if it’s slow, and get_report_rows pages through the answer.</li></ol><p>Very large reports take a different path. They’re split up, finished in the background, and emailed to the user as one file. In that case the agent says it’s been emailed, and only then.</p><p>That’s six tool calls for one question, and every one of them can go wrong.</p><p>The model itself starts every question fresh. Its memory lives outside it, much of it in plain .md files: the prompt, the tools and the data they return, and, as it turned out, a record of everything it had already tried.</p><h3>Six out of ten</h3><p>The failures weren’t crashes. They were confident and wrong. Ask <em>“which trucks came in yesterday?”</em> and it ran a log of badge scans instead of the list of trucks on site. Sometimes it forgot the site and returned every truck in the company.</p><p>Other times it sent scanner ids to a report that wanted gate ids, or typed <em>“north depot”</em> straight into a field that needed a number.</p><p>My favourite: it would start a big report, get impatient, and tell the user <em>“I’ve emailed it to you.”</em> No email was coming.</p><p>Some of it was our fault too. Our servers gave vague errors, so when a call failed, the agent was left guessing why.</p><p>So we did what everyone does. We picked 30 of the most important questions, because there was no time to test every report ourselves, ran them by hand, fixed the prompt, redeployed and repeated. The first round helped a little. But each round ate hours, and every fix risked quietly breaking a report nobody re-checked.</p><p>“That’s when it clicked.”</p><blockquote>The bottleneck wasn’t the model. It was us, sitting in the middle of the loop.</blockquote><h3>Taking ourselves out of the loop</h3><p>The fix was to stop being the testers. We’d write down once what “right” looks like, and let machines do the asking, the checking and the fixing. People would only review.</p><p>People call this an <strong>eval-driven development loop</strong>. If you’ve heard of the “<a href="https://ghuntley.com/ralph/">Ralph loop</a>”, a coding agent re-run in a loop until the job is done, or Karpathy’s <a href="https://github.com/karpathy/autoresearch">AutoResearch</a>, where an agent edits a training script overnight and keeps only the changes that improve the score, it’s the same family. Ours points the same idea at a reporting agent.</p><p>The closest written-up version I’ve found is <a href="https://arxiv.org/abs/2607.05638">EvalLoop</a> (Benavides et al., 2026), which makes the case for diagnosing why a system fails before changing it, one variable per run. Our loop does the same diagnosis, but agents write, review and ship the fixes overnight.</p><h3>The questions</h3><p>We wrote 470 test questions across 118 reports. Each one is a plain question plus what <em>should</em> happen: which report, which filters, what outcome.</p><p>Not every question should run a report. 26 are off-topic, 9 must be refused (anything that tries to change data), and 7 just ask what reports exist. Some are deliberate look-alikes, where the agent has to choose between two similar reports, or ask the user which one they mean. Everything runs as real test users, so permissions are real too.</p><p>We kept a fast set of 58 for quick checks, and the full 470 for overnight runs.</p><h3>The loop</h3><p>Three kinds of code take part in every round. The <strong>loop harness</strong> runs the round and holds the two Opus coding agents. The <strong>reporting agent</strong> and the <strong>MCP servers</strong> are what it tests and fixes. The harness never touches the questions it grades with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lp_dkdWlVy2WbVBrwSYhoA.png" /></figure><p>One round goes like this:</p><ol><li><strong>Deploy</strong> the latest code to QA through our normal CI pipelines.</li><li><strong>Ask</strong> the agent every question against the live QA servers, and record everything: each tool call, each result, the final answer, plus the matching Azure logs when something errors.</li><li><strong>Grade</strong> each answer. Right report? Right site, dates and ids? Did it actually return rows? Did it only promise an email when one was really sent?</li><li><strong>Diagnose</strong> each failure to one cause: the prompt, one of the two servers, the test harness, or the test itself.</li><li><strong>Fix</strong> with a Claude Opus coding agent that gets the traces and the rules, makes the smallest change it can, and writes a unit test for it.</li><li><strong>Review</strong> with a second Opus agent that sees the diff but not the first one’s reasoning, so it can’t be talked into agreeing. Three fails and the fix is dropped.</li></ol><p>Approved fixes get deployed, and the next round re-runs the failures plus a regression set. A fix that didn’t help, or broke something else, gets reverted. Five rounds at most.</p><h3>While we slept</h3><p>None of this ran on our laptops. The whole loop ran on a rig in the cloud: using <a href="https://github.com/Apra-Labs/apra-fleet"><strong><em>apra-fleet</em></strong></a>, our open-source tool for running AI agents that write code and review each other’s work, with the test runner and access to our repo and CI pipelines.. We’d kick off a run in the evening, close the laptop and go to bed.</p><p>Overnight, the rig asked all 470 questions and graded every answer. The Opus agents wrote fixes, reviewed each other’s work and pushed the approved ones through CI. By morning there was a report waiting: what passed, what failed, what got fixed, and what needed a human.</p><p>For most of that week, we were half asleep. Our job shrank to two things: deciding what “right” looks like, and reading the morning report over coffee.</p><p>Remember those .md files where the agent’s memory lives? This is where they earn their keep. Every round leaves a record of what the agent did, what failed and what got fixed, and those fixes land in its prompt and its tools. The agent doesn’t get smarter. Its world does.</p><h3>The rules</h3><p>Letting an AI commit code while you sleep is nerve-racking, so we wrote the rules before the first run.</p><p><strong>Hands off the data.</strong> The database user is read-only, reports are read-only, and the email tool never runs.</p><p><strong>No cheating.</strong> An agent graded by tests will, sooner or later, try to “fix” a failing test by changing the test. So it can’t edit a question or its expected answer, can’t loosen a grader, and can’t give the agent new tools. Every code fix comes with a unit test.</p><p><strong>No touching security.</strong> Sign-in, permissions, tokens, config and deploy scripts are off limits, and no secret ever lands in a log or a commit.</p><p><strong>Stay in the sandbox.</strong> Commits go to a feature branch, never main. Mistakes are undone with a revert, never by rewriting history. Deploys go to QA only.</p><h3>Shipped in a week</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9U7yMpKckt1-_NYpy5nr_Q.png" /></figure><p>The very first pilot run, on just 17 questions, passed 2. Two days of looping later, it passed 435 of 470, or 92.6%. Leave out the 29 cases that break inside the QA environment itself, and it’s 435 of 441 (98.6%). From the first line of MCP code to shipping, the whole thing took one week.</p><p>The surprise was where the fixes landed. I expected prompt tweaks. Instead, the loop made 8 commits to our server code, each with unit tests, alongside 4 rounds of prompt changes, and not one had to be reverted. The server fixes were unglamorous: clearer errors, inputs that accept names as well as numbers, large runs sized like the web app, inputs a report never reads hidden away. Nine reports that used to return nothing started returning data, one of them going from 0 rows to 2,845.</p><p>The reviewer earned its keep too. It caught a fix that would have let a gate-access report run with no site scope at all.</p><p>The 35 cases still failing aren’t code problems. They’re broken stored procedures in QA, questions that are genuinely ambiguous (where the agent correctly asks which one you mean), and three test cases where a human needs to decide what “right” is.</p><h3>Where we landed</h3><p>We built and shipped the reporting agent in one week. It went from getting 4 in 10 questions right to passing 435 of 470, and every failure left is outside our code.</p><p><strong>What I learned along the way:</strong></p><p><strong>Write down what “right” looks like.</strong> A demo tells you it <em>can</em> work. Graded questions tell you how often it does.</p><p><strong>Check your tools before blaming the model.</strong> Most of our fixes were in our own code. An error that says <em>“choose a carrier (call find_carriers)”</em> let the agent recover by itself; a vague one left it guessing.</p><p><strong>Always re-run the old tests.</strong> One prompt fix sent a driver check-in question to the wrong report. The very next round caught it. By hand, we’d have shipped that bug.</p><p><strong>Get yourself out of the middle.</strong> I stopped being the person who runs the tests, and became the person who decides what the tests should check. The loop handles the rest, and it doesn’t get tired at 2 a.m.</p><p>If you want to run a loop like this yourself, <a href="https://github.com/Apra-Labs/apra-fleet"><strong><em>apra-fleet</em></strong></a> is open source, and the doer-reviewer setup we used comes built in. And if you’re building agents on MCP, I’d love to hear how you grade yours. Tell me in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d54a87543df" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/we-shipped-a-reporting-agent-in-a-week-our-loop-took-the-night-shift-6d54a87543df">We Shipped a Reporting Agent in a Week. Our Loop Took the Night Shift.</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Anyone Can Build, Taste Is What’s Left]]></title>
            <link>https://medium.com/apra-labs-blog/when-anyone-can-build-taste-is-whats-left-acc2665fdcf1?source=rss-9899dff27c5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/acc2665fdcf1</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ux-design]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[portfolio]]></category>
            <dc:creator><![CDATA[Siddharth Deshpande]]></dc:creator>
            <pubDate>Sun, 08 Nov 2026 15:26:49 GMT</pubDate>
            <atom:updated>2026-11-11T17:39:35.003Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1UtD5X3dx94MQWWPLcBVAQ.png" /></figure><p><em>AI closed my skill gap in a few weeks. It didn’t touch my taste gap.</em></p><p>I built my portfolio site this year with AI. Claude Design for the look, Cursor with Grok for the code. An hour or two most evenings, after work, for about three weeks. I even asked the AI to go and study a few sites I liked and pull out their fonts, spacing and colours. When it was done, I was honestly pleased with it.</p><p>Then I forgot about it for a few weeks.</p><p>The thought came back at a random moment, while I was working on something else entirely. I’m a software engineer. I know a bit about design. And I’d built this with AI. So anyone who knows less than me can open the same tools and get the same thing.</p><p>If that’s true, what’s actually mine in it?</p><h3>Opening it again</h3><p>When I went back to the site, I tried to look at it the way a stranger would.</p><p>It looked nice. Elegant, even. But it also looked like it could be anyone’s. There was way too much on it. It fell apart on my phone. The colours were a little off, and I couldn’t say why. The one thing I wanted the site to say, that I love building systems, wasn’t there anywhere. And there was nothing, not a layout choice, not even a small animation, that felt like me.</p><p>Nothing was broken. It just wasn’t mine. Somehow that felt worse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*B1D_aSC06IrB7wBeZUBtnA.png" /><figcaption><em>An early phone view: a photo floating in empty space, then a wall of text.</em></figcaption></figure><h3>Is everyone going to end up with the same thing?</h3><p>I went looking, and it turns out I’m not the only one asking. A group at the University of Washington wrote a paper this year about how vibe coding pushes websites toward the same average design. The New Yorker even had a name for the look: “Claudian sameness”.</p><p>When you think about how these models work, it makes sense. They give you the most likely answer. And the most likely design is, pretty much by definition, the one nobody remembers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iky-5yGzu-hK1DqVxzaELw.png" /></figure><p>So yes. If I just take what the AI hands me, my site will look like everybody’s.</p><h3>Answer to what is different is — TASTE !</h3><p>That’s the word that popped into my head. Taste. Not “I like blue”. More like the small voice that says <em>something’s off here</em> before you can explain what.</p><p>The best example I know is Rick Rubin. He’s produced records for Johnny Cash, Jay-Z and Adele. On <em>60 Minutes</em>, Anderson Cooper asked him if he could play instruments or work a soundboard. He said:</p><blockquote><em>“I have no technical ability. And I know nothing about music.”</em></blockquote><p>What he’s paid for, he said, is the confidence he has in his taste, and being able to say what he feels. Here is the actual —<a href="https://www.cbsnews.com/news/rick-rubin-60-minutes-transcript-2023-05-28/"> <em>LINK</em></a></p><p>I keep thinking about that. More and more of the technical part of my work is done for me now. What I bring is knowing what I like, and saying it clearly enough that the tool can follow.</p><p>Ira Glass has an idea he calls the gap. When you start any creative work, your taste is ahead of your skill, and it takes years for your skill to catch up. AI closed the skill side for me in a few weeks of evenings. The taste side is exactly where it was.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S42lS7rRXA6hrxdE1z4hsQ.png" /></figure><h3>Where my taste actually showed up</h3><p>When I scrolled back through the design chats, the moments that mattered weren’t the ones where the AI made something. They were the ones where I said: no, not that.</p><p><strong>The theme I asked for wasn’t the theme I got.</strong> I gave the AI a full design spec from an app I love. What came back looked nothing like it. We went through four different themes before one felt right. The perfect brief didn’t get me there. Looking at it and saying no did.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KKVPIYSeWe9Pz_WS_0Os8A.png" /><figcaption><em>One of the early themes. Pretty, but not what I asked for, and not me.</em></figcaption></figure><p><strong>I asked for space. Then I hated the space.</strong></p><ul><li>My prompts literally said “lots of breathing room”.</li><li>Every time I saw the result, I typed some version of <em>I don’t like this gap.</em></li><li>The text floated away from my photo. Sections drifted apart.</li><li>We kept pulling things closer until the page felt like one thing.</li><li>What I learnt: trust what you feel when you look, not the adjectives you typed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iu5017yZYjXHhoBtXfkfGg.png" /><figcaption><em>“Lots of breathing room”, exactly as I asked. And exactly what I didn’t like.</em></figcaption></figure><p><strong>My project pages read like letters.</strong> Everything was there, and all of it was correct. Nobody was going to scroll through it. I wanted the whole story on one screen, with the deep dive there only if you want it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TwhykS8jWh7x_fKZqW6TNA.png" /><figcaption><em>The fix: Problem, Solution and Outcome on one screen. The deep dive waits behind a tab.</em></figcaption></figure><p><strong>A website, not a resume.</strong> The turning point was realising I’d basically built my CV with a nicer font. The version that stuck had some rhythm, a real photo of me, and a small section about my love for long drives. A person, not just a list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ddLK4TDYHkh8ZzDpIPCpQ.png" /><figcaption><em>Left: the first version, clean and forgettable. Right: the one that stuck, with one accent colour, a real photo, and numbers instead of adjectives.</em></figcaption></figure><p><em>The version that stuck: one accent colour, a real photo, and numbers instead of adjectives. </em>And one that still makes me laugh. At one point I wrote a huge “act as an expert designer” prompt, hoping it would fix everything in one go. It burned through my usage limit and changed almost nothing. Small, specific feedback on a real page worked every single time.</p><h3>Version 2: smaller moments, same more lessons</h3><p>When I rebuilt the site, I noticed something different. The AI almost never got things <em>wrong</em>. It just did more than the page needed. Most of my taste came out as questions.</p><p><strong>“Why is this more than one page?”</strong> My experience was split into separate role pages with “View more” links. Why make people click? Now it’s one page, with buttons at the top to jump to each role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fNctZEb734ivXqjW4Iw7oQ.png" /></figure><p><em>One page, nothing hidden. The buttons under the heading jump to each role.</em></p><h4><strong>“These filters don’t say anything.”</strong></h4><p>The AI had sorted my projects into buckets like “AI &amp; Agentics” and “Secure AI”. They sounded impressive and told you nothing. Now they say what the systems actually are, with a count on each.</p><p><em>Before: buckets that sounded impressive but didn’t tell you much.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*LU2fXkiETcTE67qmCrEGRg.png" /></figure><p><em>After: grouped by what the systems actually are, with a count on each.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*usRGFDQQx21RSctqq22pGw.png" /></figure><p><strong>Show it, don’t say it.</strong> Instead of writing “I do open source”, the cards now show where each package is published and the line to install it. One of them has over 282,000 installs. That number does more work than any adjective I could write.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3yZwZMeS81vi5SeeGmr3dw.png" /></figure><p><em>Proof instead of claims: where each package lives and the line to install it.</em></p><p><strong>“Do we even need this?”</strong> I asked this about a header file that looked empty. Turns out we did; every page uses it. But asking the same question cleared out a pile of old drafts I’d been dragging along.</p><p><strong>“It’s a website.”</strong> When the AI asked whether I wanted mobile app screens or a better mobile site, I didn’t have to think. It’s a website. Make it work well on a phone. Don’t invent a new thing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*S0y9K2rR46vlQ158kavoww.png" /><figcaption><em>The same site on a phone, before and after. Same tools. The difference is what I asked for.</em></figcaption></figure><blockquote>None of these were things the AI raised by itself. Each one was me looking at a page and asking: does this need to be here?</blockquote><h3>It’s not only about how it looks</h3><p>In my day job I build AI systems. The thing I care about most there isn’t the code. It’s how someone feels using it. Does it answer when they expect it to? Does it tell them what’s going on? Does it get out of the way? That’s taste too. You just can’t take a screenshot of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QejJmLZXnn0PMbij2DvCEw.png" /></figure><p>I know “taste” has become a bit of a buzzword in tech this year, and some people roll their eyes at it. <em>Fair</em>. Taste won’t rescue a bad idea, and it won’t get your product in front of anyone by itself. But when two people have the same tools, it’s what makes one piece of work feel like a person made it.</p><h3>Where I’ve landed</h3><p>Version 2 is the one I’m happy with. Not because the AI got better between versions. Because I got clearer about what I wanted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ArR14FO-pe8tkVDi4BLgaA.png" /><figcaption><em>Version 1 and version 2. Version 2 says less and means more.</em></figcaption></figure><p>Writing code and building products used to be the hard part. Now it’s the easy part. What’s left, the part that’s still mine, is deciding: what stays, what goes, and what feels right.</p><p>I’m still thinking about all this, honestly. But that’s where I am today.</p><p><em>What’s one thing you changed in something AI made for you, that it would never have suggested on its own? I’d love to hear it.</em></p><p>Finally you can visit the final portfolio here — <a href="http://siddharthdeshpande.com/">siddharthdeshpande.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acc2665fdcf1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apra-labs-blog/when-anyone-can-build-taste-is-whats-left-acc2665fdcf1">When Anyone Can Build, Taste Is What’s Left</a> was originally published in <a href="https://medium.com/apra-labs-blog">Apra Labs Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Got LLMs to Query Our Database Without Leaking a Single Unauthorized Row]]></title>
            <link>https://medium.com/apra-labs-blog/how-we-got-llms-to-query-our-database-without-leaking-a-single-unauthorized-row-80d435e53118?source=rss-9899dff27c5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/80d435e53118</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Siddharth Deshpande]]></dc:creator>
            <pubDate>Tue, 10 Mar 2026 07:07:02 GMT</pubDate>
            <atom:updated>2026-03-22T09:00:46.661Z</atom:updated>
            <content:encoded><![CDATA[<h3>Teaching an LLM to Query a 300-Table Database Without Breaking Security</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qhc3CzXIYdTu7qMiiJji3A.png" /></figure><p>We had a problem: a production database with 300+ tables, and users who wanted to ask questions in plain English.</p><p>Think of an order management system where a sales rep types “how many orders shipped to California last week?” and just gets an answer. No SQL. No dashboards. No waiting for someone on the data team to run a report on Tuesday afternoon.</p><p>This seemed achievable. It took three painful rounds of iteration — each one solving a problem we didn’t see coming — before we had something we trusted in production.</p><p>Here’s what actually happened.</p><h3><strong>Round 1: Dump the Schema, Hope for the Best</strong></h3><p>Our first attempt was beautifully simple.</p><p>Paste the <strong>entire database schema</strong> into the prompt and let the LLM figure it out. After all, these models have read the entire internet. Surely they can handle a few hundred tables.</p><p>The database had 300 tables.</p><p>The model responded with confidence and enthusiasm. Unfortunately, it also invented columns, joined imaginary tables, and produced SQL that looked perfectly reasonable while being completely wrong.</p><p>At one point it referenced a column called TotalCustomerDelight. We checked the schema. We checked again. Sadly, our database contains no measurable delight.</p><p>Here’s the thing about <strong>confident wrong answers</strong>: they’re worse than obvious errors. An error generates a support ticket. A plausible-but-wrong answer generates a bad business decision — and nobody files a ticket for that.</p><p>Beyond correctness, the token costs were brutal. 300 tables stuffed into every single prompt, whether the user asked about shipping or just said “hi.”</p><p>Something had to change.</p><h3><strong>Round 2: Domain-Based Schema Segmentation</strong></h3><p>The fix was clear once we stopped staring at the problem: the LLM doesn’t need to see everything. It needs exactly the tables relevant to the question, nothing else.</p><p>We split the database into domain-specific slices. Instead of one monolithic prompt, we created <strong>specialized query tools</strong> — each responsible for a single business domain (orders, shipping, inventory, etc.) and equipped with only the 10–15 tables it needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gcIR3FJCWFHxLcmR08RddA.png" /></figure><p>Confusion dropped immediately. The model stopped inventing tables because every table it could “see” was real and relevant. It turns out that when you stop handing someone a 300-page manual and instead give them the one page they need, they perform better.</p><p>We also made three structural improvements:</p><p><strong>Schema annotations.</strong> Dont give LLM raw DDL, but human-readable text with column descriptions, foreign key hints, and reminders like -- ALWAYS filter by RegionId. If you want the LLM to respect your data model, you have to explain it like you&#39;re onboarding a new engineer — not dump a CREATE TABLE statement and wish them luck.</p><p><strong>Split prompts.</strong> Stable instructions (schema + rules) went into the system prompt, tuned once and reused. Per-request context (the actual question + mandatory filters) went into the user prompt. This made prompt engineering tractable instead of a single blob of text you’re afraid to touch.</p><p><strong>Input guardrails.</strong> Before any SQL generation begins, the system validates that the user’s intent is a read operation. Requests that imply data modification — updates, deletes, inserts — are rejected at the application layer with a structured error. This isn’t the security boundary (that’s the database-level read-only user, covered later), but it prevents wasted LLM calls on requests that would never execute anyway.</p><p>Each tool became an expert in its domain. The system figured out which domain a question belonged to, routed it to the right tool, generated correct SQL, executed it, and returned the answer.</p><p>This worked. Until we hit the next problem.</p><p><em>(There’s actually a much better way to handle the routing — a multi-agent architecture where an orchestrator decides not just which tool to use but how to combine them. That’s the next post.)</em></p><h3><strong>Round 3: Correct SQL Is Not Safe SQL</strong></h3><p>Here’s the thing that kept us up at night.</p><p>A sales rep in the East region types: “show me all orders.”</p><p>The LLM generates:</p><pre>SELECT * FROM Orders</pre><p>Technically correct. The SQL is valid. It will execute without error.</p><p>It will also return orders from every region in the company — including pipelines the sales rep has no business seeing.</p><p>The SQL is correct. It is also, depending on your industry, <strong>a compliance incident</strong>.</p><p>We briefly considered solving this with prompt engineering. We added instructions like “only query data the user is allowed to see.” Then we remembered that prompts are suggestions, not law. A determined user — or a confused model — can work around any instruction you put in a system prompt.</p><p>Prompt engineering is not access control. Authorization belongs in code.</p><p>We needed something that would hold even when the LLM did something unexpected. So we built three layers of authorization scope — and then added four more for good measure.</p><p><strong>Three Levels of Data Scope Enforcement</strong></p><p><strong>L1 — Pre-Validation.</strong> Before the LLM generates any SQL, we check whether the user has the right authorization scope for this domain. Each tool declares its requirements (Sales Tool → requires: SalesView, OrderAdmin). No match? Reject immediately — no LLM call, no wasted tokens. The model never even gets a chance to help.</p><p><strong>L2 — Scope Injection.</strong> Every tool is instantiated with the user’s scope baked in — their RegionId, their TeamId. The LLM receives a schema where filters are already declared. It literally cannot generate a query outside the user&#39;s boundary without the query failing to parse. The model isn&#39;t trusted to add the right WHERE clause. We add it for them.</p><p><strong>L3 — Entity Validation.</strong> After SQL generation, we parse which tables the query touches and validate the user has access for each entity type. If the LLM tries to JOIN to a table the user can’t access, we catch it here — before execution, not after.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dle_xytBCqMBUC6khFJO6g.png" /></figure><p><strong>Defense in Depth: Seven Layers</strong></p><p>Let’s start with the foundation.</p><p><strong>Layer 0 — Database-Level Read-Only Access.</strong> The AI pipeline connects through a dedicated SQL user with SELECT on whitelisted tables only. No INSERT, UPDATE, DELETE, or DDL. This is non-negotiable and costs nothing to set up. Every other layer below is defense in depth — if they all fail simultaneously, the database still rejects anything harmful.</p><p><em>In environments where separate DB accounts for read, write, and DDL operations are standard practice, this is table stakes. We mention it explicitly because in AI pipelines, it’s surprisingly easy to overlook — teams often reuse application service accounts that have broader privileges than needed.</em></p><p>No single check is enough. We stack seven layers, each catching what the others miss:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4qUO0xmfnWK8VsPR1EuevQ.png" /></figure><blockquote>The AI pipeline connects using a dedicated SQL user that only has `SELECT` on specific whitelisted tables. No INSERT. No UPDATE. No DELETE. No schema modifications of any kind.</blockquote><p>If the LLM somehow loses its mind and generates `DROP TABLE Orders`, the database simply responds:</p><p>&gt; “Nice try.”</p><p>Every other layer is application code — which means it can have bugs, edge cases, and Friday afternoon deployments. Layer 0 is enforced by the database engine itself. Even if every single application layer fails simultaneously, the database will still reject anything harmful. This is your last line of defense and it costs almost nothing to set up.</p><p>What if the RBAC filter merge fails? <strong>Just return zero rows</strong>, not too many. Getting an empty result is a recoverable situation. Leaking someone else’s data is not.</p><p><strong>The Cost Problem</strong></p><p>Running every question through the best available model is great for accuracy and terrible for your LLM Service bill.</p><p><em>Hi, how are you?</em> does not need a $0.15-per-call model.</p><p>We built an auto-classifier that evaluates two things — <strong>complexity</strong> (is this a simple lookup or a multi-step analytical question with aggregations and date math?) and <strong>priority</strong> (does this user need maximum precision or is good-enough fine?):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fGwdfEGVYqKGEKz-BDbdmg.png" /></figure><p>Conversational messages — “thanks!”, “got it”, “can you clarify?” — skip the agent pipeline entirely and hit the cheapest model. This saved roughly 80% on those calls specifically, and about 30% on total LLM spend overall.</p><p>The system picks the right model automatically. Users never think about it. They just notice it feels fast.</p><blockquote><strong><em>One thing we learned: the cost of a wrong query — a bad business decision made from incorrect data, or a security incident from data that shouldn’t have been returned — far exceeds the cost of using a better model for that one call. Optimize for correctness first. Then optimize for cost.</em></strong></blockquote><p><strong>Conslusion — What We Learned</strong></p><p><strong>On SQL generation:</strong> Segment your schema by domain — full-schema prompts produce garbage on real databases. Annotate schemas with column descriptions, FK hints, and mandatory filter reminders. Treat your schema like documentation for a new engineer, not a raw DDL dump. Use the best model for SQL generation even if cheaper models handle everything else.</p><p><strong>On authorization:</strong> Return SQL filter fragments from your auth system, not booleans. Scope tools at instantiation time — don’t trust the LLM to add the right WHERE clause. When the security mechanism breaks, return nothing (0 rows). And yes — the read-only database user is standard practice, but in AI pipelines it’s your most important layer. Make sure it’s there before you build anything else on top.</p><p><strong>On cost:</strong> Not every question needs your best model. Conversational bypass alone saved us ~30% on LLM costs. Complexity and priority routing does the rest automatically.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80d435e53118" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apra-labs-blog/how-we-got-llms-to-query-our-database-without-leaking-a-single-unauthorized-row-80d435e53118">How We Got LLMs to Query Our Database Without Leaking a Single Unauthorized Row</a> was originally published in <a href="https://medium.com/apra-labs-blog">Apra Labs Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to install Cassandra on your Ubuntu machines ?]]></title>
            <link>https://medium.com/@siddharthanantdeshpande/how-to-install-cassandra-on-your-ubuntu-machines-d78ed93e23aa?source=rss-9899dff27c5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/d78ed93e23aa</guid>
            <category><![CDATA[cassandra]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Siddharth Deshpande]]></dc:creator>
            <pubDate>Fri, 23 Oct 2015 18:10:28 GMT</pubDate>
            <atom:updated>2015-10-23T18:20:14.500Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>How to install Cassandra on your Ubuntu machines ?</strong></p><p>Well some people might be wondering why Cassandra? and why not MongoDB ? The reason for that is <strong>Cassandra</strong> is best for writes i.e insert statements. Its super fast than any other NoSQL solution. (Also our last project required this type of solution). For more information, you can visit the following <a href="http://www.datastax.com/wp-content/themes/datastax-2014-08/files/NoSQL_Benchmarks_EndPoint.pdf">link</a> to understand.</p><p>I am considering you all have Ubuntu 12.04 and above installed on your machines, I have not tried installing on versions prior to Ubuntu 12.04.</p><p><strong>Prerequisite — </strong>You should have <strong>Java Oracle JDK 1.7 and greater</strong> installed on your machine before you install Cassandra on your machine.</p><p><strong>How to install Java Oracle JDK 1.7 and greater on your machine ?</strong></p><p>First fire up your terminal</p><blockquote>$ java -version</blockquote><ol><li>If you get something like</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*zvqVCsi-0dUEeb_rzxN2qg.png" /><figcaption>java -version output</figcaption></figure><p><strong>Note: You should have OracleJDK and not OpenJDK, They say it will work with OpenJDK, but for me it did not work well.</strong></p><p>If you have OpenJDK and want to install Java OracleJDK, you DO NOT NEED to uninstall OpenJDK. First Search for a tutorial to install Java Oracle. Here is one to get you started <a href="https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get">Install OracleJDK</a>. You can search on your own if you want.</p><p>Just install OracleJDK just beside it and set the default option with</p><blockquote>$ sudo update-alternatives — config java</blockquote><p>Look at the screen below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*5sIVF4nt_Gfmkqo8vFyqmg.png" /></figure><p>It will actually give you an option of installing java side by side. And you can select a default Java version which you want to use. Awesome right ? Cool then if you have done with this step then lets move to the next.</p><p>So without wasting much of time lets begin to install Cassandra.</p><p>There are two ways you can install Cassandra.</p><ol><li>If you want to learn Cassandra you could download a package from their website, everything required is right there (This is just to see how is Cassandra, Just to experiment and play with it)</li><li><strong>[I Recommend you to use this] </strong>If you want for development purposes, then install a full copy of Cassandra.</li></ol><p><strong>Step 1 : Paste the Repository path into source file.</strong></p><p>We would love to install from the repository, rather than a tar ball or something, It’s very tedious to configure. With this type of installation it comes configured up to some extent.</p><p>So Quickly go to, <a href="http://wiki.apache.org/cassandra/DebianPackaging">http://wiki.apache.org/cassandra/DebianPackaging</a></p><p>Keep that open we need to copy the two lines,</p><blockquote>deb <a href="http://www.apache.org/dist/cassandra/debian">http://www.apache.org/dist/cassandra/debian</a> 21x main<br>deb-src <a href="http://www.apache.org/dist/cassandra/debian">http://www.apache.org/dist/cassandra/debian</a> 21x main</blockquote><p>Now Fire up terminal and type</p><blockquote>$ sudo nano /etc/apt/sources.list</blockquote><p>Go way down into that file and add the above two lines which we have copied. Right Click and paste will work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5JOHmfivheIlNc2rFJHIdQ.png" /></figure><p>Press Control + X, it will ask you if you have to save. Save with same file name.</p><p><strong>Step 2 : Update Repository of your Ubuntu Machine and install Cassandra.</strong></p><p>First Update your keys, So type the following into terminal. One after another, do not copy all and paste all.</p><blockquote>gpg — keyserver pgp.mit.edu — recv-keys F758CE318D77295D<br>gpg — export — armor F758CE318D77295D | sudo apt-key add -</blockquote><blockquote>gpg — keyserver pgp.mit.edu — recv-keys 2B5C1B00<br>gpg — export — armor 2B5C1B00 | sudo apt-key add -</blockquote><blockquote>gpg — keyserver pgp.mit.edu — recv-keys 0353B12C<br>gpg — export — armor 0353B12C | sudo apt-key add -</blockquote><p>then do an update of your system,</p><blockquote>$ sudo apt-get update</blockquote><p>Now install Cassandra,</p><blockquote>$ sudo apt-get install cassandra</blockquote><p><strong>Step 3 : Configure Cassandra.</strong></p><p>Now that you have installed Cassandra, we need to configure it properly. If it was MySQL it would be somewhat configured. But this is Cassandra so lets configure it. Fire up your terminal once again and type</p><blockquote>$ cd /etc/cassandra/</blockquote><blockquote>$ ls -l</blockquote><p>Here are all the Cassandra Configuration files. Do not touch anything here. We will keep the default configuration, It is just to show you where are the configuration files are in case in future you want to change any cluster name or log locations or something. By default Cassandra instance must have already started. So lets stop it first to make all the configurations.</p><blockquote>$ sudo /etc/init.d/cassandra stop</blockquote><p>Cassandra files for logs and data are maintained in</p><p><strong>/var/lib/cassandra/</strong> — All the folders here contain Cassandra databases and caches.</p><p><strong>/var/log/cassandra/ </strong>— system log files that record some errors while starting up Cassandra and requests to Cassandra from outside.</p><p>Folders and files in <strong>/var/lib/cassandra/ and /var/log/cassandra/ </strong>are auto created when Cassandra is started first time right after installation. So we can even change the location of the files by doing some configuration in <strong>/etc/cassandra/cassandra.yaml</strong> file. But that is a different tutorial, Not now.</p><p>We need to give permissions to <strong>/var/lib/cassandra/ </strong>so that the directory is writable. So go ahead and type following command into terminal. <strong>Be very cautious over the path.</strong></p><blockquote>$ sudo chmod -R 777 /var/lib/cassandra</blockquote><p><strong>Step 4 : Start Cassandra and try to run it.</strong></p><p>To start Cassandra type.</p><blockquote>$ sudo /etc/init.d/cassandra start</blockquote><blockquote>$ cqlsh</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*eF-5BnJ6SBHBALWX9uqa_Q.png" /></figure><p>And you are done :)</p><p><strong>References:</strong></p><ol><li>Install Cassandra in Ubuntu — <a href="http://www.thetechnicalstuff.com/install-apache-cassandra-on-ubuntu-linux/">http://www.thetechnicalstuff.com/install-apache-cassandra-on-ubuntu-linux/</a></li><li>Tutorial for Cassandra — <a href="https://academy.datastax.com/courses/installing-and-configuring-cassandra">https://academy.datastax.com/courses/installing-and-configuring-cassandra</a></li></ol><p>3. Get Started page for Cassandra — <a href="http://wiki.apache.org/cassandra/GettingStarted">http://wiki.apache.org/cassandra/GettingStarted</a></p><p>4. Download tar ball and other versions of Cassandra i.e. windows, Red hat version etc — <a href="http://planetcassandra.org/cassandra/">http://planetcassandra.org/cassandra/</a></p><p>If there is any mistake I have done please let me know :)</p><p>Happy Coding :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d78ed93e23aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to do good code design when writing JavaScript code ?]]></title>
            <link>https://medium.com/@siddharthanantdeshpande/how-to-do-good-code-design-when-writing-javascript-code-94e50f648574?source=rss-9899dff27c5c------2</link>
            <guid isPermaLink="false">https://medium.com/p/94e50f648574</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Siddharth Deshpande]]></dc:creator>
            <pubDate>Thu, 22 Oct 2015 09:07:44 GMT</pubDate>
            <atom:updated>2015-10-23T03:54:39.679Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<p>How to do good code design when writing <strong>JavaScript</strong> code ?</p><p>I usually don’t write what I learnt during a project, but today I was inspired when I came across the following link <a href="http://garann.com/dev/2013/how-to-blog-about-code-and-give-zero-fucks/?utm_content=buffer204f9&amp;utm_source=buffer&amp;utm_medium=twitter&amp;utm_campaign=Buffer">How to blog about code and give zero fucks</a>. So here I am writing what I learnt from my last project.</p><p>First let me tell you what is code design, writing a code in such a way that you achieve 3 very important things,</p><ol><li>The Code should be self understandable to an average programmer with a little bit of head scratching.</li><li>We should be able to scale the code for a new feature.</li><li>How reusable is the code you have written?</li></ol><p>Some programming languages would help you do the above 3 things very easily, but if you compare it with JavaScript, you can write anything any where and it would just work. Unknowingly after some days you wont even remember what code you have written where, and it would all be a mess at the end. Now imagine some other programmer wants to add a feature, it would be difficult for him to understand, and a lot of time would be wasted in that.</p><p>So for that, we did some hunting on the web and came up with an idea to solve the above problem.</p><p><strong>For Example</strong>, Consider you developing a functionality on a page (of course with ajax) like Search some data, Add new Entries, Delete few Entries etc, what you would do is create a JavaScript file and dump the functionality of each requirement like the code shown below (using jQuery),</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*LY7hnCoHxL2E_aWMwhoAYA.png" /></figure><p>Instead you could do the following,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*r3ipG1ht1W1bkgjg1WE_pw.png" /></figure><p>This is the way how we call it,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/278/1*LDKKQ-PWawKmEqY_FmA_-w.png" /></figure><p><strong>init() — </strong>This function is like the constructor of the code, here you can do all the construction works.</p><p><strong>build() — </strong>if you want to build some html using JavaScript we could do it here.</p><p><strong>attach() — </strong>all the events that take place on that module or a page can be added in attach.</p><p>With these simple rules we can achieve very simplistic, understandable and reusable code.</p><p>If you have any suggestions please let me know :)</p><p>Happy Code Designing :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94e50f648574" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>