There is a temptation many teams give in to as soon as an AI agent works well: they let it touch production too. “The agent found the bug, let it fix it right on the server.” That sounds efficient. It is the beginning of the end of all traceability.
That is why at ANYMATTER we have a rule that cannot be switched off: no AI agent runs in the production environment. Not with approval, not in an emergency, not for owners. What runs there are approved, immutable images – and nothing else.
Two environments, one direction
Every organization has exactly two environments: a development environment (DEV) and a production environment (PROD). Both are dedicated servers, not shared containers. Between them there is exactly one path, and it leads in one direction only.
In the development environment everything creative and risky happens: writing code, running tests, arguing with the agent, breaking things and fixing them. This is where the agent runs with secrets leased to it – development secrets only. This is also where the build happens: the image is built, tested and scanned on the development environment.
The production environment does not know the development environment. A firewall prevents access from DEV to PROD. Production secrets sit in a vault whose key is never issued to the development environment. Even a developer with full access to DEV cannot read production credentials.
How code reaches production
The path is deliberately multi-staged, and every stage has a purpose:
- Build on DEV. The platform builds the image, runs the tests in a container without network and scans it for known vulnerabilities. A build with critical findings does not become a candidate.
- Candidate. The result is a deployment candidate with image digest, commit, test result and scan. The digest is a cryptographic checksum of the image – it changes as soon as a single byte changes.
- Preview. Optionally – or, if the owner decides so, mandatorily – the candidate first runs on the preview slot of the development environment. The team reviews it under its own address.
- Approval. An owner or admin approves the candidate. This is a high-risk action: re-authentication, audit entry, approval object. Production deployments requested via the API always wait for an approval in the portal.
- Promotion by digest. The platform copies exactly the approved digest into a release namespace from which production reads exclusively. A release tag with a different digest is never overwritten; the deployment aborts.
- Deployment. Before switching, a snapshot of the database is taken. The proxy checks the health path of the new container before redirecting traffic. If that fails, the platform automatically rolls back to the predecessor.
At no point does an agent sit on this path. The agent wrote the code – but what goes to production is an artefact that humans checked and approved.
“But then the agent is useless for operations”
That is the most common objection, and it confuses two things: operations and production access. The agent can help enormously in operations – in the development environment. It can analyse logs exported from production. It can write a hotfix, test it and provide it as a candidate. It can prepare a migration and explain its expand/contract plan.
What it cannot do: change a file directly on the production server, run a command or touch a table. And that is exactly the point. Every change to production is a deployment with digest, approval and audit entry. There is no “quick fix on the side” that nobody can explain later.
What that means for rollbacks
Because production only knows images by digest, a rollback is trivially defined: the previous digest. No manual teardown, no “I think that was Tuesday’s version”. Rollback is its own high-risk action with its own approval – in the portal by a person with an approver role, via the API always as a request.
An honest caveat: a rollback restores the image, not the database. If the new version changed the schema, you need a backwards-compatible migration – or a restore from the pre-deploy snapshot. That is why we recommend expand/contract migrations and practise rollbacks in the academy before they are needed.
Where things stand
The pipeline described here is built and tested: build step, candidate, preview slot, approval, promotion by digest, deployment with snapshot and auto-rollback. It is not yet released to customers because no customer servers are in operation yet. Status: in preparation. We say this clearly because the separation of development and production is exactly the kind of promise that should rest on evidence, not trust.
And the principle applies to ourselves: the management platform is deployed following the same pattern – release image, approval, no agent on the production host.
- #Architecture
- #Production
- #AI agents