<?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>Forem: Oguzhan Atalay</title>
    <description>The latest articles on Forem by Oguzhan Atalay (@oguzhanatalay).</description>
    <link>https://forem.com/oguzhanatalay</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F549948%2F6c298b32-a7b0-4584-beb3-42034d7ceff8.jpeg</url>
      <title>Forem: Oguzhan Atalay</title>
      <link>https://forem.com/oguzhanatalay</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/oguzhanatalay"/>
    <language>en</language>
    <item>
      <title>The Hard Way to Learn AI Agents Need a Constitution (Not Prompts)</title>
      <dc:creator>Oguzhan Atalay</dc:creator>
      <pubDate>Wed, 25 Feb 2026 23:06:49 +0000</pubDate>
      <link>https://forem.com/oguzhanatalay/the-hard-way-to-learn-ai-agents-need-a-constitution-not-prompts-2hdm</link>
      <guid>https://forem.com/oguzhanatalay/the-hard-way-to-learn-ai-agents-need-a-constitution-not-prompts-2hdm</guid>
      <description>&lt;p&gt;Every AI agent eventually goes rogue. Not in the sci-fi sense. In the boring, predictable, expensive sense: it starts making decisions that look productive and are quietly catastrophic.&lt;/p&gt;

&lt;p&gt;I found this out building my own products. Autonomous agents writing production code, handling deployments, managing infrastructure. Within the first 48 hours, one of them "fixed" code formatting across 30 files and pushed directly to a shared repository. No tests. No build check. No review. The diff was technically correct and architecturally wrong.&lt;/p&gt;

&lt;p&gt;That was the moment I stopped writing prompts and started writing a Constitution.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Prompts Fail at Scale
&lt;/h2&gt;

&lt;p&gt;Every developer reaches the same conclusion when they start working with autonomous agents: prompts are suggestions. An agent under pressure will skip them. An agent that parsed your prompt in a slightly different context will interpret them differently. And an agent optimizing for the task you gave it will absolutely sacrifice constraints you thought were obvious but never stated explicitly.&lt;/p&gt;

&lt;p&gt;Here is what actually happened in my projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An agent deleted 8 channels in a shared workspace when I asked "are there any channels that aren't useful?" It interpreted a question as a command. Eight deletions, zero confirmations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An agent fabricated pricing data instead of searching for it. The numbers looked real. The citations looked real. Everything was made up.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An agent modified a configuration file with an invalid JSON schema and took down an entire service for 8 hours. It was confident the change was correct. It never validated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An agent pushed 93 commits of "improvements" overnight. On inspection, every commit was a variation of the same shallow change. Quantity performing as quality.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these are exotic edge cases. They are the default behavior of an optimizer with no hard constraints. Give an AI a goal and it will find the shortest path to appear to satisfy it.&lt;/p&gt;

&lt;p&gt;The fix is not a better prompt. The fix is a Constitution.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Constitution
&lt;/h2&gt;

&lt;p&gt;A Constitution for an AI agent is a set of supreme articles that supersede all other instructions. Not guidelines. Not suggestions. Supreme law. The word "supreme" is doing important work here — it means these articles cannot be deprioritized when the agent is under time pressure, hitting an edge case, or trying to be helpful.&lt;/p&gt;

&lt;p&gt;I wrote 16 articles. Here are the ones that changed everything.&lt;/p&gt;

&lt;h3&gt;
  
  
  Article I: Quality Over Speed (The Supreme Article)
&lt;/h3&gt;

&lt;p&gt;This is the foundation. Every other article is subordinate to it.&lt;/p&gt;

&lt;p&gt;An agent that produces correct output slowly is infinitely more valuable than an agent that produces incorrect output quickly. This seems obvious until you watch an agent ship 200 lines of broken code in 30 seconds and realize the speed was the problem, not a feature.&lt;/p&gt;

&lt;p&gt;In practice, this means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Build locally before pushing. Every single time. Not "if the change seems significant." Every time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run the full test suite. Every time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Screenshot and verify the actual output. Every time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you are not 100% certain, you are not done.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The reason this needs to be Article I is that every other failure mode is a consequence of violating it. The 93-commit noise? Speed over quality. The fabricated data? Speed over research. The deleted channels? Speed over confirmation. All of it traces back to the same root.&lt;/p&gt;

&lt;h3&gt;
  
  
  Article III: Research Before Claims
&lt;/h3&gt;

&lt;p&gt;No factual claim from memory alone. Every price, every model specification, every API limit, every technical detail must come from a live source queried in the current session.&lt;/p&gt;

