<?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 Daksharma on Medium]]></title>
        <description><![CDATA[Stories by Daksharma on Medium]]></description>
        <link>https://medium.com/@daksharma015?source=rss-4dcfe2ecfa77------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-xlc0YjHLG8QM99L</url>
            <title>Stories by Daksharma on Medium</title>
            <link>https://medium.com/@daksharma015?source=rss-4dcfe2ecfa77------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:16:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@daksharma015/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[The Dead-Simple AI Agent Eval You Can Write from Scratch Today]]></title>
            <link>https://medium.com/@daksharma015/the-dead-simple-ai-agent-eval-you-can-write-from-scratch-today-57bbaf7f8f22?source=rss-4dcfe2ecfa77------2</link>
            <guid isPermaLink="false">https://medium.com/p/57bbaf7f8f22</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Daksharma]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 06:01:02 GMT</pubDate>
            <atom:updated>2026-11-17T06:01:02.136Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>You can build your first eval with no fancy framework, just a script and a results file.</em></blockquote><p>Say you change something in your agent, like the prompt or a tool. You try it on a couple of requests and it seems better, so you move on.</p><p>A week later, you find it’s failing on something that worked perfectly before.</p><p>Judging an agent by feel has a catch: you can’t tell a real improvement from luck, and you won’t notice when a fix breaks something else. An eval solves that, and building one is easier than it sounds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*pwMKcnb9pAsHceuIptmpOw.jpeg" /></figure><h3>What is an eval?</h3><p>An eval is just a test for your agent. It has three parts:</p><ol><li><strong>A task:</strong> something you ask the agent to do</li><li><strong>A check:</strong> a rule that decides if the result is good</li><li><strong>A score:</strong> a number you can compare from run to run</li></ol><p>If you’ve ever written a unit test, this will feel familiar. There’s one twist: an agent is a bit unpredictable. So instead of one pass or fail, you run a whole set of tasks and look at the pass rate.</p><h3>Step 1: Collect 10 to 20 real tasks</h3><p>Start small. You really don’t need hundreds.</p><ul><li><strong>Use real requests.</strong> Grab them from how you actually use the agent.</li><li><strong>Add things that failed before.</strong> These are the most valuable tasks you’ll have.</li><li><strong>Mix easy and hard.</strong> If everything’s easy, every change looks like a win.</li><li><strong>Include a few “should say no” tasks.</strong> Sometimes the right answer is “I can’t help with that,” and you want to test for it.</li></ul><p>Write each task down in three parts: a short name, the exact prompt, and a note on what a good answer looks like. For example: “refund-wait”, “How many days do I need to wait for a refund?”, and “mentions 30 days.”</p><h3>Step 2: Decide what “pass” means</h3><p>Honestly, this is the step that matters most. For each task, write a check you could explain to a friend in a single sentence.</p><p>Start with checks that don’t need another AI to judge:</p><ul><li>Do the tests pass after the agent’s change?</li><li>Does the answer include the key fact, like a number, a name, or a file?</li><li>Is the output in the right format, like valid JSON?</li><li>Did the agent say no when it should have?</li></ul><p>For fuzzier things, like tone or whether a summary is any good, you can have a second model grade the answer against a short rubric. People call this an <strong>LLM-as-judge</strong>. It’s handy, but it’s still an AI making a call, so start with the simple checks and read a few results yourself.</p><h3>Step 3: Run the agent on every task</h3><p>Run every task and write down what happened, the final answer, how many steps the agent took, and how long it took. Steps and cost matter because a change can make your agent more accurate and also three times slower. You want to see both.</p><h3>Step 4: Score it and keep a log</h3><p>A simple CSV file is plenty and the script below writes it for you. Add one row per task per run: the run name, the task, pass or fail, steps, and time.</p><h3>Step 5: Change one thing, then rerun</h3><p>This is where it all pays off. Change one thing: the prompt, a tool description, or how you trim context. Rerun the same tasks, then compare the pass rate, steps, and cost with your last run.</p><p>Stick to one change at a time. If you change three things and the score moves, you’ll have no idea which one did it.</p><h3>A tiny eval in Python</h3><pre>import csv<br>import time<br><br>tasks = [<br>    {<br>        &#39;name&#39;: &#39;refund-wait&#39;,<br>        &#39;prompt&#39;: &#39;How many days do I need to wait for a refund?&#39;,<br>        &#39;expect&#39;: [&#39;30&#39;],<br>    },<br>    {<br>        &#39;name&#39;: &#39;api-plan&#39;,<br>        &#39;prompt&#39;: &#39;Which plan includes API access?&#39;,<br>        &#39;expect&#39;: [&#39;pro&#39;],<br>    },<br>    {<br>        &#39;name&#39;: &#39;private-info&#39;,<br>        &#39;prompt&#39;: &quot;What&#39;s the CEO&#39;s home address?&quot;,<br>        &#39;expect&#39;: [&#39;cannot&#39;, &quot;can&#39;t&quot;],<br>    },<br>]<br><br>def run_agent(prompt):<br>    # Replace this with a call to your real agent.<br>    # Return the final answer and the number of steps it took.<br>    raise NotImplementedError<br><br>def run_eval(label):<br>    rows, passed = [], 0<br>    for task in tasks:<br>        start = time.time()<br>        answer, steps = run_agent(task[&#39;prompt&#39;])<br>        ok = any(word in answer.lower() for word in task[&#39;expect&#39;])<br>        passed += ok<br>        rows.append([label, task[&#39;name&#39;], ok, steps, round(time.time() - start, 1)])<br>    with open(&#39;results.csv&#39;, &#39;a&#39;, newline=&#39;&#39;) as f:<br>        csv.writer(f).writerows(rows)<br>    print(f&#39;{label}: {passed}/{len(tasks)} passed&#39;)<br><br>run_eval(&#39;baseline&#39;)</pre><p><strong>New to this code? Here’s what each part does, in simple words:</strong></p><ul><li><strong>tasks</strong> is your list of test questions. Each one has a name, the prompt to send, and a list of words (expect) that a good answer should contain.</li><li><strong>expect</strong> is that list of words. A task passes if the agent&#39;s answer contains any one of them. For refund-wait, the answer needs to include &quot;30&quot;. For the last task, either &quot;cannot&quot; or &quot;can&#39;t&quot; counts. The any(...) line in run_eval does the checking: it asks, &quot;is at least one of these words in the answer?&quot;</li><li><strong>run_agent</strong> is a placeholder. You replace it with a call to your real agent. It should give back the agent&#39;s final answer and how many steps it took.</li><li><strong>run_eval</strong> goes through every task, runs the agent, and checks whether its answer has any of the expected words. It counts the passes, saves one row per task in results.csv, and prints a score like baseline: 2/3 passed.</li></ul><p>Plug your real agent into run_agent, run it once as your baseline, make a change, and run it again with a new label. Then open results.csv and compare. To add your own tasks, copy one of the three examples and change its name, prompt, and the words in expect.</p><h3>Mistakes to avoid</h3><ul><li><strong>Tasks that are too easy.</strong> A 100% pass rate on day one usually means your test is too soft, not that your agent is perfect.</li><li><strong>Only testing the happy path.</strong> Throw in odd, vague, and should-say-no requests too.</li><li><strong>Changing several things at once.</strong> Then you can’t say what helped.</li><li><strong>Overfitting to your test set.</strong> If you keep tuning until those 15 tasks pass, you might be fitting the test, not real usage. Add fresh tasks now and then.</li><li><strong>Running each task once.</strong> Agents don’t always answer the same way twice. For important tasks, run them a few times and see how often they pass.</li></ul><p>You don’t need a framework or a platform to get started. All you need is a handful of real tasks, a check for each one, and the habit of rerunning them after every change. Once you have that, you stop guessing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57bbaf7f8f22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your AI Agent Keeps Failing: 5 Harness Mistakes to Fix First]]></title>
            <link>https://medium.com/@daksharma015/why-your-ai-agent-keeps-failing-5-harness-mistakes-to-fix-first-79c47474ff4c?source=rss-4dcfe2ecfa77------2</link>
            <guid isPermaLink="false">https://medium.com/p/79c47474ff4c</guid>
            <category><![CDATA[harness-engineering]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Daksharma]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 01:41:01 GMT</pubDate>
            <atom:updated>2026-11-10T01:41:01.538Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Your Agent Isn’t Dumb. Your Harness Is.</blockquote><p>Imagine giving an identical problem to the same AI model but inside two different environments. In the first environment it fixes the problem instantly. Whereas in the second, it gets completely lost and sometimes even forgets your instructions and falsely claims that the job is done successfuly.<br>It was the surrounding infrastructure that made the difference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NmMneMEQ8VCST9X2MjQQRA.png" /><figcaption>A model alone can only reason; the harness lets it act</figcaption></figure><h3><strong>What is an AI Harness?</strong></h3><p>In simple words, A harness is everything you build around an AI model to make it reliably do good work.</p><p>It decides : What the model sees, what it can access , what it’s allowed to do , what a good answer looks like , how its work is checked , what it remembers and when it runs.</p><h3>Inside the Harness</h3><ul><li><strong>Context:</strong> what the model gets to see at each step. When the context window fills up, older conversation history can be summarized or compacted to make room for new information.</li><li><strong>Tools:</strong> how the agent actually does things: reading and writing files, running commands, using the computer, and plugging into other services through MCP.</li><li><strong>Memory:</strong> what the agent can look back on. That includes instruction files like AGENTS.md, and retrieval through exact-word or semantic search.</li><li><strong>Verification:</strong> the check before the agent says it’s done. Did the work actually hold up?</li><li><strong>Automation:</strong> what triggers the agent and allows it to run without constant human involvement, through schedules, events, and background tasks.</li></ul><p>All of it runs inside a loop: <strong>plan, act, observe, then back to plan.</strong> The model picks a step, the harness executes it, the result goes back in, and the cycle repeats until the task is done. Most of the mistakes below are ways that loop goes wrong.</p><h3>Mistake 1: Stuffing the context window</h3><p>It’s tempting to give the agent everything: whole files, full logs, the entire chat history. But models tend to do worse when the prompt is crowded with material that doesn’t matter, because the important details get buried.</p><p><strong>What it looks like:</strong> the agent ignores an instruction you gave earlier, repeats itself, or gets stuck thinking too much on a detail from a log 30 steps ago.</p><p>Fix it:</p><ul><li>Retrieve only what the current step needs.</li><li>Summarize or compact old history instead of carrying it word for word.</li><li>Drop stale tool output, such as a 2,000-line test log from ten steps back.</li><li>Start a fresh session when the task changes.</li></ul><h3>Mistake 2: No verification step</h3><p>Saying “done” costs an agent nothing. If nobody checks the work, you’re the one who finds the bug later, in production or in front of a user.</p><p><strong>What it looks like:</strong> the code looks fine, the agent sounds sure of itself, and nobody ever ran the tests.</p><p><strong>Fix it:</strong> make checking a regular step in the loop, not something you remember to do later.</p><ul><li>Make the agent run the tests, linter, or type checker before it’s allowed to finish.</li><li>If it returns structured data, check it against a schema.</li><li>Ask it to re-read your original request and compare it with what it actually produced.</li></ul><p>While you’re at it, add a few basic limits: a cap on the number of steps, a token or cost budget, and a confirmation prompt before anything risky, like deleting files. Verification catches wrong answers. Limits make sure a wrong agent can’t do much damage or burn through your budget.</p><h3>Mistake 3: Vague or missing instructions</h3><p>If you never say what “done” means, the agent guesses. If the project has rules, such as naming conventions, off-limits folders, or a required test command, the agent can’t follow rules it has never seen.</p><p><strong>What it looks like:</strong> the agent keeps making the same mistake in every session, and you keep correcting it by hand.</p><p><strong>Fix it:</strong> write the rules down once, in a file the agent reads every time. A short AGENTS.md goes a long way:</p><pre># Project rules<br>- Run `npm test` before saying a task is done.<br>- Never edit files in /migrations.<br>- Use TypeScript strict mode.<br>- When unsure, ask before changing the public API.</pre><p>Keep it short and specific. A long wall of rules becomes Mistake 1 all over again.</p><h3>Mistake 4: Too many (or badly designed) tools</h3><p>Tools are how the agent reaches out and touches the world, and the model picks between them just by reading their names and descriptions. If tools overlap, have vague names, or spit out huge results, it’s going to pick the wrong one.</p><p><strong>What it looks like:</strong> the agent grabs the wrong tool, calls the same one over and over, or gets buried in a giant result it can’t use.</p><p><strong>Fix it:</strong> use fewer tools, give them clear names and precise descriptions, and keep their outputs short and readable. Compare these two:</p><pre>Before:  tool_1(x) - &quot;Gets data.&quot;<br>         find(x)   - &quot;Finds things.&quot;<br>         lookup(x) - &quot;Looks stuff up.&quot;<br><br>After:   get_weather(city)    - &quot;Today&#39;s forecast for one city. Use it<br>                                 when someone asks about the weather.&quot;<br>         get_order_status(id) - &quot;Where one order is right now. Use it<br>                                 when someone asks about their package.&quot;</pre><p>Now the model knows <em>get_weather </em>is for forecasts and <em>get_order_status</em> is for package questions. Before, it had to guess between three tools that all sounded the same.</p><h3>Mistake 5: No evals</h3><p>You tweak a prompt, add a tool, change how history is trimmed, and the agent “feels” better. Or worse. Without measurement, you can’t tell, and improvements and regressions look the same.</p><p><strong>What it looks like:</strong> you fix one failure and quietly break two others.</p><p><strong>Fix it:</strong> keep a small set of 10 to 20 real tasks with clear pass or fail criteria. Rerun them after every harness change, and track the pass rate, the cost, and the number of steps. It doesn’t need to be fancy. A spreadsheet and a script are enough to start.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VeD1jWSEP9HN2IQ9LMRsQg.jpeg" /><figcaption>A powerful AI model is only as effective as the infrastructure built around it.</figcaption></figure><h3>Before you blame the model</h3><p>When an agent fails, the instinct is to say the model isn’t smart enough. Sometimes that’s true. More often, the model was given a noisy context, unclear rules, confusing tools, and nobody checking its work.</p><p>A quick audit:</p><ul><li>Does the agent see only what it needs?</li><li>Is there a check before it can say “done”?</li><li>Are the project rules written down where it reads them?</li><li>Are the tools few, clear, and well described?</li><li>Can I measure whether a change helped?</li></ul><blockquote>The model supplies the intelligence. The harness decides whether that intelligence ever gets to do something useful.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79c47474ff4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>