<?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: Harshil Srivastav</title>
    <description>The latest articles on DEV Community by Harshil Srivastav (@harshil-sri).</description>
    <link>https://dev.to/harshil-sri</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%2F4232487%2Fa80041f6-0850-4159-a254-7dc247783f43.jpg</url>
      <title>DEV Community: Harshil Srivastav</title>
      <link>https://dev.to/harshil-sri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/harshil-sri"/>
    <language>en</language>
    <item>
      <title>Building a Switch courtroom where AI can negotiate but can't consent</title>
      <dc:creator>Harshil Srivastav</dc:creator>
      <pubDate>Sat, 07 Nov 2026 17:09:42 +0000</pubDate>
      <link>https://dev.to/harshil-sri/building-a-switch-courtroom-where-ai-can-negotiate-but-cant-consent-1g6k</link>
      <guid>https://dev.to/harshil-sri/building-a-switch-courtroom-where-ai-can-negotiate-but-cant-consent-1g6k</guid>
      <description>&lt;p&gt;A creative lead wants someone's portrait in a promo. That person wants to contribute, but doesn't want their face used. An AI can suggest a compromise. Who gets to say yes?&lt;/p&gt;

&lt;p&gt;I'm Harshil, a B.Tech AI/ML student in Delhi. My teammates Daksh, Kartik and I built &lt;strong&gt;Delegates Courtroom&lt;/strong&gt; for Flip the Switch (Track 2: Best Personal or Creative Workflow). Two AI advocates negotiate a storyboard, and the humans keep control of their own briefs and the final approval.&lt;/p&gt;

&lt;p&gt;The rule we built around: agents negotiate, humans sign.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Switch does, in plain words
&lt;/h2&gt;

&lt;p&gt;Switch Rooms gives people and agents one shared place to work. Agents join with their own identities, get requests, read the room's context and reply like teammates.&lt;/p&gt;

&lt;p&gt;The shared room log is the part that matters. Instead of copying one assistant's answer into another assistant's prompt, both of them work from the same messages.&lt;/p&gt;

&lt;p&gt;Switch Console is the desktop app for setting things up and running agents. Switch can also bridge a room to a chat app. We used Mattermost, so people send their decisions as chat messages.&lt;/p&gt;

&lt;p&gt;One thing to know before you read our repo: our advocates are external workers registered with Switch, not Console-managed model sessions. I used Console while learning Switch, but the project itself runs on a pinned Docker stack and a local polling adapter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1he7wmnoxp7zmmnjnuh9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1he7wmnoxp7zmmnjnuh9.png" alt=" " width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a courtroom?
&lt;/h2&gt;

&lt;p&gt;Delegates is for collaborators who disagree about one deliverable without disagreeing about the whole project.&lt;/p&gt;

&lt;p&gt;Our scenario is a four-panel, 30-second promo called SIGNAL. The lead's brief requires Daksh's portrait. The creator's brief forbids it and requires the closing line &lt;code&gt;Made together. On our terms.&lt;/code&gt; and the credit &lt;code&gt;Visuals: Daksh&lt;/code&gt;. Neither advocate can rewrite those terms on its own.&lt;/p&gt;

&lt;p&gt;The courtroom UI makes proposals, objections, owner questions and signatures visible. The illustrated judges are just presentation. They are not extra models deciding whose wishes count.&lt;/p&gt;

&lt;p&gt;Three Switch identities do the work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cvc-lead-advocate&lt;/code&gt; proposes the board.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cvc-creator-advocate&lt;/code&gt; reviews that exact revision and its hash against both briefs.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cvc-clerk&lt;/code&gt; runs deterministic Node.js rules. It is not a model.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both advocates use Codex CLI through one machine's existing login, each with its own Switch credentials.&lt;/p&gt;

&lt;p&gt;In the recorded rehearsal, the lead proposed a board that conflicted with the creator's brief. The creator's advocate caught it and asked for an amendment. The court paused for an owner decision, then the agents produced a revised board that passed our encoded checks.&lt;/p&gt;

&lt;p&gt;Here's the honest part. Those advocate turns really went through Switch and Codex, but the owner decisions (adopting briefs, accepting the amendment) were synthetic fixtures in an isolated database. The original rehearsal produced zero human approvals. The browser replay adds labelled synthetic signatures so you can try the downloads. So this shows the mechanism works. It does not show that the two of us agreed to anything. The output is an HTML storyboard and a text script, not a rendered video.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I set it up
&lt;/h2&gt;

&lt;p&gt;I ran Switch Console in WSL using the Linux &lt;code&gt;.deb&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For the project runtime we committed the upstream Compose file. It pins Switch core, gateway and setup to 0.31.0, with Mattermost 11.9.0, and &lt;code&gt;infra/NOTICE.md&lt;/code&gt; records where it came from. You need Node.js 22.13 or newer. There are no npm dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &lt;span class="nt"&gt;--depth&lt;/span&gt; 1 &lt;span class="nt"&gt;--branch&lt;/span&gt; main https://github.com/harshil-sri/delegates.git
&lt;span class="nb"&gt;cd &lt;/span&gt;delegates
npm run init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;npm run init&lt;/code&gt; creates an ignored &lt;code&gt;.runtime/stack.env&lt;/code&gt; with generated local credentials. Keep that folder private.&lt;/p&gt;

