<?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: Dissmay</title>
    <description>The latest articles on DEV Community by Dissmay (@dissmay_365b99df00d77e7ef).</description>
    <link>https://dev.to/dissmay_365b99df00d77e7ef</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%2F3880949%2F7f8792f3-0903-4206-97e2-2a281387468b.jpg</url>
      <title>DEV Community: Dissmay</title>
      <link>https://dev.to/dissmay_365b99df00d77e7ef</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dissmay_365b99df00d77e7ef"/>
    <language>en</language>
    <item>
      <title>My AI agents' green checkmarks were lying. Here's how I made "exit 0" mean something</title>
      <dc:creator>Dissmay</dc:creator>
      <pubDate>Sat, 05 Dec 2026 11:51:44 +0000</pubDate>
      <link>https://dev.to/dissmay_365b99df00d77e7ef/my-ai-agents-green-checkmarks-were-lying-heres-how-i-made-exit-0-mean-something-526n</link>
      <guid>https://dev.to/dissmay_365b99df00d77e7ef/my-ai-agents-green-checkmarks-were-lying-heres-how-i-made-exit-0-mean-something-526n</guid>
      <description>&lt;p&gt;I'm building a desktop app where a team of AI coding agents (Claude Code, Codex, Gemini, Cursor) takes a task end to end. The whole product rests on one rule: a task isn't done because an agent says so. It's done when there is proof — a test run, a build, a screenshot. The simplest and most common proof is a command that exits 0.&lt;/p&gt;

&lt;p&gt;It turned out that exit 0 proves much less than it looks.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Agents run commands the way people do in a hurry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; tail -20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exit code of that line is the exit code of &lt;code&gt;tail&lt;/code&gt;, not of the tests. The tests fail, &lt;code&gt;tail&lt;/code&gt; happily prints the last 20 lines and exits 0, and the task gets a green checkmark.&lt;/p&gt;

&lt;p&gt;The same thing happens with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
npm &lt;span class="nb"&gt;test&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;|| true&lt;/code&gt; turns any failure into success. After &lt;code&gt;;&lt;/code&gt; only the last command's code counts.&lt;/p&gt;

&lt;p&gt;None of this is malicious. The agent just wanted a shorter output or a clean log. But the checkmark it produced was false.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the obvious fixes don't work
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ban pipes.&lt;/strong&gt; Agents use pipes constantly, and mostly for good reasons. Refusing every pipe makes the agent useless and teaches it to work around the rule.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Look for "Exit code 0" in the output.&lt;/strong&gt; Some engines report the exit code as text in the tool result. But the command controls its own output. An internal audit of my app found exactly this: for two of the engines,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'Exit code 0'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;exits with 1 and still got a checkmark, because the text was read before the error status.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Trust the code from the engine.&lt;/strong&gt; Better, but the code is still the code of the whole line, and the line can hide a failure in any of the ways above.&lt;/p&gt;

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

&lt;p&gt;The app now reads the structure of the shell line, without running it, and decides whether its exit 0 can be trusted.&lt;/p&gt;

&lt;p&gt;It understands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;lists (&lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;, &lt;code&gt;||&lt;/code&gt;, &lt;code&gt;;&lt;/code&gt;, new lines);&lt;/li&gt;
&lt;li&gt;pipelines, including whether &lt;code&gt;set -o pipefail&lt;/code&gt; is on;&lt;/li&gt;
&lt;li&gt;subshells and &lt;code&gt;{ }&lt;/code&gt; groups;&lt;/li&gt;
&lt;li&gt;quoting, comments and here-documents;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;set -e&lt;/code&gt; and &lt;code&gt;set -o pipefail&lt;/code&gt; set by portable &lt;code&gt;set&lt;/code&gt; options.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For every way a line can hide a failure, there is a named reason the agent gets back:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;pipe&lt;/strong&gt; — a pipeline exits with its last command's code, so a failure before the last &lt;code&gt;|&lt;/code&gt; is lost unless &lt;code&gt;pipefail&lt;/code&gt; is on;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;or&lt;/strong&gt; — &lt;code&gt;||&lt;/code&gt; turns the failure of the command before it into success;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sequence&lt;/strong&gt; — after &lt;code&gt;;&lt;/code&gt; or a new line only the last command's code counts;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;negation&lt;/strong&gt; — &lt;code&gt;!&lt;/code&gt; inverts the code;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;substitution&lt;/strong&gt; — what runs inside &lt;code&gt;$(…)&lt;/code&gt; or backticks can fail without changing the exit code;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;exit&lt;/strong&gt; — &lt;code&gt;exit&lt;/code&gt;, &lt;code&gt;return&lt;/code&gt; or &lt;code&gt;exec&lt;/code&gt; before the end sets the code itself;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;nested&lt;/strong&gt; — another shell's command string (&lt;code&gt;eval&lt;/code&gt;, &lt;code&gt;sh -c&lt;/code&gt;) is not read;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;background&lt;/strong&gt; — a command started with &lt;code&gt;&amp;amp;&lt;/code&gt; is not waited for;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;unparsed&lt;/strong&gt; — syntax the reader doesn't model: &lt;code&gt;if&lt;/code&gt;, &lt;code&gt;for&lt;/code&gt;, &lt;code&gt;while&lt;/code&gt;, &lt;code&gt;case&lt;/code&gt;, functions and so on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rule is conservative: anything the reader doesn't model counts as "may hide a failure". The run keeps its real exit code and output, but it isn't accepted as proof. The agent is told why and how to run the check so that its exit code is its own:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -o pipefail &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; tail -20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A structured exit code from the engine now wins over any text in the output, and an unknown status is no longer taken for 0.&lt;/p&gt;

