How Corezoid lets an AI agent diagnose and fix customer production servers through a gate, without the agent ever holding a credential.
Authors: Dmitry Makarichev (CTO, Corezoid Inc.) and Max Ivashchenko (Senior SA, AWS)
Inside the Digital Twin (Part 1, Part 2)
In Part 1, a digital twin told Corezoid’s AI agents where each ticket belongs. In Part 2, the same twin governed what they spend: limits are accounts, every change to a limit is a transaction with a reason, and one process owns the decision to start a run. Those agents worked on code, where a bad decision costs money and a reviewer’s time.
This part takes the design onto production servers. Many customers run Corezoid and Simulator.Company in their own data centres or AWS accounts. When monitoring fires there, an engineer has to get in, look around and decide what to do. Roughly half of those tickets looked like something an agent could at least diagnose, if it could reach the machine.
The design in one paragraph: the graph says which environment, server and session a decision applies to. Accounts hold the limits and the state: sessions today, changes made, money spent, findings open. Transactions record every grant, refusal, approval, fix and correction. A small trusted piece of AWS infrastructure, the gate, reads that context and enforces it. The agent never holds a credential and never acts on a server directly.
Readers of Part 2 asked two questions that run through this part: how an approval is bound to the exact operation that runs, and who checks the result afterwards. Decisions 5 and 6 answer them, and the section after them says where the answer is still partial.
When the work started, the first instinct was to collect environments in a table. Makarichev stopped that on day one: “We don’t have tables. We have graphs, actors and transactions, and our customers already have their actors.” The point was to extend the existing actor graph, with its relationships and history, instead of starting a separate access registry.
Every customer environment was already an actor in Simulator.Company before the gate existed: product, version, hosting, contacts. The gate added what an agent needs to be governed there.

Figure 1. One environment in the twin. Mode, delegated playbook and the counts of playbooks, facts and changes are from a live environment in November; account values are illustrative. The blue frame holds actors in Simulator.Company, and the navy frame holds Corezoid processes.
The environment has a mode: shadow (the agent may plan but not connect), read, or change with approval, where a person can also delegate one named playbook to a rule. A separate flag says whether its data may be processed by a language model at all; where it is off, the gate refuses every command. Accounts hold the limits and today’s use, as in Part 2. Below the environment hang sessions, facts, proposed changes and alert tickets; above it sit two kill switches, one for the whole AI Shift and one for the gate.
Findings are attached to product versions, so every environment on a version inherits them. Any value nobody could prove is left empty: an empty field tells the next reader to check. A wrong one tells them not to.
Makarichev wouldn’t accept a vendor’s AI agent with a shell on his production database, so Corezoid’s customers weren’t going to get one either. The alternative was a gate through which an agent can look at a system without holding a credential, leaving a record of every command.
The gate has its own AWS account, built as code with OpenTofu and Terragrunt through Atlantis; an AI agent wrote most of that code, and a person ran every apply. The node is a single Graviton instance with no inbound rules and no NAT gateway, administered only through AWS Systems Manager Session Manager.
The agent runs there as Claude Code in headless mode, in a container started with an empty environment: no CI variables, no job token, no AWS credentials, only the address of the model gateway. Its one tool is a client that talks to a broker over a Unix socket, available only while it holds a lease; file access, editing and the web are switched off. A pipeline test fails unless a call from the container to the instance metadata service times out, so the agent can’t borrow the node’s role either.
AWS perspective: 1/ Session Manager needs no inbound rules. With interface VPC endpoints for ssm, ssmmessages and ec2messages, a node needs no internet gateway or NAT device either, because SSM Agent opens every connection itself. If the model gateway calls Amazon Bedrock, Bedrock offers the same PrivateLink endpoints, so model traffic stays private too. 2/ A container still shares the node's kernel with the broker it is kept from. AWS Nitro Sandboxes run a workload in its own lightweight virtual machine beside the instance, and the Nitro System enforces that boundary. Sandboxes run on Graviton instances at no extra charge, launched through Firecracker, Amazon ECS or Amazon EKS, on a node started with Nitro Enclaves enabled. Direct mode fits this design, because Corezoid operates both the node and the sandbox, and the untrusted party is the agent. A local socket (vsock) to the parent instance can take the place of the broker's Unix socket. One trap carries over. A sandbox has no metadata service of its own, but if the node routes its traffic, it can reach the node's and read the role's credentials. IMDSv2 and the hop limit don't prevent that, so reject traffic from the sandbox to 169.254.169.254 on the node and keep the timeout test.