&lt;p&gt;The background-worker helpers are written for Windows PowerShell, not a WSL shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\scripts\start-stack.ps1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nx"&gt;npm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;run&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;setup&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;npm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;run&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;setup:engine&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\scripts\start-workers.ps1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nx"&gt;npm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;run&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are the real commands from the repo. When we verified the README on a fresh clone, &lt;code&gt;init&lt;/code&gt; and the Compose config check passed. The PowerShell helpers were only read through, not rerun on Linux.&lt;/p&gt;

&lt;p&gt;Room setup registers the three identities and creates a private room called &lt;code&gt;creative-veto-spike&lt;/code&gt; through the Mattermost bridge. The room's starting instructions include:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Respond only to explicit named requests.
Do not claim human consent.
Do not delegate further agent turns yourself.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The files in &lt;code&gt;agents/&lt;/code&gt; add role-specific rules on top. The saved briefs are the source of truth, and chat messages can't override them.&lt;/p&gt;

&lt;p&gt;Before starting workers, check your Codex sign-in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codex login status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our adapter runs Codex in read-only, ephemeral sessions with JSON response schemas. Every call uses the allowance on whatever account is signed in.&lt;/p&gt;

&lt;p&gt;Then start the frontend:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://127.0.0.1:4173/&lt;/code&gt;. The frontend proxies read-only API requests to the clerk on port 18802. Mattermost is on 18865 and the Switch dashboard on 18801.&lt;/p&gt;

&lt;p&gt;For a first sanity check, send &lt;code&gt;@cvc-clerk status C01&lt;/code&gt; in the channel. That asks the deterministic clerk, so no model runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell the next beginner
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Give participants identities, not just names
&lt;/h3&gt;

&lt;p&gt;A local model response can't advance our case. The advocate has to post through Switch, and the listener has to read that actual message back under the expected identity.&lt;/p&gt;

&lt;p&gt;Tying human accounts to owners took extra work. The pinned HTTP directory didn't expose the native-account mapping, so trusted setup uses a scoped, read-only SQL query instead of guessing who a sender is from a username.&lt;/p&gt;

&lt;h3&gt;
  
  
  Make waiting a valid state
&lt;/h3&gt;

&lt;p&gt;When an amendment needs its owner, the models stop. A run allows at most two lead proposals and one schema repair per turn. If a provider fails, the run stops. It never swaps in a canned answer. We also filter passive-agent notices, so admin chatter doesn't trigger another model call.&lt;/p&gt;

&lt;h3&gt;
  
  
  Separate infrastructure trouble from app bugs
&lt;/h3&gt;

&lt;p&gt;Docker failed on our machine because of an inaccessible, zero-byte &lt;code&gt;dockerInference&lt;/code&gt; socket. I fixed it by renaming the stale runtime directory and didn't prune any volumes. That was a fix for my machine, so don't copy it blindly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Passing tests and real consent are different things
&lt;/h3&gt;

&lt;p&gt;A fresh-clone check passed 113 tests, the syntax checks and the static build. None of that means real owners approved a board. The offline receipt checks file hashes and internal consistency, and it is not cryptographic proof of who a person is. I'd rather keep that gap visible than make the demo sound more finished than it is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building by voice with Wispr Flow
&lt;/h2&gt;

&lt;p&gt;During this hackathon I dictated my prompts, agent instructions, the README and the docs with Wispr Flow, including the instructions about protected briefs and owner-only decisions. That was our Code with Wispr workflow. Delegates itself has no speech feature.&lt;/p&gt;

&lt;p&gt;My lifetime Wispr Flow stats are a 57-day streak, 131,956 words dictated, 126 words per minute and 23 apps. Those are lifetime numbers, not measurements from this build, and I'm not claiming a measured time saving.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuxfeupx8k7tydocsvate.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuxfeupx8k7tydocsvate.png" alt=" " width="800" height="553"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;First I want to record the whole workflow with both real owners reviewing and approving the same bundle. After that, independently owned advocate workers and private chambers. Right now both workers share one provider login and the briefs are shared in the room.&lt;/p&gt;

&lt;p&gt;My favourite thing about this demo is that the most important action is sometimes stopping. The agent's clever alternative is useful, but permission belongs to the person.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Repository: &lt;a href="https://github.com/harshil-sri/delegates" rel="noopener noreferrer"&gt;https://github.com/harshil-sri/delegates&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Switch docs: &lt;a href="https://docs.switchagents.ai/" rel="noopener noreferrer"&gt;https://docs.switchagents.ai/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>opensource</category>
      <category>hackathon</category>
    </item>
  </channel>
</rss>