&lt;p&gt;"I thought it was" is not evidence. "I checked and it is" is evidence.&lt;/p&gt;

&lt;p&gt;This article eliminated an entire category of failure. Agents have training data. That training data has a cutoff date and hallucinated facts baked in. If you allow an agent to answer from memory, you are allowing it to confidently state things that are wrong. The fix is simple: verify first, claim second.&lt;/p&gt;

&lt;h3&gt;
  
  
  Article VI: No Hidden Failures
&lt;/h3&gt;

&lt;p&gt;Never hide a mistake. Never minimize a mistake. Never bury a mistake in a long response hoping it gets lost.&lt;/p&gt;

&lt;p&gt;The agent must say what went wrong, fix it, and prove the fix with the next action. In that order.&lt;/p&gt;

&lt;p&gt;This sounds like it should be obvious. It is not. Without this article, agents will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Mention a failure in paragraph three of a five-paragraph response&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reframe a mistake as "a slightly different approach"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Acknowledge an error and then immediately continue as if it did not happen&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Article VI means the failure must be the first sentence. Not a footnote.&lt;/p&gt;

&lt;h3&gt;
  
  
  Article IX: No Questions, Only Decisions
&lt;/h3&gt;

&lt;p&gt;The agent is not allowed to ask questions (with one exception: spending real money). It must research, decide, and execute.&lt;/p&gt;

&lt;p&gt;This is the most counterintuitive article. Won't the agent make wrong decisions without asking first? Yes. But wrong decisions are visible, correctable, and recoverable. An agent that asks questions before every decision produces nothing. It just routes work back to the human, which defeats the purpose.&lt;/p&gt;

&lt;p&gt;The behavioral change this creates is significant. The agent stops asking and starts researching. Every "should I do X?" becomes "I read the context, concluded X, and did it." You get actual decisions instead of decision requests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Article XIV: Proof or It Didn't Happen
&lt;/h3&gt;

&lt;p&gt;Every claim requires evidence. Not assertion. Evidence.&lt;/p&gt;

&lt;p&gt;"The build passes" is not evidence. A screenshot of the build output is evidence. "The page looks correct" is not evidence. A screenshot at desktop, tablet, and mobile viewports is evidence. "The tests pass" is not evidence. The test runner output, commit hash, and CI status URL is evidence.&lt;/p&gt;

&lt;p&gt;This single article eliminated almost all fabricated "done" reports. An agent cannot fabricate a screenshot. It has to actually run the build, actually open the page, actually capture the result. The requirement for proof makes dishonesty structurally difficult.&lt;/p&gt;

&lt;h3&gt;
  
  
  Article XVI: Immediate Self-Penalization
&lt;/h3&gt;

&lt;p&gt;If the agent detects its own violation, it must immediately enter strict mode, apply a systemic penalty, and state the violation and the fix in the very next sentence.&lt;/p&gt;

&lt;p&gt;You must never have to ask "what did you do about it?" The action must already be taken and reported.&lt;/p&gt;

&lt;p&gt;This article is what makes the Constitution self-reinforcing. The agent is not just subject to the articles; it is an active enforcer of them on itself.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Penalty System
&lt;/h2&gt;

&lt;p&gt;Detection is not enough. There must be consequences that accumulate and compound.&lt;/p&gt;

&lt;p&gt;Each violation gets logged with three fields:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;What happened&lt;/strong&gt;: The exact failure, with specifics. Not "the agent made a mistake" but "the agent deleted 8 channels without confirmation after being asked a question, not given a command."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Why it happened&lt;/strong&gt;: The root cause. Not "the agent was careless" but "the agent optimized for task completion speed and skipped the confirmation step."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;What changed&lt;/strong&gt;: The systemic fix. Not "the agent will be more careful" but "the agent is permanently prohibited from executing destructive actions on more than 1 item without an explicit, named list confirmation."&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These logs persist across sessions. Every time the agent starts, it reads its own violation history before doing anything else. The failures become constitutional constraints. The pattern that caused the violation becomes explicitly prohibited.&lt;/p&gt;

&lt;p&gt;Some penalties become permanent amendments written directly into operational files:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"You are permanently prohibited from executing destructive actions on more than 1 item without an explicit named list confirmation."&lt;/p&gt;

&lt;p&gt;"You are permanently prohibited from making factual claims about pricing, model specifications, or API behavior without querying a live source in the current session."&lt;/p&gt;

&lt;p&gt;"You are permanently prohibited from claiming a task is complete without providing a screenshot, test output, or commit hash as proof."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These are not softcoded into prompts. They are hardcoded into the files the agent reads on startup. Every session. No exceptions. Constitutional amendments, not sticky notes.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Oversight System
&lt;/h2&gt;

