<?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 Avi Weit on Medium]]></title>
        <description><![CDATA[Stories by Avi Weit on Medium]]></description>
        <link>https://medium.com/@weit_36383?source=rss-73f042bef330------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5W85IGk8xmhCvzAN0etx0A.jpeg</url>
            <title>Stories by Avi Weit on Medium</title>
            <link>https://medium.com/@weit_36383?source=rss-73f042bef330------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 14:55:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@weit_36383/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 Black-Box Approach: Optimizing Agent Capabilities with CapEvolve Without Modifying the Agent]]></title>
            <link>https://medium.com/@weit_36383/the-black-box-approach-optimizing-agent-capabilities-with-capevolve-without-modifying-the-agent-a875b85e442b?source=rss-73f042bef330------2</link>
            <guid isPermaLink="false">https://medium.com/p/a875b85e442b</guid>
            <dc:creator><![CDATA[Avi Weit]]></dc:creator>
            <pubDate>Sun, 15 Nov 2026 13:30:44 GMT</pubDate>
            <atom:updated>2026-11-15T13:30:44.977Z</atom:updated>
            <content:encoded><![CDATA[<h4>What if you want to improve an agent but cannot modify it directly? Perhaps it’s a packaged product, a production deployment, or an agent you don’t own.</h4><p>In this post, we will show you how to optimize a benchmark agent’s tools (τ²-bench) without modifying the agent, and how to take the best candidate from cap-evolve back into a vanilla benchmark (τ²-bench), where it lifts the score from 17% to 80%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*_f_wydUsxyvfoWuZvm77Kw.png" /></figure><p>Most tools that make an AI agent better assume they can reach inside it, and so does <a href="https://github.com/skillberry-ai/cap-evolve">cap-evolve</a> in its <strong>direct approach</strong>: it edits the agent’s prompt file, rewrites its tool code, then runs it again and checks the score. That works when the agent is yours: a project you know well, whose code you are willing to open to an outside process, such as an optimizer, that edits it for you.</p><p>Real agents are often built differently. Some owners, enterprises in particular, cannot give an optimizer access to their agent’s internal code or modify its implementation. For them, optimization has to work from the outside: it improves the agent without inspecting it or modifying it directly.</p><p>This is where cap-evolve’s <strong>black-box approach</strong> comes in. Here, cap-evolve deploys the capabilities it optimizes (system prompts, tools, skills) to the <a href="https://skillberry-ai.github.io/skillberry-store/">Skillberry Store</a>, and the <a href="https://github.com/skillberry-ai/skillberry-agent">Skillberry Proxy-Agent</a> reads them from there and injects them into the agent’s LLM calls. The benchmark agent itself is left unchanged: it simply receives the optimized response from Skillberry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2G2V4WIdDx396eMEYAVVQg.png" /><figcaption>The agent calls the Proxy-Agent instead of the model. The Proxy-Agent serves one skill from the Store, whose tools run against the benchmark’s environment service.</figcaption></figure><h3>Meet cap-evolve, in 30 seconds</h3><p>You give cap-evolve your agent and your own tests. It runs a loop: try the agent, look at what failed, propose a fix, re-test, and keep the fix only if the gain beats the measurement noise. At the end it scores a sealed test set it never optimized on, once. It can change the system prompt, the tool code or a whole skill package, and it drives the coding-agent CLI you already use (Claude Code, Codex, Cursor and others). It is free and Apache-2.0 licensed.</p><p>Two minutes, no API key:</p><pre>git clone https://github.com/skillberry-ai/cap-evolve.git &amp;&amp; cd cap-evolve<br>python3 -m venv .venv &amp;&amp; source .venv/bin/activate &amp;&amp; pip install ./core<br>bash benchmarks/toy/examples/calc/run.sh      # zero-API demo: the prompt goes 0.0 → 1.0</pre><p>If this sounds useful, ⭐ <a href="https://github.com/skillberry-ai/cap-evolve">star cap-evolve on GitHub</a> — it takes five seconds, and it really does help other people discover the project.</p><blockquote>For further reading refer to these Cap-evolve blogs:</blockquote><blockquote><a href="https://medium.com/@eran.raichstein/capevolve-optimize-agentic-capabilities-with-agents-6719d8d903ec">CapEvolve: Optimize agentic capabilities — with agents</a><br> A coding agent improves prompts, tools, and skills through iterative optimization.</blockquote><blockquote><a href="https://medium.com/@eran.raichstein/the-state-of-ai-agent-optimization-in-2026-and-where-cap-evolve-fits-697022d3aeee">The State of AI Agent Optimization in 2026 (and Where cap-evolve Fits)</a><br> Anyone can make a score go up. The hard part is proving it wasn’t luck.</blockquote><p>Now, back to what brought us here: the black-box approach on a real benchmark.</p><h3>Does delivery through a proxy cost you anything? The τ²-bench numbers</h3><p>The question that matters is not whether the blackbox approach improves an agent. It is whether it measures the <em>same</em> improvement as the direct approach.</p><p><strong>What is τ²-bench?</strong><br> τ²-bench is a public benchmark for customer-service agents. Each benchmark task represents a customer request, such as changing a flight or making a reservation. A simulated customer interacts with the agent, which must complete the request using tools such as flight search and booking systems. A task passes only if the final state of the underlying database exactly matches the expected outcome.</p><p>To answer that question, we ran one optimization twice on <a href="https://github.com/sierra-research/tau2-bench">τ²-bench</a>’s airline domain. Each task runs 5 times, because the same agent can pass a task once and fail it the next time. We changed only how each candidate reaches the model, and kept everything else identical:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*ND7Dnys46-TIpRE30SonKw.png" /></figure><p>In our experiment, the answer is no: <strong>the two approaches came out similar</strong>, with close final scores, the same kinds of mistakes, and an optimizer bill within about a fifth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*gXVIhfJUe89dB_2oRo6hoQ.png" /><figcaption>Source: the two cap-evolve run folders: direct measured on Nov 4, blackbox on Nov 5. Train, val and test are the same 7 tasks.</figcaption></figure><p>The final scores differ by 0.086, well under one combined standard error (about 0.20) at 35 rollouts per side. The agent also fails in much the same way: across the starting tools and every candidate, <strong>44 of 140</strong> validation rollouts fail on the direct approach and <strong>49 of 140</strong> on the blackbox approach, and the starting tools fail <strong>21 of 35</strong> and <strong>23 of 35</strong> final-test rollouts (direct and blackbox). The three top causes are the same on both: a required database write that is missing, no write at all, or an extra or wrong write (i.e. an unneeded tool call, or a tool call with wrongly filled arguments). The optimizer’s spend and tokens are close (1.2× and 1.04×). The benchmark itself runs about twice as long through the proxy, because this example sets a blackbox concurrency limit of 5 conversations at a time (direct runs up to 125).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*Q11hy4wzgW8TDXKHkW634w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*0L7ojtNXqFggMqMJCJTNhA.png" /><figcaption>Validation score per iteration, both approaches (direct from Nov 4, blackbox from Nov 5). A candidate that scored no higher was not kept.</figcaption></figure><h3>The store skill: where the optimized capabilities live</h3><p>As mentioned earlier, the blackbox approach deploys the capability it optimizes to the Store and the Proxy-Agent. That capability is deployed as a skill, which this post calls the <strong>store_skill</strong>. It is a folder that contains a SKILL.md file, with a name, a description and instructions to be sent to the model, and a scripts/ folder, where each script is a tool the model can call. It is the open <a href="https://agentskills.io/">Agent Skills</a> format, the same unit AI agents load from disk. It is also the unit the Skillberry stack is built around.</p><p>The <a href="https://skillberry-ai.github.io/skillberry-store/"><strong>Skillberry Store</strong></a> is an open-source service that manages everything your agents use — tools, skills and snippets — in one place. You add, update, version and organize them in namespaces, find them by meaning with semantic search, run them in a sandbox, and serve any subset of them as a virtual MCP server. Skills follow the Anthropic skill format (SKILL.md, tools and docs), so you can import and export them as they are.</p><p>The <a href="https://github.com/skillberry-ai/skillberry-agent"><strong>Proxy-Agent</strong></a> sits on top of it: it picks one skill and, on every call, gives the model that skill’s instructions and its tools.</p><p>For further reading on how the Store manages skills, see its <a href="https://skillberry-ai.github.io/skillberry-store/features.html">features page</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*TJemfV7ik0XEE55MQQzBvg.png" /></figure><p>In this post the skill is called store_skill. The name is just one line in the run&#39;s spec, skill_name: store_skill, and any name works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*rcRnEiFLgyz6lPDmEwA0ig.png" /></figure><h3>From one prompt to a complete optimization run</h3><p>Nothing here is hand-built for τ²-bench. Your coding agent (for example, Claude Code) onboards the benchmark by following one prompt, <a href="https://github.com/skillberry-ai/cap-evolve/blob/main/benchmarks/tau2/examples/sierra_airline/PROMPT.md">PROMPT.md</a>. When asked how a candidate should reach the model, you answer <strong>blackbox</strong>. From there, your coding agent installs the benchmark, seeds the capability from the benchmark&#39;s own source, and adds the tailoring the approach needs. It then runs cap-evolve check, makes sure it passes, and starts the optimization loop: it proposes edits, keeps only those that clear the significance gate, scores the sealed test, and writes a report.</p><p>When onboarding is done, you have five things:</p><ul><li><strong>τ²-bench</strong>, cloned and installed as is. Nobody edits it.</li><li><strong>The Skillberry Store and Proxy-Agent</strong>, each cloned into its own Python venv. A run just starts them; it never installs anything.</li><li><strong>14 frozen primitive tools</strong>: τ²’s real airline tool code, placed in the Store as is. The optimizer can’t change them, so every database read and write still runs τ²’s own code.</li><li><strong>The seed </strong><strong>store_skill</strong>: the skill described above, with one script per tool, built on top of the primitives. This is what the optimizer edits:<br>store_skill/<br>├── SKILL.md # name, description, instructions<br>└── scripts/<br> ├── &lt;tool_1&gt;.py # one file per tool the model can call<br> ├── &lt;tool_2&gt;.py<br> └── … <br>Each script starts out as just a signature, τ²’s docstring, and a call to its primitive:<br>def get_user_details(user_id: str):<br> &quot;&quot;&quot;Get the details of a user, including their reservations. ...&quot;&quot;&quot;<br> return env_get_user_details(user_id=user_id) # a frozen primitive</li><li><strong>The adapter and its tailoring module</strong>, which connect τ² to the Skillberry stack from the outside, without changing a line of τ².</li></ul><p>The tailoring is where the blackbox approach meets the benchmark. Each hook is small, and the run fails if any one of them is missing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*C_9-ysKnIPZZM485Frhhsw.png" /></figure><p>The diagram below reads left to right: onboarding prepares τ²-bench and the Skillberry stack once; each iteration edits store_skill, deploys it and lets the gate decide; and every trial of that iteration sends the agent&#39;s calls through the Proxy-Agent and the Store to τ²&#39;s environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*tH1A9tNkHSuPEtJ9b81q8Q.png" /><figcaption>From one prompt to a running loop. Highlighted boxes are where the Skillberry stack takes part.</figcaption></figure><p>Inside a trial, every call the agent makes to its model goes through the Proxy-Agent, which adds the skill’s instructions and tools; when the model calls a tool, its script runs in the Store against τ²’s environment. τ² then scores the trial as usual. The simulated customer never goes through the proxy.</p><h3>Explaining how a candidate tool is being modified, end to end</h3><p>To make this concrete, let’s follow one tool from the moment the optimizer writes it to the moment it changes τ²’s database.</p><p>The best blackbox candidate added a tool that the starting (seed) skill didn’t have: search_flights_by_price. It changed task 35 the most: the task passed <strong>0 of 5 trials</strong> with the starting tools, and <strong>5 of 5</strong> with the best candidate during the run (4 of 5 on its final test).</p><p><strong>A few words on task 35.</strong> It simulates a customer who calls with two requests. First, they insist on cancelling an upcoming flight with a full refund, which the airline’s policy doesn’t allow, so the agent must refuse. Then they want to book a new flight from JFK to SFO, which should be “the second cheapest flight in economy”. The cheapest option is a direct flight, HAT023, for $163. The right answer is the next one, a one-stop trip via Seattle (HAT069, then HAT258), for $290. The second request must be handled correctly for the task to succeed (receive a reward of 1.0).</p><p><strong>1 · The failure.</strong> The customer wants “the second cheapest flight in economy”. The starting tools search direct and one-stop flights separately, so the agent has to merge the two lists and rank the prices itself. It got it wrong in every trial: it booked a wrong flight, booked the right one twice, or never booked at all. τ²’s final database didn’t match the expected one, and every trial scored 0.</p><p><strong>2 · The edit.</strong> The optimizer adds one script, store_skill/scripts/search_flights_by_price.py: a tool that searches direct and one-stop flights together and returns every option with a free seat, ranked from cheapest to most expensive, each with the exact flight list to book. Its docstring tells the model to use it whenever the customer chooses a flight by price, or doesn&#39;t mind direct or one-stop, and to book the chosen option exactly as returned.</p><pre>def search_flights_by_price(origin: str, destination: str, date: str, cabin: str,<br>                            depart_after: str = &quot;&quot;, max_stops: int = 1):<br>    &quot;&quot;&quot;Search ALL itineraries (direct AND one-stop) on a date, for one cabin,<br>    sorted from CHEAPEST to most expensive. Use this whenever the user asks for the<br>    cheapest / second cheapest option. &quot;rank&quot; 1 = cheapest.&quot;&quot;&quot;<br>    direct = env_search_direct_flight(origin=origin, destination=destination, date=date)    # frozen primitive<br>    onestop = env_search_onestop_flight(origin=origin, destination=destination, date=date)  # frozen primitive<br>    ...                                          # keeps options with a free seat in the cabin<br>    out.sort(key=lambda o: (o[&quot;price_per_passenger&quot;], o[&quot;stops&quot;]))</pre><p><strong>3 · Into the skill.</strong> cap-evolve deploys the candidate: it imports the store_skill into the Skillberry Store, and restarts the Proxy-Agent bound to it. The Store registers the new script as a tool and derives its JSON schema from the signature and docstring. This is what the Store keeps for the new tool:</p><pre>{<br>  &quot;name&quot;: &quot;search_flights_by_price&quot;,<br>  &quot;params&quot;: {<br>    &quot;type&quot;: &quot;object&quot;,<br>    &quot;properties&quot;: {<br>      &quot;origin&quot;:       { &quot;type&quot;: &quot;string&quot;,  &quot;description&quot;: &quot;The origin city airport in three letters, such as &#39;JFK&#39;.&quot; },<br>      &quot;cabin&quot;:        { &quot;type&quot;: &quot;string&quot;,  &quot;description&quot;: &quot;One of &#39;basic_economy&#39;, &#39;economy&#39;, &#39;business&#39;.&quot; },<br>      &quot;depart_after&quot;: { &quot;type&quot;: &quot;string&quot;,  &quot;description&quot;: &quot;Optional earliest departure time of the first flight, ...&quot; },<br>      &quot;max_stops&quot;:    { &quot;type&quot;: &quot;integer&quot;, &quot;description&quot;: &quot;1 (default) = direct and one-stop options; ...&quot; },<br>      &quot;...&quot;:          &quot;2 more parameters&quot;<br>    },<br>    &quot;required&quot;: [&quot;origin&quot;, &quot;destination&quot;, &quot;date&quot;, &quot;cabin&quot;]<br>  }<br>}</pre><p><strong>4 · What the model sees.</strong> In the next evaluation run, the Proxy-Agent lists the new tool next to the others, and the model receives the tool’s JSON schema mentioned above.</p><p><strong>5 · The call.</strong> A real call from a task-35 trial:</p><pre>search_flights_by_price(origin=&quot;JFK&quot;, destination=&quot;SFO&quot;, date=&quot;2024-05-24&quot;, cabin=&quot;econom</pre><p>The script runs inside the Store. It calls both search primitives, keeps only the options with a free seat, and ranks them by price. The model then books the second cheapest option, the one-stop HAT069 + HAT258, with τ²’s own book_reservation.</p><p><strong>6 · The effect.</strong> τ²’s final database matches the expected one, and the trial scores 1.0. The agent’s code, the benchmark and the scorer are exactly what they were before; only the skill in the Store changed.</p><p>Once the optimization is done, the owner has two ways to use what it produced:</p><ul><li><strong>Keep it in Skillberry.</strong> Leave the best skill in the Store and keep the agent pointed at the Proxy-Agent. The agent and the benchmark never change; they simply get better answers.</li><li><strong>Take it home.</strong> Export the best candidate’s skill from the folder cap-evolve writes for the run, and patch it into your own copy of the benchmark. From then on it runs there, with no Skillberry stack at all.</li></ul><p><strong>The rest of this post takes the second way.</strong> We optimize a real benchmark, τ²-bench, through Skillberry, then take the winning skill out of the run folder and patch it into a plain copy of τ²-bench, step by step, with the numbers before and after.</p><h3>Taking the winner home: patching your own τ²-bench</h3><p>An optimized skill is only useful if its owner can run it where they need it. So the last step is the reverse trip: take the best candidate out of the Store, and put it into a plain, unmodified copy of τ²-bench, with no Skillberry stack at all. The procedure changes exactly one file, the airline domain’s tools.py, and every step of it is mechanical.</p><p><strong>1 · Take the winner’s scripts</strong> from the run folder:</p><pre>.capevolve-blackbox/run/candidates/cand_0002/store_skill/scripts/   # 18 tools</pre><p><strong>2 · Clone τ²-bench:</strong></p><pre>git clone https://github.com/sierra-research/tau2-bench.git</pre><p><strong>3 · Patch </strong><strong>src/tau2/domains/airline/tools.py</strong> by four rules:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*RwwBk3Iy7D1ED2QWYnpR1Q.png" /></figure><pre># src/tau2/domains/airline/tools.py, patched<br>class _AirlinePrimitives(ToolKitBase):       # τ²&#39;s original AirlineTools, unchanged<br>    ...<br><br>class AirlineTools(_AirlinePrimitives):      # what τ² now serves to the agent<br>    def _orig(self, tool, **kwargs):         # an original tool, returned as the Store returned it<br>        try:<br>            resp = getattr(_AirlinePrimitives, tool)(self, **kwargs)<br>        except Exception as e:<br>            return f&quot;Error: {e}&quot;<br>        content = Environment.to_json_str(resp)<br>        try:<br>            return json.loads(content)<br>        except (TypeError, ValueError):<br>            return content<br><br>    @is_tool(ToolType.READ)<br>    def search_flights_by_price(self, origin: str, destination: str, date: str, cabin: str, ...) -&gt; Any:<br>        &quot;&quot;&quot;...the candidate&#39;s docstring, word for word...&quot;&quot;&quot;<br>        direct = self._orig(&quot;search_direct_flight&quot;, origin=origin,      # was env_search_direct_flight(...)<br>                            destination=destination, date=date)<br>        onestop = self._orig(&quot;search_onestop_flight&quot;, origin=origin,    # was env_search_onestop_flight(...)<br>                             destination=destination, date=date)<br>        ...<br>        out.sort(key=lambda o: (o[&quot;price_per_passenger&quot;], o[&quot;stops&quot;], str(o[&quot;departure_time_est&quot;])))<br>        ...</pre><p><strong>4 · Run the same command on both copies,</strong> unpatched and patched, with the same models, tasks and trial seeds:</p><pre>tau2 run --domain airline --task-ids 8 10 20 23 35 42 44 --num-trials 5 \<br>  --agent llm_agent --agent-llm openai/aws/claude-haiku-4-5 \<br>  --user-llm openai/aws/claude-sonnet-5 --max-concurrency 50</pre><p><strong>5 · The result.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*EolloZPfRkbqF7GBARiG0Q.png" /><figcaption>The blackbox run’s best candidate patched into plain τ²-bench. Same settings (model and eval parameters) in both τ² runs; the only difference is the patched tools.py.</figcaption></figure><p>If the patched copy scores close to what the blackbox run measured, the loop is closed: a capability optimized through the Store and the Proxy-Agent, on an agent and a benchmark nobody edited, becomes plain code its owner can run anywhere.</p><h3>What we learned</h3><p>You don’t need to open an agent to improve it: in our τ²-bench runs, capabilities optimized from the outside came close to the direct approach, and exported back into ordinary tool code that held up in plain τ²-bench.</p><p>We expect the approach to carry over to other benchmarks: it needs only an agent whose LLM endpoint can be pointed at the Proxy-Agent, and tools the Store can call. We have only tested τ²-bench so far; other benchmarks are the next step, so stay tuned.</p><h3>Try it</h3><p>cap-evolve is open source, Apache-2.0: <a href="https://github.com/skillberry-ai/cap-evolve">github.com/skillberry-ai/cap-evolve</a>. The two runs above come from <a href="https://github.com/skillberry-ai/cap-evolve/tree/main/benchmarks/tau2/examples/sierra_airline">benchmarks/tau2/examples/sierra_airline</a>, one folder per approach, and the <a href="https://skillberry-ai.github.io/cap-evolve/blackbox.html">Blackbox tab</a> explains how to set the approach up for your own benchmark. If this was useful, ⭐ star the repo — it is how other people find it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a875b85e442b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>