How to Configure Windsurf Kubernetes Prevent Delete
You set up a windsurf kubernetes prevent delete rule by giving the agent a read-only role. You must leave out delete verbs in your Kubernetes RBAC rules. Many teams let their AI coding tool use a personal admin account. That choice gives the agent full power over every cluster resource. If the agent makes a mistake, it can wipe out live workloads in seconds. How windsurf kubernetes prevent delete works in native RBAC Cognition renamed Windsurf to Devin Desktop in June 2026. The IDE keeps the
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You set up a windsurf kubernetes prevent delete rule by giving the agent a read-only role. You must leave out delete verbs in your Kubernetes RBAC rules. Many teams let their AI coding tool use a personal admin account. That choice gives the agent full power over every cluster resource. If the agent makes a mistake, it can wipe out live workloads in seconds.
How windsurf kubernetes prevent delete works in native RBAC
Cognition renamed Windsurf to Devin Desktop in June 2026. The IDE keeps the same features and runs the Cascade agent. This agent can run terminal commands on its own with user permission. It opens a dedicated shell on your machine to run those tasks. The shell loads your local profile, aliases, and variables right away. When the agent runs a cluster command, it uses your local cluster keys.
To block bad actions, you must change how the cluster checks those keys. Kubernetes RBAC uses roles to hold sets of permissions. These rules are purely additive, which means there are no deny rules. You cannot take away a single action from an existing admin role. Instead, you must build a new role from scratch for the agent.
You can pick between a namespace Role or a cluster-wide ClusterRole. A Role sets permissions inside one single namespace. A ClusterRole can cover resources across all namespaces or cluster-wide nodes. Inside the role, you list the exact resources the agent can touch. You also list the allowed verbs, such as get, list, and watch. By leaving out the delete verb, the API server blocks any drop request. You then link this role to the agent identity with a RoleBinding or ClusterRoleBinding.
Why static cluster roles fall short for AI agents
Native RBAC is great for stopping broad resource deletion at the API level. It checks who logs in and which static verbs they hold. Still, static roles leave a big operational gap during live debugging. Engineers often need the agent to fix a broken pod or check logs. Kubernetes treats pod logs and pod exec as subresources under the pod API. If you grant exec access so the agent can debug, the risk returns.
Once the agent runs a command inside a pod, RBAC steps back. The API server only checks if the user can start the exec session. It does not check what commands run inside the container shell. An agent with exec rights can still delete files or drop data inside. Also, read access lets the agent pull sensitive config data or user records. Native roles cannot rewrite emails, phone numbers, or card numbers in query output.
Kubernetes RBAC + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Managing local shell keys and live command risks
Because the IDE loads your shell profile, it inherits your default cluster context. Most developers do not want to switch contexts every time they ask a question. When switching is hard, people fall back to sharing one broad role. If a wide role binding touches the wrong group, delete rights come right back. Remember that RBAC rules only add permissions together. One loose binding in a namespace undoes your careful read-only setup.
Asking the user to approve every terminal command in the IDE also fails. Prompt fatigue sets in fast during a long coding session. Users start clicking approve without reading the full command string. A safe setup needs to inspect each command and block bad flags in flight. It should also mask national IDs or card numbers in returned data.
Add request guardrails and response masking beside Kubernetes
Cluster roles and service accounts govern who reaches the Kubernetes API. Still, a broad role or agent can delete workloads or print sensitive values from ConfigMaps and logs. In practice, hoop.dev sits inline beside the API server as a sidecar for your Kubernetes API. For every production API call an agent or human sends, hoop.dev decides whether to pass, mask, block, or escalate it for review alongside RBAC.
With hoop.dev Kubernetes controls, guardrails allow listing Secret names while refusing reads of Secret data before execution, and data masking redacts matched keys in returned JSON responses and log streams in memory. Furthermore, hoop.dev holds SOC 2 Type II and is MIT licensed on GitHub.
Frequently asked questions
Can I add a deny rule to block delete in Kubernetes RBAC?
No, Kubernetes RBAC permissions are purely additive and have no deny rules. To block deletes, you must create a new role that leaves out delete verbs.
How does the Windsurf agent access my Kubernetes cluster?
Windsurf, now called Devin Desktop, runs terminal commands in a dedicated local shell. This shell loads your user profile, so the agent uses your local cluster keys.
Does blocking pod delete stop the agent from breaking an app?
Not if the role still allows the pods/exec subresource for debugging. With exec rights, the agent can run shell commands inside the container and delete files.
Related guides
In this post