---
type: "Blog Post"
title: "The Dark Factory Needs an Operating System"
description: "An agent touches four things: a model, a prompt, context, and tools. The Agentic OS that RSTS AI built for small businesses governs each one as its own plane, under one doctrine: deterministic first, the cheapest model that fits second, a small prompt third. Here is that architecture taken pillar by pillar, and what each pillar becomes inside an enterprise AI-assisted SDLC."
resource: "https://og.rsts.dev/blog/dark-factory-needs-an-os/"
status: "stable"
generated:
  by: "human:orestes-garcia"
  at: "2026-11-30"
verified:
  - by: "human:orestes-garcia"
    at: "2026-11-30"
sources:
  - id: "canonical"
    resource: "https://og.rsts.dev/blog/dark-factory-needs-an-os/"
    title: "The Dark Factory Needs an Operating System"
    author: "human:orestes-garcia"
    last_modified: "2026-11-30"
x-ogrsts-published: "2026-11-30"
x-ogrsts-read-time: "11 min read"
x-ogrsts-youtube: "https://www.youtube.com/watch?v=7IbBji3mDDo"
---

One scheduled job cost about $1,830 in thirty days.

It was a poller. Every five minutes it woke up, asked the most capable model available whether anything had changed, and almost every time the answer was no. That single job was 99% of its installation's spend. The fix was a few lines of deterministic code that checked first and called a small model only when something had actually moved. It now costs less than a dollar a month.

Nothing about the model was wrong. It answered correctly every time. What was missing was anything that governed which model ran that job, and why. And the model is only one of four things an agent touches.

## Where the Last Post Stopped

In [The Model Is Not the Employee](../posts/the-model-is-not-the-employee.md) I described the Agentic OS as a supervision layer: agents draft, people approve, every step lands in a record nobody can quietly edit. That post was about who decides. This one is about what the layer governs underneath the decision.

