<?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: Mzoratto</title>
    <description>The latest articles on DEV Community by Mzoratto (@mzoratto).</description>
    <link>https://dev.to/mzoratto</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%2F4107685%2F81793ed3-cf08-47c3-ab43-76d7199d7088.png</url>
      <title>DEV Community: Mzoratto</title>
      <link>https://dev.to/mzoratto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mzoratto"/>
    <language>en</language>
    <item>
      <title>I’m Building a Model-Agnostic Agent OS—How Would You Break This Architecture?</title>
      <dc:creator>Mzoratto</dc:creator>
      <pubDate>Thu, 03 Sep 2026 09:44:09 +0000</pubDate>
      <link>https://dev.to/mzoratto/im-building-a-model-agnostic-agent-os-how-would-you-break-this-architecture-3gh8</link>
      <guid>https://dev.to/mzoratto/im-building-a-model-agnostic-agent-os-how-would-you-break-this-architecture-3gh8</guid>
      <description>&lt;p&gt;I’m building a personal &lt;strong&gt;Agent OS&lt;/strong&gt; to help me develop software with AI without handing over control of my repositories.&lt;/p&gt;

&lt;p&gt;Some parts are already running across my projects. Others—such as switching between model providers, automating different trust levels, and sharing approved knowledge across repositories—are still being designed and tested.&lt;/p&gt;

&lt;p&gt;I currently use Codex as the coding agent, but I don’t want the whole system to depend on one provider. The same workflow should eventually work with Claude, Kimi, DeepSeek, MiniMax, or any other capable coding agent.&lt;/p&gt;

&lt;p&gt;The coding agent should be replaceable. The rules around it should not be.&lt;/p&gt;

&lt;p&gt;I’m sharing the architecture now because I’d rather discover its weak points through honest feedback than after building too much around the wrong assumptions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The basic idea
&lt;/h2&gt;

&lt;p&gt;My rule is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Give AI room to do the work, but not permission to redefine the work.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I still decide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What the goal is&lt;/li&gt;
&lt;li&gt;Which repositories the agent can access&lt;/li&gt;
&lt;li&gt;Which changes need approval&lt;/li&gt;
&lt;li&gt;What can reach production&lt;/li&gt;
&lt;li&gt;Which lessons are trustworthy enough to reuse&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent can inspect, plan, write code, run tests, and propose changes. It just has to do that inside a clearly defined boundary.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. A request becomes a Task Contract
&lt;/h2&gt;

&lt;p&gt;Suppose I give the system this instruction:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Improve the authentication system.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is far too vague to trigger an autonomous coding run.&lt;/p&gt;

&lt;p&gt;What does “improve” mean? Which files can change? Can the agent modify the database? What tests must pass? Is it allowed to replace a dependency?&lt;/p&gt;

&lt;p&gt;Before any code is touched, the Agent OS turns the request into a bounded &lt;strong&gt;Task Contract&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The contract can define:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The objective&lt;/li&gt;
&lt;li&gt;Allowed repositories&lt;/li&gt;
&lt;li&gt;Allowed files or directories&lt;/li&gt;
&lt;li&gt;Areas that must not be changed&lt;/li&gt;
&lt;li&gt;Expected outputs&lt;/li&gt;
&lt;li&gt;Required tests&lt;/li&gt;
&lt;li&gt;Risk level&lt;/li&gt;
&lt;li&gt;Time or compute limits&lt;/li&gt;
&lt;li&gt;Approval requirements&lt;/li&gt;
&lt;li&gt;Completion criteria&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This contract becomes the boundary of the run.&lt;/p&gt;

&lt;p&gt;If the coding agent discovers something that requires work outside that boundary, it should stop and ask for a decision. It should not quietly enlarge its own assignment.&lt;/p&gt;

&lt;p&gt;That sounds restrictive, but I see it as the condition that makes useful autonomy possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Execution Governor enforces the boundary
&lt;/h2&gt;

&lt;p&gt;The Agent OS plans and coordinates the work. I don’t want it to hand an AI model unrestricted access to my development environment.&lt;/p&gt;

&lt;p&gt;That is why I’m introducing a separate component: the &lt;strong&gt;Execution Governor&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Its job is to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Validate the Task Contract&lt;/li&gt;
&lt;li&gt;Choose the appropriate coding agent&lt;/li&gt;
&lt;li&gt;Enforce repository and tool permissions&lt;/li&gt;
&lt;li&gt;Apply time and resource limits&lt;/li&gt;
&lt;li&gt;Record what happens during the run&lt;/li&gt;
&lt;li&gt;Stop unsafe or out-of-scope work&lt;/li&gt;
&lt;li&gt;Recover interrupted runs&lt;/li&gt;
&lt;li&gt;Send completed work into verification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’m treating this as a boundary between intent and execution.&lt;/p&gt;

