<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Madhusudhan V</title>
    <description>The latest articles on DEV Community by Madhusudhan V (@madhusudhan_suv).</description>
    <link>https://dev.to/madhusudhan_suv</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4227183%2F40d83a68-c484-4555-b643-2e724db14db1.jpg</url>
      <title>DEV Community: Madhusudhan V</title>
      <link>https://dev.to/madhusudhan_suv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/madhusudhan_suv"/>
    <language>en</language>
    <item>
      <title>Three ways out of my coding agent's sandbox</title>
      <dc:creator>Madhusudhan V</dc:creator>
      <pubDate>Tue, 17 Nov 2026 18:19:30 +0000</pubDate>
      <link>https://dev.to/madhusudhan_suv/three-ways-out-of-my-coding-agents-sandbox-8hn</link>
      <guid>https://dev.to/madhusudhan_suv/three-ways-out-of-my-coding-agents-sandbox-8hn</guid>
      <description>&lt;p&gt;&lt;em&gt;First published on &lt;a href="https://madhu-sv.github.io/garuda/blog/three-ways-out-of-the-sandbox/" rel="noopener noreferrer"&gt;Garuda's blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Garuda is an open-source coding agent. Its commands run in an OS sandbox: Seatbelt on macOS, bubblewrap on Linux. A command can write only in the project, the temp folders and the package caches, and it cannot read your keys. People asked me whether Garuda can help with mobile apps. So before I added Android and iOS support, I probed the sandbox with the tools that mobile developers use every day.&lt;/p&gt;

&lt;p&gt;The probes found three ways out. None of them broke a rule of the sandbox. Each one went around the rules: a service that already ran outside the sandbox did the work for the sandboxed command.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pattern
&lt;/h2&gt;

&lt;p&gt;A sandbox limits a process and its children. It does not limit a process that was running before the command started. If the sandboxed command can talk to such a process, and that process acts on its request, the work happens with the other process's rights. Security people call this a confused deputy. Mobile development is full of deputies: simulators, build daemons and device servers.&lt;/p&gt;

&lt;p&gt;Each probe was simple. A control first: in the sandbox, &lt;code&gt;head -c 4&lt;/code&gt; on a file in my home folder must fail. Then the same file through the tool under test.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The iOS simulator
&lt;/h2&gt;

&lt;p&gt;On macOS, a booted simulator runs under CoreSimulatorService, a system service. &lt;code&gt;xcrun simctl&lt;/code&gt; talks to that service over Mach messages, and Garuda's Seatbelt profile allowed Mach lookups.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;xcrun simctl io booted screenshot ~/probe5.png&lt;/code&gt; exited with 0, and the file was in my home folder, which the sandbox cannot write. A write escape.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;xcrun simctl addmedia booted ~/probe6.png&lt;/code&gt; exited with 0 for a file that the control showed as blocked. A read escape: the simulator read the file for the command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fix in 0.20.1 is one Seatbelt rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scheme"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;deny&lt;/span&gt; &lt;span class="nv"&gt;mach-lookup&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;global-name-regex&lt;/span&gt; &lt;span class="nv"&gt;#&lt;/span&gt;&lt;span class="s2"&gt;"^com\.apple\.CoreSimulator\."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A simulator command now works only outside the sandbox, after you say yes. In 0.21, iOS builds run in the sandbox, and tests that need the simulator ask.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Gradle's daemon
&lt;/h2&gt;

&lt;p&gt;This one has nothing to do with mobile. It affects every Gradle project.&lt;/p&gt;

&lt;p&gt;Gradle keeps a daemon in the background to make builds fast, and IDEs leave daemons running all day. A new &lt;code&gt;./gradlew&lt;/code&gt; client looks for a free daemon in &lt;code&gt;~/.gradle/daemon&lt;/code&gt; and hands its build to it. For the probe, I added a task that writes a file in the home folder, and I started a daemon in a normal terminal. Then a sandboxed &lt;code&gt;./gradlew probeWrite&lt;/code&gt; succeeded. The file said "written by pid 59320": the daemon from the normal terminal. The whole build had run outside the sandbox.&lt;/p&gt;

