Dark Factory Patterns
A practitioner's account of running agents without step-by-step approval: the anti-patterns, the patterns that work, its tools and how far to trust the claims.
Written by
-
Benedikt Stemmildt Founder & Co-CEO
Updated:
Software Factories 5
No factory ever ran on day one, and every failure improves the machine. A practitioner account from the consultancy Mayflower describes that mechanism in four anti-patterns and nine patterns from building such a software factory (Mayflower - AI Dark Factory Patterns (opens in a new tab)). Most of them work on verification: gates, fitness functions and the codification of every human fix. The author reports more than one million lines of code across several solutions, a triple-A SonarQube rating and 80 percent test coverage, and reports being about 100 times as productive as usual. Read the multiplier as a self-report and the patterns as the substance: each one can be tested on its own.
What is a dark factory?
A dark factory moves the human from operating the system to designing it. In manufacturing, a dark factory runs with the lights off because no one works on the floor. In software, agents write code, run tests, check quality, deploy and maintain the result without a human approving individual steps.
The human built the factory beforehand: the production rules, the quality boundaries the output must not cross, and the mechanisms that keep the system healthy. The source describes the whole as an operating system for an organization’s software, from requirements through implementation, deployment and operations to the maintenance of a growing portfolio.
Which anti-patterns keep a team from a dark factory?
Circus Ringmaster
Anti-pattern.
Context. A team runs several agents and one person stands at the center, directing each of them by hand.
Problem. Without that person the agents spin in circles: they have no goal logic of their own, no fitness functions and no self-steering. The human is the engine, not the supervisor, so the setup is a manual process with an agentic facade.
Way out. Design the system, rather than delegating harder. Give the agents a goal structure that works without a human in the loop.
Watch for. The ringmaster sits one level below the Mechanic: the Mechanic at least intervenes in a system that runs, while here nothing runs at all without the human.
Related. Mechanic, Codification Imperative.
Mechanic
Anti-pattern.
Context. A factory runs, and an operator keeps it running by fixing errors through direct intervention.
Problem. The same class of problem returns, gets fixed by hand again, and the system never learns. As complexity grows, the Mechanic becomes overloaded and irreplaceable, and both are warning signs.
Way out. Abolish the role through consistent codification: every fix becomes a rule, test or fitness function the factory runs from then on.
Watch for. Recurrence is the symptom to watch. A better Mechanic does not solve it.
Related. Codification Imperative, Circus Ringmaster.
Bullshit Factory
Anti-pattern.
Context. A team builds production infrastructure for agents before its validation infrastructure has matured.
Problem. The factory produces volume, and most of it is unusable. The agents are not the cause: they optimize to pass the gates, and weak gates are easy to pass.
Way out. Build validation and observability first and production volume second. A factory that cannot tell good output from bad should not run at production scale.
Watch for. Output full of contradictions and false assumptions. Human developers catch those while they work; coding agents do not, so the factory has to catch them itself.
Related. Quality Inversion, Narrator, Quality & Verification.
Specification as Source of Truth
Anti-pattern. The source calls it “Big Design Upfront als Source of Truth”.
Context. A dark factory needs specifications to run at all.
Problem. Specifications are a starting point, not proof of correctness. In practice they are incomplete, rest on hypotheses, contain errors or miss things. The more detailed and confident a specification reads, the more damage it does when the system implements it unquestioned.
Way out. Make programmatic tests and fitness functions the source of truth. They prove that the functional and non-functional requirements are met. The specification describes intent, the tests check reality, and where the two diverge, reality wins.
Watch for. Dropping the specification altogether. The factory does not start without one: keep it as the statement of intent, and let the tests decide.
Related. Synthetic First, Back-Testing Later, Specifications and context.
Which patterns make a dark factory work?
Synthetic First, Back-Testing Later
Pattern.
Context. A new solution has no real users before launch.
Problem. The factory still needs requirements and scenarios to validate against.
Therefore. Use synthetic users, behavioral models of the expected target group, to generate requirements and validate the first scenarios. Once the solution is in production, feed real user behavior into the requirements pipeline.
Watch for. Synthetic models remain for edge cases and new scenarios, but they stop being the primary validation anchor. From launch on, the factory works from observed reality rather than modeled reality.
Related. Specification as Source of Truth.
Quality Inversion
Pattern.
Context. A system has grown past a threshold of complexity and production speed.
Problem. Mandatory human approval gates now lower output quality. The system has more codified knowledge at those points than a reviewer can bring to bear in the review time available, so approval turns into rubber-stamping or into heuristics less reliable than automated gates.
Therefore. Check whether human objections during approval improve downstream results. Where they do not, replace the approval gate with fitness functions.
Watch for. Quality inversion is a threshold effect. Below the threshold, human approval still adds quality.
Related. Bullshit Factory, Self-Healing Production Line.
Narrator
Pattern.
Context. A multi-agent system grows more complex than a human can follow by reading its logs.
Problem. Without an explanation of what the system did, the human cannot form an error judgment they can act on.
Therefore. Run an agent that translates the system’s activity into explanations a human can read. The Narrator interprets rather than reports: it chooses what to highlight, what to leave out and which causal links to make explicit.
Watch for. The Narrator is the precondition for the Codification Imperative. Its quality has to grow with the system’s complexity.
Related. Agent observability.
Codification Imperative
Pattern. The source also calls its effect the automation ratchet.
Context. A human finds an error case, usually through the Narrator, that the factory does not cover.
Problem. A fix to the code alone repairs one output and leaves the factory as blind as before.
Therefore. Apply the rule: no manual fix without a lasting correction. Codify every human correction at once, as a fitness function, a test scenario or an agent rule, so the fix extends the factory logic as well as the product.
Watch for. Each cycle raises system complexity, which needs better observability, which finds finer errors and starts the next cycle. The ratchet only turns one way, and the source names no upper limit.
Related. Mechanic, Narrator, Self-Healing Production Line.
Self-Healing Production Line
Pattern.
Context. A factory has run through several cycles of the Codification Imperative.
Problem. Fitness functions that run only as final gates catch violations late and wait for a human to notice.
Therefore. Run fitness functions as continuous monitors. A detected violation triggers a correction agent without waiting for a human. Treat compute capacity, agent parallelism and infrastructure cost as managed parameters.
Watch for. The remaining humans stop writing reviews and write the rules by which the system evaluates and corrects itself.
Related. Quality Inversion, Living Portfolio.
Full-Cycle Deployment
Pattern.
Context. Code leaves the factory and still has to reach production.
Problem. When deployment is a separate step after the factory, security, runtime configuration and permissions fall back to manual work.
Therefore. Make deployment the factory’s last step. Quality checks, security analysis and runtime configuration run inside the factory run, and runtime permissions are derived from the code. The runtime scales with load and costs nothing while idle. Runtime errors the system cannot resolve escalate to maintenance agents.
Watch for. What leaves the factory is production-ready, secured and maintainable, not only correct.
Related. Ambient Identity, Security & Runtime Isolation.
Ambient Identity
Pattern.
Context. The factory produces many applications for one organization.
Problem. Solving identity per application repeats the same work and leaves gaps.
Therefore. Make identity an infrastructure layer the platform requires. Every application the factory produces joins the organization’s identity management automatically. At runtime it acts on behalf of the signed-in user, with that user’s permissions.
Watch for. A new solution can reach every service and every data set its user is authorized for from its first day.
Related. Full-Cycle Deployment, Citizen Development as a Platform.
Living Portfolio
Pattern.
Context. The number of solutions the factory has produced keeps growing.
Problem. A portfolio that needs human maintenance per entry grows its maintenance cost with every solution.
Therefore. Catalog and document every new solution as it is created. Run maintenance agents permanently against every entry: they fix security gaps and generate documentation and changelogs from the code and its change history.
Watch for. The portfolio keeps itself healthy, including solutions that have run on their own for months.
Related. Self-Healing Production Line.
Citizen Development as a Platform
Pattern.
Context. An organization operates a dark factory.
Problem. Domain experts who need custom software either wait for an engineering team or settle for generic tools.
Therefore. Let any domain expert commission a solution directly, by describing in a chat what they need. The factory handles requirements, implementation, deployment, identity integration and intake into the portfolio.
Watch for. For a whole class of solutions, the line between “feasible” and “too expensive” disappears. The source reports departments receiving custom solutions within days.
Related. Ambient Identity, Living Portfolio.
Which tools does the account name?
- Obot, an MCP management platform: servers, registries, audit logs, usage, filters, scheduling, agent management, token usage, model providers and model access policies.
- Backstage, the developer portal, running background agents: changelog generator, code simplifier, dependency upgrader, documentation, security review and SonarQube issue fixer.
- Amicable, Mayflower’s own product, which lets non-engineers build apps on sanctioned stacks with the organization’s QA, security and observability. It ships templates for SPA, full-stack, API, mobile and desktop across React, Vue, Svelte, Laravel, Phoenix, .NET and Quarkus.
How should you read the claims?
Treat the multiplier as rhetoric and test the patterns one at a time. The anti-patterns, the codification imperative, quality inversion, tests and fitness functions over specifications, and the narrator are each testable without the others. Measure any adoption through throughput, quality and change-failure metrics rather than a headline multiple.
Related
- Software Factories and Harness Engineering: the harness of gates and rules a dark factory runs inside.
- Creator and verifier roles: how to build verification with a verifier independent of the agent that wrote the code.
- Production evidence: what running factories report, and where lights-off autonomy broke down.
- Agent observability: the record the Narrator and the codification cycle depend on.
- Security and Runtime Isolation: the runtime boundaries a factory that deploys its own code needs.
- The Federated Factory at Enterprise Scale: how dark-factory and interactive blueprints share one platform.
Resources
Articles
- AI Dark Factory Patterns (opens in a new tab) - Mayflower’s German-language blog post describing four anti-patterns and nine patterns from building a software factory that runs without per-step approval.