When you let AI investigate a production incident, it enters your production environment: it reads logs, reads metrics, connects to Kubernetes clusters, and holds a command line. A prompt can state how it should act, but it can't guarantee what it's unable to do.
AI SRE has a three-layer safety design, and each layer answers one question:
- Prompt: what it should do. Which things it does itself, which it asks about first, and which it hands to a person.
- Tools: what it can do. However the model understands the rules, an out-of-bounds operation doesn't run.
- The customer's permission system: who has the final say. The final decision rests on the accounts and permissions the customer already has, and we don't build a separate set.
This post follows those three layers and uses Kubernetes access to show how the last two are designed.
The prompt sorts operations into three tiers by consequence
The prompt sets three tiers for how far AI SRE can go on its own.
| Tier | What it includes |
|---|---|
| Does it itself | All read-only operations; acknowledging and snoozing alerts; writing timeline comments; scaling up; silences with an expiry time |
| Asks first | Deleting data that can't be regenerated; stopping services other people depend on, shutdowns, and restarts; deleting or destroying resources on external infrastructure; outward-facing actions nobody asked for |
| Hands to a person | Kubernetes rollbacks, where it gives the command and a person runs it; status page updates, where it only drafts and a person publishes |
The tiers follow consequences, not command names. "Asks first" applies when two conditions hold together: the operation is irreversible, and a person or system depends on the thing being operated on.
That's also why scaling up and silences with an expiry time fall under "Does it itself": the first can be scaled back down, and the second expires automatically.
With nobody present, operations that need confirmation don't run
A common approach is to pop up a confirmation for every risky command. That approach fails in two places.
Nobody clicks confirm. In our statistics, about 85% of sessions are triggered by automation, such as an investigation that starts automatically when an alert arrives. Nobody is watching these sessions as they run.
Blocking by command text is easy to get around. Write the command into a script and run the script, and a text check can't see it.
So in automatically triggered sessions, any operation that needs asking first is treated as denied: it's skipped and written into the report.
There's also a rule for when someone is present: when you approve a plan, you've agreed to the design, and that doesn't approve execution.
A prompt relies on the model's compliance, so it isn't a boundary
When following rules, models make fewer mistakes than people do. That's our judgment. But the three-tier rules depend on the model complying, and we can't guarantee it executes them properly in every session.
A reliable boundary meets one condition: however the model understands or rewrites a command, an out-of-bounds operation isn't let through. Only the tool layer can guarantee that.
The tool layer makes three decisions: where credentials live, who decides permissions, and how much write access to open. We go through each one with Kubernetes.
Credentials stay where the model can't read them
The most direct way to connect Kubernetes is to have you provide a kubeconfig, put it in the runner's directory, and let the runner run kubectl.
This has three problems:
- Security. The credentials leave the cluster and sit in the runner's directory. Commands written by the model run on the same machine and can read them.
- Network. The runner must be able to reach the apiserver. A cloud sandbox sits on the platform side and can't reach your cluster.
- Convenience. A managed cluster's kubeconfig often depends on an authentication program on the local machine, and copying it to another machine breaks it.
What we do now: you install a very small forwarder in the cluster, and it connects out to the platform. The cluster opens no inbound ports, and the credentials stay in the cluster.
AI SRE runs native kubectl in a runner or cloud sandbox. The kubeconfig it gets holds only the platform's address and a token, with no cluster credentials.
The cluster's own RBAC decides permissions
A request first reaches the platform's proxy, then travels over the connection the cluster opened into the cluster, and is handed to the apiserver unchanged.
What it can do is set by the RBAC you bind to this forwarder. The platform adds no permission check of its own in between.
Wrapping Kubernetes capabilities into a set of functions for the agent is common, and MCP servers usually do exactly that. We built a version with functions too, then deleted the whole layer and switched to proxying kubectl directly.
| A set of functions | Proxying kubectl | |
|---|---|---|
| Permissions | The function layer checks them itself, which makes a second permission system | Decided only by the cluster's RBAC |
| What it can do | Only the listed operations; custom resource definitions (CRDs) differ across customers | The apiserver's whole API, including CRDs |
| Whether the model can use it | It has to read each function's description | Appears heavily in training data; if it's unsure, it can run kubectl --help |
| Context use | Every function definition takes up window space | No function definitions |
The first row is decisive. Permission checks in a function layer happen outside Kubernetes, which makes them a permission system you'd need to maintain and audit separately.
You already manage cluster permissions with RBAC, and the audit logs are in the cluster too. Putting the boundary there means you don't have to learn and trust a second set of rules.
The last three rows match the conclusion in From MCP to a CLI: Give agents a CLI on platforms you own: a command line the model already knows how to use doesn't need another wrapper.
Write access has to block indirect privilege escalation
The permission tiers the platform offers are deliberately narrow:
- The read-only tier binds Kubernetes's built-in view role, which excludes Secrets.
- The write tier allows only three kinds of operations: evict pods, change replica counts, and change HPAs.
The write tier doesn't allow changing a workload's image, start command, environment variables, or mounts.
The reason: if it can modify a workload, it can make the workload print the credentials mounted into it and then read them from the logs. That indirectly gets all of that workload's permissions, and no single step along the way looks like privilege escalation.
The cost of this limit is that kubectl rollout restart and rollout undo can't be used, because both modify the workload. You can replace restarts by evicting pods one by one. Rollbacks have no substitute, so they fall under "Hands to a person": AI SRE gives the command and a person runs it.
For the full setup, see Safe cluster access for AI SRE: No kubeconfig, no open ports.
Other systems' boundaries sit on the accounts you give
The same principle applies to other systems: the boundary rests on the account permissions you grant, and the platform doesn't depend on the model behaving.
| System | Where the boundary is |
|---|---|
| Database | The data source account you configure, preferably read-only; the executor also checks once more that the statement is a read-only query |
| Cloud account | The sub-account permissions you grant |
| Host | The system account the runner runs as; use a dedicated account and not root |
| Flashduty platform | The identity and permissions of the person currently speaking |
| Status page | It can only draft, and a person publishes |
One thing to try first
List every account and token the agent holds, and next to each one write the most it can do with it.
If any answer goes beyond what you expected, narrow that account's permissions. Editing the prompt won't fix it.
This is the third post in our series on building AI SRE. The first two are Building an always-on AI SRE and How we evaluate an AI SRE.