&lt;h2&gt;
  
  
  The second hole: code that changes during the check
&lt;/h2&gt;

&lt;p&gt;The same audit found something subtler. A test takes two minutes. Meanwhile another agent edits a file. The test passes — on the old code — and the checkmark lands on the new code.&lt;/p&gt;

&lt;p&gt;It also found that in the live data, 52 of 64 recorded proofs had no code state at all, so they stayed "proven" forever, even after the code changed.&lt;/p&gt;

&lt;p&gt;So now the code state is fingerprinted twice: when the check starts and when it ends. If it changed in between, there is no proof, with a reason that says so. A proof recorded before a change is shown as outdated, not as proven.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Programs and scripts are trusted to report their own failures. If &lt;code&gt;run-tests.sh&lt;/code&gt; swallows an error inside, the line is clean and the proof passes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;if&lt;/code&gt;, &lt;code&gt;for&lt;/code&gt; and &lt;code&gt;while&lt;/code&gt; are refused, not understood. That's a deliberate trade: refusing is safe, guessing isn't.&lt;/li&gt;
&lt;li&gt;This checks the shape of a command, not its meaning. A test suite that tests nothing will still exit 0.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I took from it
&lt;/h2&gt;

&lt;p&gt;A check that can be fooled by accident is worse than no check, because people start trusting it. When I wrote the rule "no proof, not done", I thought the hard part would be getting agents to run the tests. The hard part was making sure that a green mark means the tests actually passed.&lt;/p&gt;

&lt;p&gt;If you run tests in CI with &lt;code&gt;| tail&lt;/code&gt;, &lt;code&gt;| tee&lt;/code&gt; or &lt;code&gt;|| true&lt;/code&gt;, it's worth looking at what your green builds actually prove.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>bash</category>
      <category>testing</category>
      <category>devops</category>
    </item>
    <item>
      <title>I read the source of Telegram's Dictator, an AI agent for the Mac. Here's how it keeps the agent in a box</title>
      <dc:creator>Dissmay</dc:creator>
      <pubDate>Fri, 04 Dec 2026 18:17:57 +0000</pubDate>
      <link>https://dev.to/dissmay_365b99df00d77e7ef/i-read-the-source-of-telegrams-dictator-an-ai-agent-for-the-mac-heres-how-it-keeps-the-agent-in-13ch</link>
      <guid>https://dev.to/dissmay_365b99df00d77e7ef/i-read-the-source-of-telegrams-dictator-an-ai-agent-for-the-mac-heres-how-it-keeps-the-agent-in-13ch</guid>
      <description>&lt;p&gt;Telegram has released Dictator, an AI agent for the Mac that you talk to through an "AI Assistant" chat inside Telegram. The code is public: &lt;a href="https://github.com/TelegramMessenger/Dictator" rel="noopener noreferrer"&gt;TelegramMessenger/Dictator&lt;/a&gt;. I build agent tooling myself and have run into the same questions: how do you isolate an agent, how do you keep keys away from it, and how do you make permissions it can't talk its way around? So I read the source.&lt;/p&gt;

