It can be safe to let an AI agent change production infrastructure when five conditions hold. The agent reads the live state and says what the change will touch before it acts. A person approves that specific change. The change runs through a path that refuses when the state has drifted. The agent checks the result from outside afterwards. And its credentials cannot do more than the change needs. For changes that are slow or impossible to undo, such as deleting data or DNS records, keep a person doing the work and let the agent prepare it. On 17 November 2026 an AI agent changed two settings on the hosting in front of our live website. Below is exactly what it did, the four changes it decided against, and the one condition we still do not meet.
The change: making every visitor use HTTPS
The owner's instruction, typed in chat, was short: do what needs to be done for HTTPS. An audit earlier that day had found that our site answered plain, unencrypted HTTP with the full page. The agent was a Claude Code session with access to the owner's signed-in hosting dashboard and to the website's repository.
It worked in this order.
- Read the live state. Plain HTTP requests returned the full page, and the
wwwaddress redirected to the plain-HTTP address. The site already sent the header that tells browsers to use HTTPS on later visits. The hosting dashboard showed "Always Use HTTPS" switched off and the minimum TLS version at 1.0. - Mapped what the change would touch. Of the 14 DNS records, three pass through the hosting proxy: the main domain,
wwwand the staging site, all served by the site's own code. Mail and file-transfer records bypass the proxy, so a proxy setting cannot affect them. The site's code has no HTTPS redirect of its own, so turning one on at the proxy could not create a redirect loop. - Noticed it had been wrong. The dashboard's "TLS 1.0" contradicted the audit, which had said the site refused TLS 1.0 and 1.1. Re-testing showed the refusal had come from the testing tool on the agent's own machine. The site accepted both.
- Listed the options with their downsides and picked two: "Always Use HTTPS" on, and the minimum TLS version raised to 1.2.
- Told the other agent sessions working on the site before changing anything, then made the two changes.
- Checked from outside. Plain HTTP on all three hostnames now gets a permanent redirect to HTTPS with the path kept, TLS 1.0 and 1.1 are refused by the server, and the home page, blog, a post, the contact page, the sitemap and robots.txt all load.
- Corrected its earlier audit, the post that quoted it and the project's handoff notes.
Steps 2 and 3 are where an agent earns or loses trust on infrastructure work. A change at the proxy affects every hostname behind it, so the agent had to establish which hostnames those were and what each one does before it could say the change was safe. And the contradiction in step 3 only surfaced because it read the setting directly instead of relying on its own earlier test.
The four changes it chose not to make
The same task could have justified more changes. The agent applied one test to each: if this is wrong, how fast can we undo it, and who notices first?
| Possible change | If it goes wrong | Decision |
|---|---|---|
| The hosting provider's own HTTPS header | Duplicates the header the site already sends, so two sources could disagree | Left alone |
| Submitting the domain to browsers' built-in HTTPS list | Removal takes months, and every future subdomain must support HTTPS | Left for the owner to decide |
| A DNS record naming which certificate authorities may issue certificates | A wrong record can block certificate renewal, which takes the site down when the current certificate expires | Left for later, with care |
Changing the site's www redirect code | Needs a code release; the existing redirect is harmless once HTTP is upgraded first | Left alone |
The two changes it made are each undone with one switch in the dashboard, and a mistake in either would show up within minutes on the checks in step 6. The four it skipped are slow to undo or fail weeks later, when nobody connects the failure to today's change. That split is the practical line between what an agent may do on approval and what a person should do.
The release path refuses when state has drifted
Website releases go through a similar gate in code. Our live site builds from one branch, and only one workflow moves it. That workflow runs only when someone types LIVE to start it. It refuses to run if the live branch has any commit that changes files and is missing from staging, and it pushes with a lease, so a push from anywhere else in the meantime makes it fail rather than overwrite. A daily scheduled job may add an empty commit to the live branch when a post is due, and nothing more.
The same day, two agent sessions each needed a release. A release ships whatever the staging branch holds at that moment, so if the second session had merged its change first, the first session's release would have carried it out unreviewed. The second session held its change back until the first release finished, then merged and released separately. The workflow made the order matter; the sessions told each other what they were doing so it went the right way.
The condition we do not meet: credentials
OWASP traces the risk it calls excessive agency to three causes, and the second, excessive permissions, is ours. Our agents run under the owner's GitHub login. That token could push the live branch directly or start the release workflow without anyone typing LIVE. The guards above are conventions that the workflows and the agents follow; the token itself does not enforce them.
The fix is a branch rule that blocks direct pushes, and GitHub offers protected branches on private repositories only on its paid plans. Until we move to one, every agent session is told in its standing instructions never to push the live branch, and every release so far has gone through the workflow. A rule in instructions is weaker than a rule in the platform, and we say so here because a reader deciding the same question for their own team should weigh it.
Which production changes should always need a person?
These should be approved by a person every time, and in the second group carried out by one:
- Approved, then done by the agent: settings changes that one switch undoes, deploys through a gated release path, scaling within set limits, restarting a service.
- Done by a person, prepared by the agent: deleting or repointing DNS records, deleting data or backups, changing who has access to what, certificate and key changes, anything that commits the domain to a third-party list, and anything whose failure would show up only weeks later.
The US National Institute of Standards and Technology treats knowing and managing this kind of risk as an ongoing job rather than a one-time review in its AI Risk Management Framework. In practice that means writing these two lists down, and revisiting them after every incident.
Before an agent touches your production systems
- The agent reads live state and writes down what the change will touch, before acting.
- A person approves the specific change in writing, and a different change needs a new approval.
- The change goes through a path that fails when the state has moved since it was read.
- The agent verifies from outside, with checks it names in advance.
- Anything slow to undo stays with a person.
- Its credentials can do the approved change and little else. If they can do more, say so to whoever approves.
The wider set of controls for agents in production is in what safeguards should control an AI agent in production, and how our own agents recover when a tool call fails is in AI agent tool failures. If you are deciding how much infrastructure access to give an agent, talk it through with us.