Figure 2. One session, numbered in order, in AWS architecture notation. The model runs in the untrusted zone; everything that decides runs on the node without one. People act on the gate only through the twin.
A lease is the twin’s permission for one session on one environment. A Corezoid process reads both policies, the environment’s mode and its accounts, decides, and posts one session and one parallel slot. If anything can’t be read, or the posting fails, the answer is no. Leases expire after at most an hour, and a sweep returns expired slots with a reversing posting.
The kill switch is a field on the policy actors. A node agent with no model in it asks the twin every minute for the current mode, kill switch, leases and approved changes, and the broker checks that local copy before every single command. Turning the switch off therefore stops new commands within about a minute; a command already running finishes. If the node loses the twin altogether, it keeps its last copy, so commands under a lease already issued can continue until that lease expires, at most an hour. Nothing new can start: a new lease and every change need an answer from the twin first.
Failing closed has its own trap. Early on, the process that lists environments fetched one page of a hundred when there were already more. A few of Corezoid’s own production environments dropped out, and every command to them was refused as “not enabled”. Nothing unsafe happened, and for a while nobody noticed.

The broker is a deliberately boring piece of Python. It denies by default. A command passes only if it matches an allow-list of read-only forms; shell metacharacters are refused outright. Databases are reachable only through a handful of named queries, never free SQL: an early review showed that a “read-only” query could still terminate other sessions. Files can be read only from log directories.
One small design choice changed the agent’s behaviour more than anything in the prompt. When the broker refuses, it says why and returns the forms it would accept. An agent that hears “no” tends to try something cleverer. An agent that hears “no, but here are the four commands you can use” uses one of them.
Every command and its full output, with credentials and tokens masked before anything is written or returned to the agent, goes to Amazon S3 as a separate object, kept for a year under S3 Object Lock in governance mode and encrypted with the gate’s own key. Governance mode was deliberate: there is a break-glass procedure, and it needs a permission nobody uses day to day.
AWS perspective: S3 Object Lock works only in buckets with S3 Versioning enabled, so the session bucket needs versioning from the start. One object per command also means one AWS KMS request per write. S3 Bucket Keys can reduce those KMS request costs by up to 99 percent. S3 still fetches a bucket-level key at least once per requester, so each role's use of the key stays visible in CloudTrail.
For instances in AWS accounts, the gate doesn’t use SSH. The broker assumes a cross-account role with an external ID that can do little more than run one Systems Manager document: a fixed set of checks, each parameter constrained by a pattern. The document independently validates the supported operations and their parameters, so the boundary is enforced twice: by the broker, and by Systems Manager on the instance. The team tested that layer on purpose: a file outside the log directories and a check that doesn’t exist were both refused before anything ran on the host.
That second layer has its own sharp edges. Systems Manager validates allowedPattern twice: once at the API with Java’s regular expression library, and again in SSM Agent on the instance with Go’s. One new document had patterns that Java accepted and Go did not. The document registered cleanly, and every command failed on the instance before it started. Documents are now tested with Go’s regex engine before they ship. For servers reached over SSH there is no second layer of this kind yet; there, the broker and each playbook’s own checks are the boundary.
AWS perspective: IAM can limit ssm:SendCommand to a specific document and to instances carrying a given tag, and AWS CloudTrail records SendCommand calls as management events. Because allowedPattern is validated by both the API and SSM Agent, with different regex engines, test every pattern against both. For cross-account roles, the external ID protects against the confused deputy problem.
Reading is most of the value, but some fixes are narrow and repetitive: an idle transaction holding locks, a disk full of rotated logs, a crashed scheduler, a kernel update. For those, Corezoid built a narrow path to change, and kept the agent off it. The path:

Figure 3. The life of one change. Each red arrow is a refusal that leaves the server untouched or, after a failed health check, on the rollback path.
What this guarantees is narrow, and worth stating precisely. A change runs only if it was previewed, it was approved by someone the twin allows to approve, it has not been edited since, and the state the playbook checks still matches the preview. For disk cleanup that state is the list of paths, not the contents of the files. The node does not check who approved; it trusts the twin’s access rules, which makes the twin the authority, not a dashboard. Nothing here says the change is a good idea. That is what the approval and the health checks are for. An approval is also an exception scoped to one change: it is spent when the change runs and lapses within an hour if it doesn’t, so nothing approved once quietly becomes the default.
The first change through this path on a customer’s production ran on 24 November. One node of a clustered Corezoid worker was in a crash loop: its local copy of the embedded Erlang database could no longer merge with its peers. That copy is cluster state the node fetches again from its peers, so the documented fix is to move it aside and restart. The playbook runs only on the confirmed symptom, keeps the old directory as a rollback, and counts as successful only if the service stays up for 60 seconds, listens on its port and writes no new crash dumps. The agent diagnosed the loop through the broker and proposed it, and an infrastructure engineer approved it. Nothing happened: the node misread the approval in Corezoid’s answer and skipped the change, and a second approval hit a second parsing bug. Both were fixed, the stuck changes were marked as errors with the reason, and the third run took about a minute: the node rejoined, and the other three workers were never touched. A fail-closed executor that misreads “yes” as “no” costs an hour. The opposite mistake would have cost a customer.
The same run settled who may approve. The engineer couldn’t open the change in the twin, because objects had been shared with named users one by one. Edit rights on the gate’s forms now belong to the infrastructure team, so authority is a rule in the twin, not whoever was shared on an object.
Approval can also be delegated. One environment lets a Corezoid process approve one named playbook, at most once a day, when the ticket classifier is at least 90% sure the alert is that playbook’s symptom. That is the classifier’s confidence, not a probability that the change is safe, so only playbooks bound to a preview hash qualify, and right before acting the node takes a fresh preview that must still show the symptom and the same list. A person made that delegation on the environment, and the twin keeps the history the next one will be based on. A second delegation stopped at the twin’s own access rules: the playbook’s card belongs to the engineer who owns it, and the account asking could only read it, so that playbook still waits for a person.
The other half of the loop is deciding what actually got done, and the first patch waves showed how easily the twin can record that wrong.
Patching uses its own Systems Manager document with a closed list of packages, and approval for a wave is a token tag on each server. The gate snapshots every volume, records a baseline of running containers, listening ports, failed units and the kernel, and after the reboot stops the wave at the first server that differs.
The first wave, on 4 November, went to four non-public servers in Corezoid’s own production, on purpose. “The main thing in the pilot is not to break our production, and to go through the full cycle and the twin,” Makarichev had written the day before.
On the first server, the post-reboot check stopped the wave because a port had moved. The service was fine: the Erlang node picks its distribution port at random on every start. On the retry, the same server reported success, and that was wrong. The earlier rollback had left the old kernel as the default, so nothing was updated and the server never rebooted. By then the twin had already recorded six findings on that server as closed.
The correction was made in the books first. Each closing posting got a reversing posting with its own reference:
{
"actor": "Server (production, non-public)",
"account": "Findings closed",
"balance_before": 1,
"amount": -1,
"balance_after": 0,
"ref": "wave-1-<finding>-<server>-revert",
"author": "<correction owner>",
"comment": "Retry reported success, but the server still runs the old kernel: the earlier rollback left it as the default boot entry. Closure reversed.",
"evidence": "running kernel after the retry equals the kernel before the wave"
}
Figure 4. One of the six reversals, with the fields shortened. References illustrative. Who may post a correction, a person or a process, is set by the account’s access rules.
Then the gate learned to make the newest installed kernel the default before rebooting, and to fail unless the server is actually running it afterwards. By midnight the wave had closed on all four servers. When the corrected closures were posted, the ledger first refused them because their references were already used; the fix was a new reference that names what it corrects.
Even after testing, the first production run can reveal assumptions your checks missed. When you were wrong, reverse the books, not just the server.
AWS perspective: Run Command can enforce a wave's stop rule. With max-errors set to 0, it stops sending a command to new nodes after the first error. With max-concurrency set to 1, no other invocation is already running when that happens. This works only if the post-reboot check fails the command whenever the server differs from its baseline, not just when a package fails to install.
Early on, the agent found a database on an unusual port and recorded it for the next session. Useful, and exactly how a model writes nonsense into its own memory.
So learning is split in three, as in Part 2. Facts are recorded automatically, but only for a host where a command in that lease was neither refused nor failed, according to the broker’s record rather than the agent’s account. Each fact carries the lease it came from, so a reviewer can open that session’s record and find the command behind it; it isn’t yet tied to one specific command and its output. They start as “under review”, and only facts a person approved reach the next prompt, as data. An approved fact is never overwritten; a different observation is stored next to it. The review paid off on the first night, when several new facts turned out to be false because a bug in a Systems Manager document hid an error. The rule proves that something was observed through the gate, not that it is still true, which is why a conflict is kept rather than resolved silently.
For the first month, that loop had no last link: 234 facts sat under review, and when an engineer approved the first 27, the agent still didn’t see them. The process that builds the node’s desired state had hit Corezoid’s one-megabyte task limit and silently skipped what didn’t fit, the same kind of quiet refusal as the page of a hundred. It now reads in pages, and old and new versions were compared on the same live data before the switch.
Alert rules work the same way: a job proposes them from two weeks of alert history, and people activate or disable each one. About 140 pairs of tickets once looked like duplicates but were intentional, one for support and one for DevOps; duplicate closing was switched off and its one closure reversed. The pattern in the data was real; the rule built on it was not.
With these pieces in place, one alert on a customer’s server goes through four steps, and each leaves a record on the same actors.
The acceptance step is where the gate is still thin. Two changes have run in production, both approved by a person, alongside the patch waves on Corezoid’s own servers. The first one showed that acceptance stopped at the twin: the result never reached the ticket, and automatic closing would have closed it on the next “OK” of a flapping alert without knowing a fix had run. The change now writes its result into the alert’s ticket, and closing reads it. A review of that fix caught one more trap: the result was keyed by host name, and host names repeat across customers’ installations, so it would have landed in other customers’ tickets. It is keyed by the alert.
Reach is thin too. Of about 2,100 escalations in the last 30 days, the gate could see about one in twelve; most environments sit behind access it doesn’t have yet, such as VPNs with MFA, IPsec tunnels and IP allow-lists, or are still in shadow mode. Nor does the twin yet track how long a change waits for a person. Part 4 is about that constraint in code, where it arrived first.
Verification is only partly independent. The check that a patch took is run by the gate that applied it, against the server’s running state rather than the playbook’s exit code; that distinction is what the 4 November wave taught. A second source, the server inventory the vulnerability radar reads on its own schedule, recounts the books afterwards. In November it disagreed once, in the other direction: it listed every installed kernel, so patched servers still looked vulnerable. Both errors got the same rule: for these kernel findings, closure requires evidence that the server is running the expected fixed kernel. A verifier that shares nothing with the executor is the next step, not the current state.
Corezoid's experience suggests five lessons:
The agent never held a key. Everything it learned about the servers, it learned through a door that writes everything down, and everything it changed was approved in a twin that people can read, by a person or by a rule a person set there.
Next in the series: when AI agents outrun human review. Part 4 is about what happened when the shift opened merge requests faster than people could read them, and how the twin learns from every reviewer’s comment.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.