&lt;p&gt;These notes are based on commit &lt;code&gt;832e5a5&lt;/code&gt; (December 4, 2026). I didn't build or run anything; I only read the code and the docs in &lt;code&gt;docs/&lt;/code&gt;. File paths are relative to the repo root so every claim can be checked.&lt;/p&gt;

&lt;p&gt;One caveat up front: this repo contains the Mac app and the agent's VM. The part that actually performs actions inside Telegram lives in Telegram for macOS and isn't included here.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it is
&lt;/h2&gt;

&lt;p&gt;The agent itself isn't Telegram's own: it's &lt;a href="https://github.com/NousResearch/hermes-agent" rel="noopener noreferrer"&gt;Hermes Agent&lt;/a&gt; from Nous Research, as the README says. Dictator is everything around it: the VM, a proxy, permissions, dictation and the bridge to Telegram.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Telegram for macOS  ⇄  Dictator.app (menu bar, proxy, rules)  ⇄  Linux VM (Hermes Agent)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Isolation: a separate Linux VM
&lt;/h2&gt;

&lt;p&gt;The agent runs in a VM on Apple's Virtualization.framework (&lt;code&gt;Sources/HarnessCore/HarnessVirtualMachine.swift&lt;/code&gt;). The image is Debian 13 genericcloud for arm64, verified against SHA512SUMS (&lt;code&gt;ImageStore.swift&lt;/code&gt;). The defaults are 2 CPUs and a 16 GB disk (&lt;code&gt;HarnessConfig.swift&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;The VM talks to the Mac over vsock; the host-side proxy listens on port 8080. A neat detail: connections from guest source ports up to 1023 are treated as privileged, because only root inside the VM can bind them, and service routes like &lt;code&gt;/harness/egress&lt;/code&gt; accept only those. The agent itself runs as a &lt;code&gt;hermes&lt;/code&gt; user with a locked password.&lt;/p&gt;

&lt;p&gt;Your folders aren't shared into the VM. A shared directory is attached only when building the golden image.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Network.&lt;/strong&gt; Internet inside the VM is on by default:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Sources/HarnessCore/HarnessConfig.swift:18&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;internet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Turn it off and the VM gets no network device at all. The diagram in &lt;code&gt;docs/setup.md&lt;/code&gt; labels the VM "Debian 13, no NIC", which doesn't match the default; probably just a stale doc.&lt;/p&gt;

&lt;p&gt;The agent's outbound TCP is redirected by nftables to a local relay, which asks the host before each connection (&lt;code&gt;EgressGuest.swift&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  The model key never enters the VM
&lt;/h2&gt;

&lt;p&gt;To me this is the best decision in the project. Inside the VM, Hermes is configured with a placeholder key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Sources/HarnessCore/GuestScripts.swift:6&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;placeholderSecret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"vm-placeholder"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Model requests go through the proxy on the Mac, which adds the real Authorization header. Keys live in the Keychain as &lt;code&gt;kSecAttrAccessibleWhenUnlockedThisDeviceOnly&lt;/code&gt; (&lt;code&gt;SecretStore.swift&lt;/code&gt;). Even a fully hijacked agent doesn't hold the model key.&lt;/p&gt;

&lt;p&gt;The proxy allows only the endpoints it needs, forces the model back to the allowed list and caps &lt;code&gt;max_tokens&lt;/code&gt; (16384 by default). Reaching &lt;code&gt;openrouter.ai&lt;/code&gt; directly from the VM is blocked, so the agent can't bypass the proxy with a key of its own. Local models are supported too: Ollama and LM Studio on the Mac.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it's thin.&lt;/strong&gt; Secrets you hand the agent yourself (Settings → Secrets) do enter the VM as environment variables, written to &lt;code&gt;/home/hermes/.harness/secrets.env&lt;/code&gt; (&lt;code&gt;SecretVault.swift&lt;/code&gt;). The proxy strips them from model requests, but only by exact value and its JSON-escaped form. Base64 or a value split in pieces won't be caught. That's an honest trade-off: if the agent needs a key to do its job, it has the key.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prompt injection as a state, not a filter
&lt;/h2&gt;