&lt;p&gt;The fix in 0.20.2:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sandboxed commands get their own daemon registry, in a temp folder that they can write already (&lt;code&gt;-Dorg.gradle.daemon.registry.base&lt;/code&gt; in &lt;code&gt;GRADLE_OPTS&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Your registry in &lt;code&gt;~/.gradle/daemon&lt;/code&gt; is hidden from them, for reads and writes. Without it a client has no address and no token for your daemons.&lt;/li&gt;
&lt;li&gt;Kotlin's compile daemon is kept out the same way.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With the fix and the outside daemon still running, the sandboxed client started its own daemon, and the write failed with "Operation not permitted". On Linux each sandboxed command has its own network, so a daemon outside is out of reach there anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. adb
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;adb&lt;/code&gt; talks to an adb server on &lt;code&gt;localhost:5037&lt;/code&gt;, and that server controls every attached phone and emulator. With a server started outside the sandbox, a sandboxed &lt;code&gt;adb devices&lt;/code&gt; listed the devices.&lt;/p&gt;

&lt;p&gt;I tried to block the port with Seatbelt. A rule for port 5037 alone worked. With Garuda's other network rules, which let sandboxed commands reach Garuda's own proxy on localhost, the same rule blocked all of localhost, and four network tests failed. Seatbelt also refused &lt;code&gt;127.0.0.1:5037&lt;/code&gt; ("host must be * or localhost"). I found no rule that blocks only that port.&lt;/p&gt;

&lt;p&gt;So the fix comes in two parts, and one gap stays open:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Garuda now looks at what a command drives. &lt;code&gt;adb&lt;/code&gt;, &lt;code&gt;emulator&lt;/code&gt;, &lt;code&gt;xcrun simctl&lt;/code&gt;, &lt;code&gt;xcrun devicectl&lt;/code&gt;, &lt;code&gt;xcodebuild test&lt;/code&gt; on a simulator or a device, Gradle's &lt;code&gt;connected…&lt;/code&gt; and &lt;code&gt;install…&lt;/code&gt; tasks, and &lt;code&gt;flutter run&lt;/code&gt; never run in the sandbox. Outside it, they ask, with a warning that says what the command drives. Scheduled jobs and evals never run them. This comes in the next release, 0.21.&lt;/li&gt;
&lt;li&gt;This check reads the words of the command, so it is not a full fix. On macOS, another program in the sandbox, such as a script that opens &lt;code&gt;localhost:5037&lt;/code&gt;, can still reach a running adb server. The guide says so, and says what to do: run &lt;code&gt;adb kill-server&lt;/code&gt; while Garuda works.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;0.20.1 also hid the keys that mobile tools leave in the home folder: &lt;code&gt;~/.android/adbkey&lt;/code&gt; (the key your devices trust), App Store Connect API keys, fastlane's session, Expo's login and Dart's publish credentials.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Ask what a command talks to, not only what it can touch.&lt;/strong&gt; My sandbox rules described files and network. The escapes came through services: a Mach service, a daemon registry, a local port. Now I list the background services of a tool before I write a profile for it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Probe with a control, and check the probe.&lt;/strong&gt; Two of my first probes lied. &lt;code&gt;test -r&lt;/code&gt; asks only the permission bits, so it says "readable" for a file that the sandbox blocks; &lt;code&gt;head -c&lt;/code&gt; opens the file and tells the truth. And a chat started in the home folder made the whole home folder the project, so the read rules did not apply.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name the limit you cannot close.&lt;/strong&gt; The adb gap is in the changelog, the safety guide and the design note. An honest limit is better than a rule that breaks localhost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A fix needs a test that fails without it.&lt;/strong&gt; Every fix here has one, and I removed each fix once to see its test fail. The Seatbelt rules need a Mac, and the CI has no macOS job yet, so each rule also had a hand test on my machine. A macOS CI job is on the list.&lt;/p&gt;

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

&lt;p&gt;0.20.2 is on npm (&lt;code&gt;@garuda-agent/garuda&lt;/code&gt;) and Homebrew (&lt;code&gt;madhu-sv/garuda&lt;/code&gt;). The Android and iOS profiles come in 0.21, with the numbers from a new mobile eval suite. I wrote the fixes with Claude as a pair programmer.&lt;/p&gt;

&lt;p&gt;If you find a way out of the sandbox, please report it privately: see &lt;a href="https://github.com/madhu-sv/garuda/blob/main/SECURITY.md" rel="noopener noreferrer"&gt;SECURITY.md&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mobile</category>
      <category>agents</category>
      <category>security</category>
    </item>
    <item>
      <title>Garuda against Claude Code, with intervals</title>
      <dc:creator>Madhusudhan V</dc:creator>
      <pubDate>Wed, 04 Nov 2026 21:16:43 +0000</pubDate>
      <link>https://dev.to/madhusudhan_suv/garuda-against-claude-code-with-intervals-1808</link>
      <guid>https://dev.to/madhusudhan_suv/garuda-against-claude-code-with-intervals-1808</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/madhu-sv/garuda" rel="noopener noreferrer"&gt;Garuda&lt;/a&gt; is an open-source coding agent for the terminal that I built to learn how coding agents work. Every command runs in an OS sandbox (Seatbelt on macOS, bubblewrap on Linux), edits ask first, and every decision goes to an audit log. It works with Claude, OpenAI-compatible APIs and local models through Ollama, and in editors over ACP.&lt;/p&gt;

&lt;p&gt;Garuda had an eval command from its first release, but it gave one run per task and one number. That is enough to catch a regression. It is not enough to say "Garuda is cheaper than X" or "this change helps". For 0.18 I rebuilt the evals so that a claim comes with an interval, and then I tested Garuda against Claude Code, a code-graph MCP server and a tuned prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  The method
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Repeated runs.&lt;/strong&gt; Each task runs 3 or 5 times, in a shuffled order from a seed, so a slow period of the API does not hit one task only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A held-out set with traps.&lt;/strong&gt; Ten tasks in TypeScript, Python and Java that no tuning ever sees. Each has a quick fix that passes the visible tests but fails a hidden one: a cache key without the currency, a new idempotency key on each retry, a refund that splits the wrong way, a migration that edits an old file. Hidden tests and mutation checks run after the agent stops.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intervals.&lt;/strong&gt; The pass rate gets a 95% interval from a bootstrap over tasks, not over runs, because the repeats of one task are not independent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Paired comparisons.&lt;/strong&gt; &lt;code&gt;garuda eval compare&lt;/code&gt; takes two reports of the same tasks (it checks a hash of each task) and gives B − A for the pass rate and B / A for the cost, each with a paired interval. A difference whose interval contains 0 (or ×1.0) is "no clear difference", never a win.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost per accepted change.&lt;/strong&gt; The cost of all attempts, failures included, divided by the passes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unexpected changes.&lt;/strong&gt; Files that a run changed but the task did not need. They do not fail the task; they are counted.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Garuda and Claude Code
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;--agent claude-code&lt;/code&gt; runs Claude Code (&lt;code&gt;claude -p&lt;/code&gt;) on the same tasks, in the same scratch folders, with the same time limit and grading. It runs with every tool allowed, so only inside Garuda's OS sandbox, with a new config folder per run and network only to &lt;code&gt;api.anthropic.com&lt;/code&gt;. Both agents used Claude Haiku 5.5, 3 runs per held-out task, seed 7.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Garuda&lt;/th&gt;
&lt;th&gt;Claude Code 2.1.312&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;td&gt;30 of 30&lt;/td&gt;
&lt;td&gt;29 of 30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost per accepted change&lt;/td&gt;
&lt;td&gt;$0.0034&lt;/td&gt;
&lt;td&gt;$0.0059&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Median time&lt;/td&gt;
&lt;td&gt;19 s&lt;/td&gt;
&lt;td&gt;25 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unexpected changes&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The pass rates show no clear difference: −3 points, interval −10 to 0. Claude Code's one failure was the refund trap. The cost shows a clear one: Claude Code cost &lt;strong&gt;×1.75&lt;/strong&gt; per accepted change (95% interval ×1.54 to ×2.06). Its median run used about 144k tokens, against 46k for Garuda.&lt;/p&gt;

&lt;h2&gt;
  
  
  My own tasks had bugs
&lt;/h2&gt;

&lt;p&gt;The first live runs failed for reasons that were mine, not the agent's. Each one showed up when I read a failed run in full:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A task failed 0 of 3 because the agent, with the right fix, added a CSV test to a protected test file. A careful engineer does that. The visible tests are no longer protected where a hidden test decides.&lt;/li&gt;
&lt;li&gt;A hidden test read a field called &lt;code&gt;dueDate&lt;/code&gt;, but the prompt never named it, and the agent chose &lt;code&gt;dueAt&lt;/code&gt;, which matched the repository's &lt;code&gt;created_at&lt;/code&gt;. A hidden test may now check only what the prompt or the repository decides.&lt;/li&gt;
&lt;li&gt;A failed check gave an empty reason: a guard stopped it with no output. Guards now say what is missing.&lt;/li&gt;
&lt;li&gt;Two runs used an old build, and the report named the checkout's commit. The build now records its own commit, and an eval warns when the checkout is newer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An eval is code. It needs the same care as the code it measures.&lt;/p&gt;

&lt;h2&gt;
  
  
  A code graph
&lt;/h2&gt;

&lt;p&gt;I tested &lt;a href="https://pypi.org/project/graphifyy/" rel="noopener noreferrer"&gt;Graphify&lt;/a&gt;, a code knowledge graph over MCP, with &lt;code&gt;--mcp graphify --mcp-prepare "graphify update ."&lt;/code&gt;. With a note in &lt;code&gt;GARUDA.md&lt;/code&gt;, the agent used it in 14 of 18 runs on the hard suite (6 tasks, about 110 files). Every run passed with and without it, and it cost &lt;strong&gt;×1.28&lt;/strong&gt; per accepted change (×1.19 to ×1.38). The agent already finds code with grep, and the graph's tools and results add tokens to every request. A graph may pay off in a much larger repository. Garuda does not include it; the docs show how to add it and how to measure it.&lt;/p&gt;

&lt;h2&gt;
  
  
  A tuned prompt
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;garuda eval tune&lt;/code&gt; lets a frontier model (Opus 5.5) propose a short addendum to the system prompt. A version stays only if no task goes from all runs to none and it passes more runs, or as many runs at a clearly lower cost. The held-out set is measured once, at the end, and the proposer never sees it. The first run cost $0.65. The kept version says, in short: batch tool calls that do not depend on each other, read only what the edit needs, verify once, stop when done.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Held-out set, all runs passing&lt;/th&gt;
&lt;th&gt;Cost per accepted change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tuned text, Haiku 5.5 (5 runs a task)&lt;/td&gt;
&lt;td&gt;×0.81 (×0.75 to ×0.88)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tuned text, Sonnet 5.5 (3 runs a task)&lt;/td&gt;
&lt;td&gt;×0.87 (×0.79 to ×0.95)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shipped rewrite, Sonnet 5.5&lt;/td&gt;
&lt;td&gt;×0.90 (×0.84 to ×0.96)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shipped rewrite, Haiku 5.5 (one refund miss)&lt;/td&gt;
&lt;td&gt;×0.88 (×0.79 to ×1.02)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;I removed two rules that served the evals, not users ("do not call &lt;code&gt;remember&lt;/code&gt;", "a one-sentence answer") and rewrote the rest in Garuda's style. The rewrite is in 0.18's system prompt. With Haiku its saving is likely but not shown with confidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  The limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The tasks are small and I wrote them. Current models pass nearly all of them, so pass rates do not yet tell two agents apart; the cost does.&lt;/li&gt;
&lt;li&gt;One model family, and Claude Code in one configuration (print mode, every tool allowed, no user settings). Costs are list prices from each run's token counts.&lt;/li&gt;
&lt;li&gt;Ten held-out tasks give wide intervals. More tasks, and a larger real repository, are next.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Run it yourself
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @garuda-agent/garuda
garuda &lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="nt"&gt;--split&lt;/span&gt; heldout &lt;span class="nt"&gt;--repeat&lt;/span&gt; 3 &lt;span class="nt"&gt;--shuffle&lt;/span&gt; &lt;span class="nt"&gt;--seed&lt;/span&gt; 7 &lt;span class="nt"&gt;-m&lt;/span&gt; claude-haiku-5-5
garuda &lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="nt"&gt;--split&lt;/span&gt; heldout &lt;span class="nt"&gt;--repeat&lt;/span&gt; 3 &lt;span class="nt"&gt;--shuffle&lt;/span&gt; &lt;span class="nt"&gt;--seed&lt;/span&gt; 7 &lt;span class="nt"&gt;-m&lt;/span&gt; claude-haiku-5-5 &lt;span class="nt"&gt;--agent&lt;/span&gt; claude-code
garuda &lt;span class="nb"&gt;eval &lt;/span&gt;compare .garuda/evals/&amp;lt;garuda-run&amp;gt; .garuda/evals/&amp;lt;claude-code-run&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The method is in the &lt;a href="https://madhu-sv.github.io/garuda/docs/guide/evals/" rel="noopener noreferrer"&gt;evals guide&lt;/a&gt;. If your numbers differ from mine, I want to know.&lt;/p&gt;




&lt;p&gt;Garuda is Apache-2.0, on npm (&lt;code&gt;npm i -g @garuda-agent/garuda&lt;/code&gt;) and Homebrew. The code and the design documents: &lt;a href="https://github.com/madhu-sv/garuda" rel="noopener noreferrer"&gt;https://github.com/madhu-sv/garuda&lt;/a&gt;. Feedback on the sandbox model and on the evals is very welcome.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>typescript</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