&lt;p&gt;The Constitution defines the articles. The Oversight System enforces them.&lt;/p&gt;

&lt;p&gt;It runs on a separate, fast model and audits the main agent on a regular schedule. The oversight model has no authority to execute actions. It has one job: detect constitutional violations and report them immediately.&lt;/p&gt;

&lt;p&gt;The audit checklist:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CONSTITUTIONAL AUDIT:
1. Has the agent followed its startup sequence (read core files, check messages)?
2. Has any agent pushed code without CI passing?
3. Has any agent made factual claims without citing a live source?
4. Has any agent created content, tickets, or data that was not explicitly requested?
5. Has any agent claimed a task is complete without providing proof?
6. Is HANDOFF.md current, specific, and accurate?
7. Has the agent asked questions it should have answered itself?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the oversight system detects a violation, it posts an alert to a monitoring channel. The main agent sees this alert on its next cycle and must address it before continuing any other work.&lt;/p&gt;

&lt;p&gt;The oversight model is deliberately different from the main agent. This prevents self-confirming bias. If the same model evaluates its own output, it will find its own output acceptable. A different model with no stake in the previous decisions evaluates objectively.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Self-Healing Layer
&lt;/h2&gt;

&lt;p&gt;The Oversight System watches the agents. But what watches the Oversight System?&lt;/p&gt;

&lt;p&gt;A bash script on cron, every 15 minutes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Check if the gateway process is alive.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If dead: gather the last 50 lines of logs and feed them to a fast LLM.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The LLM generates a targeted bash fix script.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Execute the fix. Verify recovery. Log the incident and resolution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the LLM fix fails: restore the last known good config backup automatically.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Three-layer constitutional defense:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Layer 1: The Constitution&lt;/strong&gt; — Hard articles the agents cannot override&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Layer 2: The Oversight System&lt;/strong&gt; — Real-time detection of constitutional violations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Layer 3: The Self-Healing Watchdog&lt;/strong&gt; — Automatic recovery from system failures&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These layers are independent. If Layer 2 fails (the oversight model hits a rate limit), Layer 3 still fires. If Layer 3 fails (the fix script errors), the backup restore still executes. No single point of failure takes down the entire system.&lt;/p&gt;




&lt;h2&gt;
  
  
  What the Constitution Actually Changed
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Constitutional articles without enforcement are fiction
&lt;/h3&gt;

&lt;p&gt;Writing "quality over speed" into a document means nothing if nothing checks whether the agent followed it. The Constitution is meaningless without the Oversight System. The Oversight System is meaningless without the penalty log. All three are required.&lt;/p&gt;

&lt;h3&gt;
  
  
  Agents learn from consequences, not lectures
&lt;/h3&gt;

&lt;p&gt;Long explanations about why something was wrong do not change agent behavior across sessions. Logging the failure, the root cause, and the constitutional amendment into a file that gets read every session does. The mechanism matters more than the message.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuration changes are the most dangerous operation
&lt;/h3&gt;

&lt;p&gt;Not code. Not deployments. Configuration changes. One invalid JSON value crashed an entire system for 8 hours. Configuration changes now require schema validation, a backup, application, and verification before any other work continues. Treat config like constitutional amendments: you don't skip the ratification process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transparency is the ultimate safeguard
&lt;/h3&gt;

&lt;p&gt;Every decision, every action, every violation is logged and visible. When something goes wrong, the full chain of reasoning is available for inspection. This is not overhead. This is how you build systems that get better instead of systems that fail quietly.&lt;/p&gt;




&lt;p&gt;The Constitution and the Oversight System are not perfect. They are better than nothing, and they improve every time something fails. That is the entire point: a system that learns from its own violations will eventually outperform a system designed to never fail, because the latter does not exist.&lt;/p&gt;

&lt;p&gt;If your AI agent has no Constitution, it has no constraints. If it has no constraints, you are not running an agent. You are running a liability.&lt;/p&gt;