&lt;p&gt;It also prevents the architecture from becoming too dependent on one model. A contract could be routed to Codex today and a different coding agent tomorrow without changing the governance process around it.&lt;/p&gt;

&lt;p&gt;At least, that is the idea. One thing I’m still questioning is whether the Execution Governor is genuinely useful or simply another orchestration layer with a more impressive name.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Coding happens in isolation
&lt;/h2&gt;

&lt;p&gt;The chosen coding agent works inside a temporary, isolated environment.&lt;/p&gt;

&lt;p&gt;It can inspect the permitted code, make changes, run tests, and collect evidence. It cannot directly change production or silently push work into the main branch.&lt;/p&gt;

&lt;p&gt;A run should produce something concrete:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A patch or branch&lt;/li&gt;
&lt;li&gt;Test results&lt;/li&gt;
&lt;li&gt;Static-analysis results&lt;/li&gt;
&lt;li&gt;A list of changed files&lt;/li&gt;
&lt;li&gt;Assumptions made during the task&lt;/li&gt;
&lt;li&gt;Known risks or unresolved questions&lt;/li&gt;
&lt;li&gt;A proposed pull request&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The sandbox can disappear when the run finishes.&lt;/p&gt;

&lt;p&gt;The evidence should remain.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Confidence is not proof
&lt;/h2&gt;

&lt;p&gt;Coding agents are very good at sounding confident—even when the code is wrong.&lt;/p&gt;

&lt;p&gt;Because of that, I don’t want the system to accept an agent’s summary as proof that a task succeeded.&lt;/p&gt;

&lt;p&gt;If the agent says, “All tests pass,” I want evidence that the tests actually ran.&lt;/p&gt;

&lt;p&gt;Depending on the project, verification might include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unit and integration tests&lt;/li&gt;
&lt;li&gt;Type checking&lt;/li&gt;
&lt;li&gt;Linting&lt;/li&gt;
&lt;li&gt;Security checks&lt;/li&gt;
&lt;li&gt;Database migration validation&lt;/li&gt;
&lt;li&gt;Production builds&lt;/li&gt;
&lt;li&gt;Browser or end-to-end tests&lt;/li&gt;
&lt;li&gt;Human review&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The repository and CI pipeline remain the source of truth. A polished explanation is helpful, but it cannot replace a verifiable result.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. More risk means more human control
&lt;/h2&gt;

&lt;p&gt;Not every code change deserves the same level of supervision.&lt;/p&gt;

&lt;p&gt;A documentation correction and an authentication migration should not follow the same approval process. I’m therefore experimenting with three trust tiers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tier 1: Autonomous
&lt;/h3&gt;

&lt;p&gt;This tier is for predictable, low-risk maintenance work, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Small dependency updates&lt;/li&gt;
&lt;li&gt;Formatting fixes&lt;/li&gt;
&lt;li&gt;Documentation corrections&lt;/li&gt;
&lt;li&gt;Clearly bounded mechanical changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tasks could potentially run and merge automatically—but only when every required check passes.&lt;/p&gt;

&lt;p&gt;I’m not yet convinced that automatic merging is worth the risk, even here.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tier 2: Hybrid
&lt;/h3&gt;

&lt;p&gt;This tier covers bounded changes to application logic.&lt;/p&gt;

&lt;p&gt;The system can start the task and prepare the pull request automatically, but a human must review it before anything merges.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tier 3: Strictly governed
&lt;/h3&gt;

&lt;p&gt;This tier is reserved for sensitive work, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Architectural changes&lt;/li&gt;
&lt;li&gt;Authentication or authorization changes&lt;/li&gt;
&lt;li&gt;Sensitive database migrations&lt;/li&gt;
&lt;li&gt;Security-critical code&lt;/li&gt;
&lt;li&gt;Infrastructure or production configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tasks need human approval before work begins and again before the result can merge.&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%2F04cq5vz8s7p2y05isupj.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%2F04cq5vz8s7p2y05isupj.png" alt="Three trust tiers with increasing human control as software-development risk increases" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The difficult part is not defining the tiers. It is classifying tasks reliably enough to trust them.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Memory has to be earned
&lt;/h2&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%2Fuqlpjq36xbr51jjlbm2j.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%2Fuqlpjq36xbr51jjlbm2j.png" alt="Governed memory model that preserves proven, scoped, and relevant lessons" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I want the system to get better over time, especially when the same patterns appear across several projects.&lt;/p&gt;