The credit stays where it belongs. The team at [RSTS AI](https://rsts.ai) built the Agentic OS to run managed AI employees for small service businesses, and they are the ones living with it every day. Annette Garcia introduced it on their blog in [An AI Team You Can Supervise](https://rsts.ai/blog/an-ai-team-you-can-supervise/), the one-page view of the architecture and the start of a nine-part series that walks through it. Start there for the business owner's version. I am interested in it for a different reason. Strip away the small-business specifics and what is left is a clean answer to a question every enterprise building a dark factory, an AI-assisted software delivery pipeline that runs mostly without people in the loop, has to answer: what exactly is being governed?

The answer the architecture gives is four pillars. **Model**, **prompt**, **context** and **tools**. Each one gets its own controls, its own owner and its own change process. And all four sit under one doctrine that the platform's guidelines put in a single line: *deterministic first, the cheapest model that fits the thinking second, a small prompt third.*

That ordering matters. It says the model is the last resort, not the first. Anthropic's own guidance on [building effective agents](https://www.anthropic.com/engineering/building-effective-agents) makes the same argument from the other side: find the simplest thing that works and add agentic complexity only when it earns its place.

*(Figure: One OS, four governed pillars: installations pin a shared platform core; model, prompt, context and tools are each governed as their own plane, above a common spine of approvals, hash-chained audit and an off switch. See the original post for the image.)*

## The Shape: A Core, Installations, One Door

Before the pillars, the shape that holds them.

There is one shared platform, and every business that runs it gets its own installation. The installation pins a specific version of the platform and describes itself in a single manifest: which agents exist, which channels they use, which models they may call, who can approve what. A platform change reaches an installation only when that installation moves its pin. Nothing upgrades itself.

The core also never imports a domain pack. Billing, commerce, content and the rest plug in through registries, so the governance code never learns what business it is governing. That is what lets the same core supervise very different businesses without forking.

The direction the design is moving makes the separation sharper. Every read and every write becomes an operation in one registry, a single door no client can route around. The agent becomes a platform concept, while the runtime that executes it becomes replaceable. The rules that gate an agent move behind a governance interface the runtime must call, and every gate fails closed if the platform cannot be reached.

Now read that as an enterprise architect. Your platform team owns the core. Each product line's factory is an installation that pins a version and declares itself in a manifest that lives in version control. Swapping the agent runtime next year, which you will do, does not mean re-deriving every control, because the controls never lived in the runtime. That is the exit clause you wanted from the agent vendor, built into the shape.

## Model: A Routing Decision, Not a Default

The poller story is a model-governance failure, so start here.

The platform treats model choice as a decision with a record. There are tiers: a fast cheap model for classification and routine checks, a balanced default for most work, the top model for the reasoning that justifies it. Every scheduled job is pinned to a tier. An unpinned job, or a routine job on the top tier, shows up as a finding.

Fallback is the subtle part. When the primary provider hits a limit, most runtimes quietly fail over to the next one. Here a limit error is reclassified so the runtime cannot fall back on its own, and an approval is filed instead: switch to the second provider? A person says yes, and the switch lasts until the limit resets, capped at a day. A different provider means a different contract, a different data path and often different behavior. That is a change, so it is treated as one. Only the live voice channel falls back automatically, because a dropped phone call is worse than a provider switch, and every automatic switch is still reported.

Budgets close the loop. Alerts at half, most and all of the monthly amount, and an optional hard stop that pauses every agent through the same off switch an operator would use. A cost reviewer reads spend by job, agent and model, and files fixes as approvals, never edits.

**In the factory**, this becomes routing by stage. Spec refinement, code generation, review, test generation and documentation do not need the same model, and pinning each stage is how you keep the bill explainable. Make the reviewer a different model from the author, so they do not share blind spots. Log provider failover as a change event, because the auditor will ask which model wrote a given commit and through which provider. And keep a live inventory of every model in the pipeline, which is the first thing anyone accountable for model risk will request.

## Prompt: A Build Artifact

Most agent deployments treat the system prompt as a text box someone edits in production. The Agentic OS treats it as compiled output.

Each agent's system prompt is generated from three inputs: shared rule files that every agent inherits, a per-role persona and a facts file. Nobody hand-edits the result. Persona templates carry a version marker. A check compares the generated prompt to the one actually running and refuses to ship if they differ, so the live prompt can never drift from source. Changes to a persona go through a staging evaluation before they reach a live channel.

Token hygiene is part of the same discipline. Every tool schema and every skill loaded into the system prompt costs tokens on every call, so skills are attached per job, only when that job needs them. A small prompt is a governance property, not just a cost one: the less the agent is told, the less there is to audit.

**In the factory**, your engineering standards, secure-coding rules and architecture principles become the shared rule files. Team-specific conventions become personas. A prompt change is a pull request, it runs against an evaluation suite, and it is promoted like any other artifact. The rule is simple and almost nobody follows it: no hand-tuned prompt in production. If you cannot diff it, you cannot review it, and if you cannot review it, it is not under change control.

## Context: Knowledge That Changes Through Review

This is the pillar where most enterprise agent programs quietly fail, because context feels like data and data feels like someone else's problem.

In the Agentic OS, an installation's knowledge lives in what it calls the Brain: a git repository of markdown pages that agents read and cite, and that changes only through reviewed proposals. Pages follow an open format, the [Open Knowledge Format](https://github.com/open-knowledge-format/open-knowledge-format), with provenance on every page: where it came from, what generated it, when it was last verified. Captured raw sources are kept and never edited.

Knowledge is split into bundles, and each bundle has one steward, the single agent profile allowed to propose changes to it. Two bundles never own the same fact. They link to each other instead.

Two design choices are worth stealing outright. First, agents reach the Brain through tools, never the filesystem. That sounds like plumbing, but it means retrieval is an interface that can be logged, scoped and later turned into a shared service without touching a single agent. Second, the periodic compile pass the platform calls dreaming, which gathers decisions, conversations and lint findings into proposed updates, never writes to the Brain. It runs on a capped budget with a locked toolset, masks personal data before the model sees anything, wraps every collected snippet in a fence that marks it as data rather than instruction, and its only output is edit proposals for a person to approve.

That fence is the quiet hero. [OWASP's Top 10 for Agentic Applications](https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/) puts goal hijacking through untrusted content near the top of the list, and context is exactly where untrusted content enters.

**In the factory**, the bundles are your architecture decision records, API contracts, domain models, coding standards and runbooks, each with a named owner. The agent reads them at a governed version, so the code it writes can be traced to the architecture it was told about. I argued in [Grounding Is a Memory Problem](../posts/grounding-is-a-memory-problem.md) that most hallucination in enterprise agents is really a stale-memory problem. Reviewed bundles with provenance are the fix, and a pipeline that summarizes incidents into proposed runbook changes, never direct edits, is the dreaming pattern applied to operations.

## Tools: Every Call Has a Person Behind It

Tools are where an agent stops talking and starts acting, so this pillar carries the hardest rules.

Every tool call resolves to a person. A key belongs to the user who created it, and its effective rights are the intersection of that user's role and the key's own scopes, never more. When an agent acts on someone's behalf, that person's policy can narrow what the agent's profile allows but can never widen it. If the platform cannot tell who is behind a session, the agent drops to read-only tools.

The gate itself fails closed. If the policy cannot be evaluated, a worker agent gets only its own tools. Some live channels are marked observe-only: the agent can watch them and never touch them. Secret values are redacted from tool results, audit rows and the live stream, so a leaked transcript does not leak credentials. Every call, allowed or denied, lands in the hash-chained audit with the person as actor. And the direction of travel is one operating-system identity per agent, because whatever a model types becomes part of that agent's process.

External access follows the same rule. The platform exposes itself to other assistants over the [Model Context Protocol](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization) with proper sign-in, and the same "a key is a person" rule applies, read access first.

**In the factory**, each pipeline stage gets its own non-human identity, never a shared service account and never a developer's personal token. Agents write to branches, never to main. Deploy, data and production-access tools sit behind approvals, and the CI runner is the sandbox. In [Certify the Pipeline, Not the Change](../posts/certify-the-pipeline.md) I argued that the pipeline itself is the control. Tool governance is how an agent-driven pipeline stays certifiable: every action attributable, every denial recorded, every privilege the minimum the stage needs.

## The Reader That Never Writes

One more pattern cuts across all four pillars. Every installation runs a systems-engineer agent that reads health, cost and configuration, diagnoses what it finds and proposes fixes from a known catalog as approvals. It never changes anything itself. Platform updates are checked and reported, never applied on their own beyond approved security fixes. A deploy never restarts a running agent; a person does that in a quiet window.

Point the same posture at the factory itself. An AI SRE that watches your pipeline, reads every log and files a proposed fix is enormously useful. One that patches the pipeline on its own is a change nobody approved to the system that approves changes.

## Two Goods, One Plane

The engineer's side of this deserves its full weight. A developer wants one front door, the right model picked without thinking about it, the architecture already in context and tools that work without a ticket for each one. Friction is not neutral. Every extra step pushes people toward the unsanctioned tool that has none, and the agents that help most are the ones that sit where people already work.

The institution's side is equally real. It has to know which model wrote a change, through which provider, under which prompt version, grounded in which documents, using which tools, on whose authority, at what cost. It has to be able to prove all of that later, and to stop the whole thing with one action. A factory that cannot answer those questions should not ship to production, however good its output looks.

These do not have to be traded against each other. Governing each pillar as its own plane is what lets you give the developer the experience. Model routing is why the right model gets picked automatically. Prompt compilation is why the standards are already loaded. Reviewed context is why the agent knows the architecture. Person-bound tools are why the agent can be trusted with real ones. The controls are the reason you can say yes.

## What I Have Not Solved

This architecture is proven at small-installation scale: a handful of businesses, a few agents each, a few approvers. An enterprise factory is a different animal, and I want to be honest about the gaps.

The fleet control plane, the layer that would manage many installations as one, is designed but not built. Enterprise identity federation is not there yet, and "a key is a person" means much more when the person comes from a corporate directory with joiners, movers and leavers. Review volume is the open question I worry about most: a factory produces proposals faster than people read them, and approval fatigue does not care how good your audit chain is. The runtime-neutral governance interface is still a design document. And prompt evaluation is thin everywhere, including here; a staging eval catches regressions you thought to test for and nothing else.

None of that weakens the concepts. It just means the concepts transfer before the code does.

## Where This Lands

Dan Shapiro's [five levels](https://www.danshapiro.com/blog/2026/01/the-five-levels-from-spicy-autocomplete-to-the-software-factory/) end in a software factory where specs go in and software comes out. Most of the conversation about getting there is about the model. The model is one pillar of four, and in my experience it is the one that needs the least help.

If you are building a dark factory, audit it one pillar at a time. Who chose the model for each stage, and where is that written down? Where does the prompt live, and can you diff it? Who owns each piece of context, and when was it last verified? What does a tool call prove about who authorized it? If any answer is "it depends on the runtime", you have found where your operating system should be.

*Prefer to watch? The [video version is on YouTube](https://youtu.be/7IbBji3mDDo).*

*If you want the builder's side of this, read [I'm Building the Dark Factory, and I Love It](../posts/building-the-dark-factory.md). For how the same four pillars scale from one person to a whole enterprise, read [IT Is the Blueprint](../posts/it-is-the-blueprint.md).*

*Find me on [X @orestesgarcia](https://x.com/orestesgarcia) or [LinkedIn](https://linkedin.com/in/setsero).*