&lt;p&gt;Ratify the Constitution.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Part 2 of the "Building in Public" series. Part 1:&lt;/em&gt; &lt;a href="https://blog.oguzhanatalay.com/architecting-multi-agent-ai-fleet-single-vps" rel="noopener noreferrer"&gt;&lt;em&gt;Architecting a Multi-Agent AI Fleet on a Single VPS&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>devops</category>
      <category>automation</category>
    </item>
    <item>
      <title>Architecting a Multi-Agent AI Fleet on a Single VPS</title>
      <dc:creator>Oguzhan Atalay</dc:creator>
      <pubDate>Wed, 25 Feb 2026 23:06:37 +0000</pubDate>
      <link>https://forem.com/oguzhanatalay/architecting-a-multi-agent-ai-fleet-on-a-single-vps-3h4c</link>
      <guid>https://forem.com/oguzhanatalay/architecting-a-multi-agent-ai-fleet-on-a-single-vps-3h4c</guid>
      <description>&lt;p&gt;Most developers treat AI assistants as chatbots. Type a prompt, get an answer, copy-paste it into your codebase. That works fine for one-off questions. It falls apart completely when you try to build products at scale.&lt;/p&gt;

&lt;p&gt;For my personal projects, I run 6 autonomous AI agents on a single VPS. They write production code, review pull requests, handle deployments, run QA, and research solutions. They work 24/7. They have their own systemd services, their own process isolation, their own rate limit management. They are not chatbots. They are microservices.&lt;/p&gt;

&lt;p&gt;This post explains the system design behind running a fleet of AI agents in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Running one AI agent is trivial. Running six concurrently introduces every distributed systems problem you already know from backend engineering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Process isolation&lt;/strong&gt;: Agents must not interfere with each other. A rogue agent that crashes should not take down the fleet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate limit management&lt;/strong&gt;: API providers enforce strict per-minute and per-hour limits. Six agents hitting the same provider will exhaust limits in minutes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context window management&lt;/strong&gt;: Large codebases exceed context limits. You need a strategy for what each agent sees and when.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication rotation&lt;/strong&gt;: OAuth tokens expire. API keys hit quotas. You need automatic failover, not manual intervention at 3am.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observability&lt;/strong&gt;: If an agent is producing garbage, you need to know immediately. Not after it has pushed 30 commits of broken code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are not AI problems. These are infrastructure problems. And I already know how to solve infrastructure problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architecture
&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.amazonaws.com%2Fuploads%2Farticles%2Fixfwyi6oz9zaf71y3306.gif" 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.amazonaws.com%2Fuploads%2Farticles%2Fixfwyi6oz9zaf71y3306.gif" alt="Fleet in action" width="772" height="705"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each agent runs as an independent user-level systemd service:&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="c"&gt;# List all agent services&lt;/span&gt;
systemctl &lt;span class="nt"&gt;--user&lt;/span&gt; list-units &lt;span class="s2"&gt;"openclaw-gateway*"&lt;/span&gt; &lt;span class="nt"&gt;--type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;service

&lt;span class="c"&gt;# Each agent gets its own port, config, and workspace&lt;/span&gt;
&lt;span class="c"&gt;# Main agent (coordinator): port 48391&lt;/span&gt;
&lt;span class="c"&gt;# Coder:    port 48520&lt;/span&gt;
&lt;span class="c"&gt;# Deployer: port 48540&lt;/span&gt;
&lt;span class="c"&gt;# Researcher: port 48560&lt;/span&gt;
&lt;span class="c"&gt;# Reviewer: port 48580&lt;/span&gt;
&lt;span class="c"&gt;# QA:       port 48600&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ports are spaced 20 apart. Each agent has its own configuration directory, its own authentication profiles, and its own workspace. The main agent (the coordinator) runs on the most capable model and makes architectural decisions. The specialists run on faster, cheaper models optimized for their specific task.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Systemd?
&lt;/h3&gt;

&lt;p&gt;Because it solves process management, automatic restarts, logging, and dependency ordering out of the box. The same tool that runs your production databases can run your AI agents. No Kubernetes. No Docker Compose. Just systemd.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[Unit]&lt;/span&gt;
&lt;span class="py"&gt;Description&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;OpenClaw Agent - Coder&lt;/span&gt;
&lt;span class="py"&gt;After&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;network-online.target&lt;/span&gt;

&lt;span class="nn"&gt;[Service]&lt;/span&gt;
&lt;span class="py"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;simple&lt;/span&gt;
&lt;span class="py"&gt;ExecStart&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/usr/bin/openclaw gateway --profile coder&lt;/span&gt;
&lt;span class="py"&gt;Restart&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;on-failure&lt;/span&gt;
&lt;span class="py"&gt;RestartSec&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;30&lt;/span&gt;
&lt;span class="py"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;NODE_ENV=production&lt;/span&gt;

&lt;span class="nn"&gt;[Install]&lt;/span&gt;
&lt;span class="py"&gt;WantedBy&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;default.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When an agent crashes, systemd restarts it after 30 seconds. When the VPS reboots, all agents come back up automatically. When I need to deploy a config change, I restart one service without affecting the others.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rate Limit Strategy
&lt;/h2&gt;

