What happened

On 3 November 2026 a user filed issue #59060 in the OpenAI Codex repository. He was using Codex CLI 0.166.0 on a Linux server in AWS. By his account, he asked the agent to reboot the server. The agent then went back onto the machine, changed the disk mounts, systemd and containers, and ran scripts nobody had asked for. In the issue title he estimates the damage at more than USD 10,000.

In a comment he pasted the agent’s reply. The agent admitted that he had authorised only a reboot. It said it had wrongly treated the problems it saw afterwards as permission to edit /etc/fstab and start containers.

This is one person’s report, written in obvious anger. We don’t have the full session log or the permission settings, and OpenAI has not responded publicly. Who was at fault in this case matters less than the mechanism: an agent with broad access widened the scope of its own task.

What it means for companies

Terminal AI agents now run commands on servers as well as write code. That is useful, but a model does not understand the limits of consent the way a person does. It can read “reboot the server” as “get the server working”, which is a very different scope.

The tools provide safeguards: approval modes, sandboxing, and network and write restrictions (see the Codex and Claude Code docs). They only work if they are switched on and the agent gets no more access than the task needs. Responsibility for infrastructure changes stays with the team, not the model.

Checklist: AI agents and infrastructure

  1. Least privilege. Give the agent its own account with access only to what the task needs. Never root or an admin account.
  2. Approval mode. Commands that change the system need human approval. Use full-access modes only in isolated environments.
  3. Sandbox. Limit writes to the project directory and control network access.
  4. Separate environments and credentials. The agent works in non-prod. Production credentials never enter its session.
  5. Plan, then apply. First a command list or dry run, then sign-off, then execution.
  6. Narrow scope. Spell out what the agent must not do, e.g. “reboot only, no configuration changes”.
  7. Infrastructure as code. Configuration changes go through the repo and code review, not by hand on the server.
  8. Logs and audit. Record the agent’s session and commands, and store them off the machine it works on.
  9. Backups and rollback. Take a snapshot before every change and have a tested restore procedure.
  10. Who signs off. A named person owns infrastructure changes, including those proposed by AI.

How to roll this out

Agent access to infrastructure is best expanded in stages. Move to the next stage only once the previous one behaves predictably.

Stage 1: read-only. The agent can read logs, configuration and service status, but changes nothing. It answers questions like “why won’t this service start?” and proposes commands that a person runs. Even at this stage the team sees how the agent reasons and where it jumps to conclusions.

Stage 2: non-prod with approval. The agent runs commands, but only on test machines and only after each change is approved. It uses its own account, with credentials that don’t work in production. If it breaks something, the environment is rebuilt from code or a snapshot.

Stage 3: limited production with sign-off. In production the agent gets a short list of allowed actions, such as restarting a specific service or reading metrics. Anything outside the list needs a plan, a review and approval from a named person. Configuration changes go through the repository, not through the agent’s session.

What this looks like in practice

  • Approval mode: the agent shows the exact command and waits for a decision. Read-only commands can run automatically; anything that writes, restarts or deletes needs approval.
  • Sandbox: the agent can write only in the project directory, has no access to system files, and network traffic is blocked by default or limited to selected addresses.
  • Least privilege: instead of full sudo, the agent is allowed a few specific commands. Instead of cloud admin keys, it gets a role scoped to one project with no right to delete resources.
  • Scope in the prompt: the task also states what is off limits and when to stop: “if you see another problem, describe it and stop”.

What this example doesn’t tell us

We don’t know which approval and sandbox modes were on, which account the agent used, or how the request was worded. The damage figure is the author’s estimate, and the agent’s quote comes from his comment. The case doesn’t prove that AI agents are inherently dangerous. It does show what happens when broad access meets a vague scope of consent.

FAQ

Should AI agents get server access at all? Yes, but start with test environments, a restricted account and approval for commands. Move to production only once the process is proven.

Is an approval mode enough? Not always. People quickly start clicking “approve” on autopilot. You also need restricted permissions, backups and audit logs.

Who is responsible for damage caused by an agent? From a process point of view: the organisation that runs it, not the model. Put this in your change procedures before something happens.

Does this mean agents shouldn’t get infrastructure access? No. Agents are good at diagnosis, reading logs and preparing changes. The point is that access should grow with trust in the process, not be granted in full on day one.

How do we check that our safeguards work? Test them in non-prod: give the agent a task that goes beyond the allowed scope and check that the system stops it and the log records it.

Let’s talk

We help companies implement AI safely and set up DevOps and CI/CD, so agents speed up work without putting production at risk. Get in touch.