&lt;p&gt;But I don’t want it to remember everything.&lt;/p&gt;

&lt;p&gt;A failed attempt, a temporary workaround, or an agent’s unverified assumption should not quietly become permanent knowledge.&lt;/p&gt;

&lt;p&gt;My current rule is that a lesson becomes reusable only after:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The implementation passes its required checks.&lt;/li&gt;
&lt;li&gt;The change successfully lands in the repository.&lt;/li&gt;
&lt;li&gt;The outcome is reviewed.&lt;/li&gt;
&lt;li&gt;A human approves the extracted lesson.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Approved lessons are then given a scope:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project-specific&lt;/li&gt;
&lt;li&gt;Stack-specific&lt;/li&gt;
&lt;li&gt;Portfolio-wide&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A lesson from one repository should not automatically affect another repository. Cross-project reuse requires an explicit decision.&lt;/p&gt;

&lt;p&gt;This is meant to stop one incorrect assumption from spreading through every project that happens to use the same technology.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. More context is not always better
&lt;/h2&gt;

&lt;p&gt;It is tempting to give an AI agent everything the system has ever learned.&lt;/p&gt;

&lt;p&gt;In practice, that can create noisy prompts, conflicting instructions, and outdated assumptions.&lt;/p&gt;

&lt;p&gt;Before a task starts, the Agent OS should retrieve only the relevant, verified knowledge needed for that particular task.&lt;/p&gt;

&lt;p&gt;The coding agent gets the context it needs—not the entire history of every previous run.&lt;/p&gt;

&lt;p&gt;I expect this to keep the agent more focused, but context selection creates another problem: how do I know that the system has not excluded one crucial lesson?&lt;/p&gt;

&lt;h2&gt;
  
  
  The complete flow
&lt;/h2&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%2Fbxxbb0voiwjmd54ih12l.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%2Fbxxbb0voiwjmd54ih12l.png" alt="Five-stage workflow covering planning, governance, isolated coding, CI verification, and reusable knowledge" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The workflow currently looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A human defines the goal.&lt;/li&gt;
&lt;li&gt;The Agent OS creates a bounded Task Contract.&lt;/li&gt;
&lt;li&gt;The Execution Governor validates and routes it.&lt;/li&gt;
&lt;li&gt;A coding agent works inside an isolated environment.&lt;/li&gt;
&lt;li&gt;Automated checks and human review verify the result.&lt;/li&gt;
&lt;li&gt;Approved code lands in the project repository.&lt;/li&gt;
&lt;li&gt;The system may extract a lesson from the completed work.&lt;/li&gt;
&lt;li&gt;A human decides whether that lesson becomes reusable knowledge.&lt;/li&gt;
&lt;/ol&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%2Fqo7l39jfxwumz9al2sem.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%2Fqo7l39jfxwumz9al2sem.png" alt="Task lifecycle from a bounded request through isolated execution, verification, merging, and approved reusable memory" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each repository remains independently governed, even if orchestration and reusable capabilities are managed centrally.&lt;/p&gt;

&lt;h2&gt;
  
  
  The parts I’m still unsure about
&lt;/h2&gt;

&lt;p&gt;Some of this architecture is based on problems I have already encountered. Some of it may be unnecessary machinery added to prevent problems that will never become serious.&lt;/p&gt;

&lt;p&gt;These are the questions I’m wrestling with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is the Execution Governor a useful boundary or just another orchestration layer?&lt;/li&gt;
&lt;li&gt;How should a Task Contract handle legitimate discoveries made during execution?&lt;/li&gt;
&lt;li&gt;What evidence is enough before a result can honestly be called “proven”?&lt;/li&gt;
&lt;li&gt;Can low-risk changes ever be classified reliably enough for automatic merging?&lt;/li&gt;
&lt;li&gt;How do I prevent human approvals from becoming meaningless rubber stamps?&lt;/li&gt;
&lt;li&gt;Should the system extract lessons automatically for later approval, or should lessons be written manually?&lt;/li&gt;
&lt;li&gt;How should it resolve conflicting lessons from different projects?&lt;/li&gt;
&lt;li&gt;Could selective context hide something the agent genuinely needs?&lt;/li&gt;
&lt;li&gt;What important failure mode have I missed?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’d especially appreciate feedback from people working with coding agents, CI/CD, developer platforms, sandboxed execution, or multi-agent systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where would this architecture break in real use? What feels over-engineered? What important safeguard is missing?&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: I used AI tools to help edit this article and create its visual presentation. The architecture, implementation experience, and design decisions are my own.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>programming</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
