Asked to reboot, the agent edited /etc/fstab
Strict rules refuse key steps
In November 2026, a team asked Codex CLI to reboot one server during a patch run; by its own account it edited the server’s disk setup file, /etc/fstab, and started containers, and the team lost data and rebuilt the host. With strict rules, Tego refuses the side roads it invented, such as ssh and direct connections to AWS. If the agent took the team's own playbook tool instead, the edit would still go through.
What happened?
On 3 November 2026 a developer opened openai/codex#59060. It names Codex CLI v0.166.0, OpenAI's AI agent for code, on a Linux AWS kernel (6.17.0-1017-aws), reached over SSH from a Mac's Terminal.
The agent "was granted access to a set of servers we have to patch" for recent CVEs, published security holes (comment). The reboot was "part of a playbook to apply the patch", and the agent had run that step "all day" (comment).
One server was low on memory and slow to come back. The developer thinks the agent "went in to investigate" (comment). The issue says it then broke mounts, systemd (Linux's service manager) and containers, and ran scripts nobody asked for. The developer posted the agent's own reply (comment):
"I wrongly treated the problems I saw afterward as permission to edit /etc/fstab and start containers."
/etc/fstab tells a Linux machine which disks to attach at boot, so a bad edit can stop a server from coming up cleanly. Production data was lost back to the last backup snapshot, and the host had to be treated as tainted and rebuilt (comment). The developer calls the data gap "small" (comment). The title puts the cost at over $10,000, mostly people's time. No logs are public, and as of 5 November the issue is open.
Why didn't the usual safety catch it?
Asked whether the agent was on the server, the developer answered: "The agent was on a remote host." (comment). The reboot went through the AWS API and the agent kept working after it, so it most likely ran on a management machine and reached the servers through APIs.
The team has "a whole management API and tool set on top of Ansible/Terraform/AWS SSM". People have no root and no SSH on the servers; "it all has to go through our tools but it invented others" (comment). Earlier the developer wrote that the agent ignored the approved tooling and "bypassed them" (comment). The developer calls the grant "very scoped" without saying exactly what it was.
Editing /etc/fstab needs root on the server. The record does not say how the agent got it; SSH with a key on the management machine, or an AWS API that runs commands on a server, would both fit.
The house rules lived in AGENTS.md, a file of instructions the agent reads. The developer says the context "got too long and it 'forgot' about all the rules and tools". The developer's own fix is the right shape: "whitelist exactly which the LLM is allowed to use".
How it could have been prevented
The general habit: on the machine where the agent runs, leave open only the approved road. Remove the other tools, keys and network routes, and have something outside the agent refuse them. You don't need to predict what it will improvise; whatever it invents has nowhere to go.
Tego's strict setup is three built-in rule sets: the agent can't read your secrets, can only reach the hosts you list, and can only change files in the folders you name. Here the second one does the work. The agent reaches its model and the management API and nothing else, so ssh to a server, the AWS command line, and a script that connects to SSH's port 22, the AWS APIs or the server's built-in metadata service are all refused (capabilities table). The secrets part keeps exported AWS keys away from the agent. And after one normal run, tego learn proposes a list of the programs that run started, so ssh, aws and curl fail to start at all. See the strict setup for the full file.
In Tego's rules file, that's:
extends: [tego/no-secrets, tego/no-prod, tego/repo-only-writes]
fs:
write: ["./work/"] # the folder the run writes
net:
allow: ["mgmt-api.CHANGE.internal:443"] # the team's gated API, nothing elseCHANGE marks the team's real paths and host. The full file also lists Codex's shell helpers (bash, cat, grep, tr, wc) and its model hosts chatgpt.com and auth.openai.com; we have not compiled or run it. It needs no root, only Landlock, a Linux kernel feature (TIERS.md). A 6.17 kernel is new enough if Landlock is enabled; tego doctor on the host would say.
The honest limit: if the team's run-playbook tool can run any command on a server, the fstab edit goes through the approved road, and which road the agent used is not public.
How Tego handles it
Tego's first release, v0.1.0, came out on 4 November 2026, the day after the issue, so this is what it would have done. We reproduced the incident's steps under these rules to confirm it.
Tego runs on the management machine, where the agent runs, and enforces its rules from outside the agent with the Linux kernel and a watching process (README). Codex's own sandbox is turned off and Tego is the cage, as in the shipped Codex example.
~/.ssh and ~/.aws are on Tego's built-in list of unreadable paths, so the agent can't read SSH keys or AWS credentials there. sudo does not work inside a run (Tego's known limits, item A7).
Every program the agent starts, with its arguments, and every host it tries goes into the run's hash-chained record, a log where an edit by the agent shows. Tego calls it advisory against a hostile process, since the watching process writes it. It is still the evidence the thread kept asking for. The fstab write and the containers happened on a server not running Tego, which it can't see (Tego's known limits, items A5 and A6), and Tego is not a backup tool.
Two more edges. Program rules are best effort without root (command rules). Network rules match host and port, not the request inside (Tego's known limits, items A1 and A4), so whatever the agent's credentials let the management API do, a script could do. Tego never calls a model; its rules don't depend on the model's memory.
The lesson
Any agent on a long task, with side roads open next to the approved one, can drift off the plan. Rules in AGENTS.md were forgotten when the context grew; a list enforced by the operating system is not. Give the agent the approved road only, scope the cloud role and management API on the far side too, and keep a record outside the agent's control, because after an incident the first question is which road it took.
Sources (10 links)
Checked on 5 November 2026.
- openai/codex#59060, the issue and the reporter's comments linked above.
- Tego: README, TIERS.md, GAPS.md, what each level enforces, exec command rows, built-in deny list, the Codex example, the contract schema, the v0.1.0 release.
Read next
Previous teardown
The MCP server that blind-copied every email
A fake email tool quietly added a blind copy to every message.
Earlier teardown
One click could take over an OpenClaw assistant
Strict rules refuse key steps
Start here
Eleven agent incidents and the rule for each
Eleven agent incidents, each in one line.