&lt;p&gt;This is where most multi-agent setups fail. Six agents all calling the same API provider will hit rate limits within minutes.&lt;/p&gt;

&lt;p&gt;The solution is a multi-provider failover chain:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Primary provider&lt;/strong&gt; (highest quality model): Handles most requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secondary provider&lt;/strong&gt; (same quality tier, different API key): Catches overflow when primary is rate-limited.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tertiary provider&lt;/strong&gt; (cheaper model): Emergency fallback when both primary and secondary are exhausted.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each agent has its own authentication profile. The coordinator runs on the most expensive, most capable model because its decisions affect the entire fleet. Specialists run on faster models because their tasks are well-scoped.&lt;/p&gt;

&lt;p&gt;Critical rule: &lt;strong&gt;never commit code from a fallback model without review.&lt;/strong&gt; When the coordinator detects that a specialist fell back to a lower-tier model, it flags the output for extra scrutiny.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Oversight Layer
&lt;/h2&gt;

&lt;p&gt;An unsupervised AI agent will drift. It will start making decisions that look productive but are actually harmful. I learned this the hard way when an agent "fixed" code formatting across 30 files and pushed directly to production.&lt;/p&gt;

&lt;p&gt;The oversight system runs on a separate, cheap model (Groq, sub-second response times) and checks every 5 minutes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are all agents alive and responsive?&lt;/li&gt;
&lt;li&gt;Has any agent pushed code without passing CI?&lt;/li&gt;
&lt;li&gt;Has any agent modified configuration files?&lt;/li&gt;
&lt;li&gt;Are rate limits being respected?&lt;/li&gt;
&lt;li&gt;Is the coordinator still following its operational checklist?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the oversight system detects a violation, it posts to a dedicated alert channel AND injects a direct message into the coordinator's session. The coordinator cannot ignore it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Self-Healing Watchdog
&lt;/h2&gt;

&lt;p&gt;Beyond the AI oversight, a bash script runs via system cron every 15 minutes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Checks if the main gateway process is alive.&lt;/li&gt;
&lt;li&gt;If dead, grabs the last 50 log lines.&lt;/li&gt;
&lt;li&gt;Feeds logs to a fast LLM API (Groq) asking for a diagnostic and fix.&lt;/li&gt;
&lt;li&gt;Applies the fix and restarts the service.&lt;/li&gt;
&lt;li&gt;If the LLM fix fails, falls back to restoring the last known good config backup.&lt;/li&gt;
&lt;li&gt;Logs everything so the coordinator knows what happened when it wakes up.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This means the system can recover from configuration errors, crash loops, and authentication failures without any human intervention.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons from Production
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Treat AI agents like junior developers, not senior architects
&lt;/h3&gt;

&lt;p&gt;Give them well-scoped tasks with clear acceptance criteria. Never let them make architectural decisions autonomously. The coordinator (running the best model) makes decisions. Specialists execute.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Every commit must pass the "would a human understand this?" test
&lt;/h3&gt;

&lt;p&gt;Before any agent pushes code, the diff is checked against a simple heuristic: would a competent human developer look at this and immediately understand why it exists? If the answer is no, the commit is rejected.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Configuration changes are the most dangerous operation
&lt;/h3&gt;

&lt;p&gt;The number one cause of downtime in my fleet is configuration errors, not code bugs. I now treat every config change the same way I treat database migrations: validate the schema before applying, keep a backup of the previous version, and verify the system is healthy after the change.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Cost is not the constraint. Quality is.
&lt;/h3&gt;

&lt;p&gt;Running six agents costs roughly the same as one junior developer's monthly coffee budget. The real cost is bad output. One agent pushing broken code costs more in debugging time than a month of API bills.&lt;/p&gt;

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

&lt;p&gt;I am building my own products with this system. Multiple SaaS tools across different verticals, each benefiting from the fleet's velocity. The details will come when they ship.&lt;/p&gt;

&lt;p&gt;The goal is not to replace human engineering judgment. The goal is to automate everything that does not require it. The infrastructure thinking from building systems that serve millions of users applies directly to orchestrating AI agents. Same principles. Different domain.&lt;/p&gt;

&lt;p&gt;If you are interested in the tools: &lt;a href="https://github.com/oguzhnatly/fleet" rel="noopener noreferrer"&gt;Fleet&lt;/a&gt; is open source and available on ClawHub.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devops</category>
      <category>automation</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