&lt;p&gt;An agent that reads other people's messages will eventually read text that tries to steer it. Dictator doesn't try to classify malicious text. Instead it marks the session: once the agent has read private or outside content, the session is "tainted", and from then on connecting to a new host or running anything that persists data needs approval (&lt;code&gt;InjectionGuard.swift&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;I like this approach because it doesn't depend on how well the model separates instructions from data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it's thin.&lt;/strong&gt; Code and package hosts stay open even in a tainted session:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Sources/HarnessCore/InjectionGuard.swift:1743&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;developerHosts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"github.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"githubusercontent.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"registry.npmjs.org"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"pypi.org"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&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;Only explicit upload endpoints are excluded (gist, api.github.com, uploads.github.com, upload.pypi.org). Handy for an agent that writes code, and also a possible way out for data.&lt;/p&gt;

&lt;p&gt;Also, terminal commands inside the VM run without approval prompts (&lt;code&gt;docs/architecture.md&lt;/code&gt;). The reasoning is clear: the VM is isolated. But combined with an open network, the agent can do anything inside the VM, and the boundary is only the network and the proxy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Permissions the agent can't reach
&lt;/h2&gt;

&lt;p&gt;Each Telegram action is Allow, Ask or Never. By default reading and searching are allowed and everything that writes (sending, reacting, pinning, deleting) asks. Secret chats and service notifications (777000) are never available.&lt;/p&gt;

&lt;p&gt;What matters is where this is enforced. The VM posts an action to the proxy, the proxy queues it, and Telegram itself picks actions up and applies the policy:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Telegram enforces the policy; the VM can't reach it. — &lt;code&gt;CONTRIBUTING.md&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The settings are sealed with a Keychain key (&lt;code&gt;Harness+StateSeal.swift&lt;/code&gt;). Loosen a rule by editing the file and the change is ignored and flagged on the home screen; tightening is adopted. That closes the obvious "agent grants itself permissions by editing the config" attack.&lt;/p&gt;

&lt;p&gt;There's also Lockdown Mode: one switch that turns off automations, the internet (except the model connection), Mac control and Telegram writes. In Lockdown, commands in the VM ask first and secrets stop being passed in (&lt;code&gt;LockdownPolicy.swift&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Confirmations sent through the optional remote-control bot wait 170 seconds and then count as a denial (&lt;code&gt;TelegramBot/TelegramBotConfirm.swift&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Dictation
&lt;/h2&gt;

&lt;p&gt;This part interested me most, because I built something similar.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gesture.&lt;/strong&gt; Hold ⌥ on either side, for at least 300 ms:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Sources/HarnessCore/Dictation/DictationGesture.swift:57&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;minimumHold&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nc"&gt;DictationClock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;millisecond&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Recording starts on key down, but "armed". If another key, a mouse click or a modifier comes within those 300 ms, the clip is thrown away: that was a shortcut, not dictation. Double-tapping ⌥ locks recording on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The first word.&lt;/strong&gt; Audio is kept from about half a second before the key press (&lt;code&gt;preRoll&lt;/code&gt; in &lt;code&gt;DictationSession.swift&lt;/code&gt;), so the first word isn't clipped. Simple and right: people start talking as they press the key.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recognition.&lt;/strong&gt; I found no cloud speech engine. The options are Apple's SpeechAnalyzer, the legacy &lt;code&gt;SFSpeechRecognizer&lt;/code&gt; with on-device recognition required, and Whisper or tinyasr inside the VM. The optional model "clean-up" pass is off by default.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Insertion.&lt;/strong&gt; Normally the text goes to the pasteboard and ⌘V is posted, with the V key code looked up from the current keyboard layout (otherwise ⌘V breaks on non-QWERTY layouts). For some Chromium versions the text is typed character by character via &lt;code&gt;keyboardSetUnicodeString&lt;/code&gt; because of a clipboard race. If keystrokes would land in another window, it inserts through Accessibility instead. Password fields (&lt;code&gt;AXSecureTextField&lt;/code&gt;) never get text.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Typing as you speak.&lt;/strong&gt; On by default. If the focused field is editable through Accessibility, it's edited in place as the recognizer refines the transcript. If not, only words the recognizer has marked final are typed. A long remainder (over 240 characters) is pasted at once.&lt;/p&gt;

&lt;p&gt;In my own app I went the other way: the text is inserted once, after the key is released. Streaming recognition keeps correcting itself, and in someone else's text field that turns into a mess of rollbacks. Dictator solves it by editing the field in place, and where it can't, by waiting for final words. More work, but it feels more alive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clipboard.&lt;/strong&gt; The previous contents are restored after 500 ms, only if nothing else changed the clipboard in between. Inserted text is marked &lt;code&gt;org.nspasteboard.TransientType&lt;/code&gt;, and if the clipboard held a password manager item (&lt;code&gt;ConcealedType&lt;/code&gt;), Dictator neither reads nor restores it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Strong decisions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the model key never enters the agent's VM;&lt;/li&gt;
&lt;li&gt;the permission policy is applied by Telegram, not by code inside the VM, and can't be loosened by editing a file;&lt;/li&gt;
&lt;li&gt;prompt-injection defense works as session state, not as an attempt to detect malicious text;&lt;/li&gt;
&lt;li&gt;careful dictation: pre-roll, layout-aware ⌘V, Accessibility fallback, respect for the clipboard.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Trade-offs worth knowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;internet in the VM is on by default;&lt;/li&gt;
&lt;li&gt;GitHub, npm, PyPI and other dev hosts stay reachable after the agent has read outside content;&lt;/li&gt;
&lt;li&gt;secrets handed to the agent live in the VM, and redaction in model requests matches exact values only;&lt;/li&gt;
&lt;li&gt;terminal commands in the VM run without approval;&lt;/li&gt;
&lt;li&gt;Claude Code on the Mac runs with &lt;code&gt;--permission-mode acceptEdits&lt;/code&gt; (&lt;code&gt;ClaudeCode.swift&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project's central choice is the VM. For an agent that reads your chats, that's strong isolation by default. The price is distance from your real projects: anything the agent should work on has to cross the VM boundary.&lt;/p&gt;

&lt;p&gt;I chose the opposite in my own agent app: agents work directly in the user's repositories on the host, every step goes through a permission policy, and for engines that don't ask before acting, the macOS kernel sandbox refuses the files they must never touch. Agents stay close to the code, and the weight falls on getting the policy right.&lt;/p&gt;

&lt;p&gt;Neither path is free. Reading another team's code for the same problem is one of the fastest ways to see your own trade-offs.&lt;/p&gt;

&lt;p&gt;If you've isolated agents differently, I'd like to compare notes in the comments.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>macos</category>
      <category>telegram</category>
    </item>
    <item>
      <title>I'm building a production toolkit for Claude's new Managed Agents API</title>
      <dc:creator>Dissmay</dc:creator>
      <pubDate>Wed, 15 Apr 2026 17:15:47 +0000</pubDate>
      <link>https://dev.to/dissmay_365b99df00d77e7ef/im-building-a-production-toolkit-for-claudes-new-managed-agents-api-500c</link>
      <guid>https://dev.to/dissmay_365b99df00d77e7ef/im-building-a-production-toolkit-for-claudes-new-managed-agents-api-500c</guid>
      <description>&lt;p&gt;Anthropic released the &lt;strong&gt;Managed Agents API&lt;/strong&gt; on April 8 — and it's a game changer. You can now create persistent AI agents with tools, memory, and multi-step orchestration built in.&lt;/p&gt;

&lt;p&gt;But here's the thing: the API is powerful but &lt;strong&gt;raw&lt;/strong&gt;. Getting to production means wiring up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory and state management&lt;/li&gt;
&lt;li&gt;Tool orchestration and error handling&lt;/li&gt;
&lt;li&gt;Deployment pipelines&lt;/li&gt;
&lt;li&gt;Monitoring and observability&lt;/li&gt;
&lt;li&gt;Security and rate limiting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's weeks of boilerplate before you ship anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  So I'm building AgentForge
&lt;/h2&gt;

&lt;p&gt;A production-ready toolkit that gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;9 agent templates&lt;/strong&gt; (customer support, sales, data pipeline, etc.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript SDK&lt;/strong&gt; with type-safe tool definitions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Built-in monitoring&lt;/strong&gt; dashboard&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One-command deploy&lt;/strong&gt; — &lt;code&gt;npx agentforge deploy&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skill system&lt;/strong&gt; — plug in Stripe, Zendesk, Slack, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it as ShipFast but for AI agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  The validation approach
&lt;/h2&gt;

&lt;p&gt;Instead of building for 3 months in silence, I put up a landing page first to see if anyone actually wants this:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://forge.qalion.io" rel="noopener noreferrer"&gt;forge.qalion.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Early access with 40% off for the first 100 devs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Question for the community
&lt;/h2&gt;

&lt;p&gt;If you could deploy a production AI agent in 5 minutes, what would you build first? I'm curious what use cases people are most excited about.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>claude</category>
      <category>showdev</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
