How to Configure Windsurf Kubernetes Permissions
To set up windsurf kubernetes permissions, bind a scoped Kubernetes Role to the identity your agent uses. Then restrict the agent terminal or Model Context Protocol server to that specific profile. Windsurf, now called Devin Desktop by Cognition, runs terminal commands in a dedicated shell. This shell loads your local shell settings, aliases, and variables. When teams leave broad cluster admin rights in that shell, the agent inherits them. A single bad prompt or loop can then alter live workload
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.
To set up windsurf kubernetes permissions, bind a scoped Kubernetes Role to the identity your agent uses. Then restrict the agent terminal or Model Context Protocol server to that specific profile. Windsurf, now called Devin Desktop by Cognition, runs terminal commands in a dedicated shell. This shell loads your local shell settings, aliases, and variables. When teams leave broad cluster admin rights in that shell, the agent inherits them. A single bad prompt or loop can then alter live workloads or read sensitive secrets.
How windsurf kubernetes permissions work in native RBAC
In Devin Desktop, the Cascade agent runs terminal commands with user approval. It can also reach external systems through configured Model Context Protocol servers. On macOS, the agent uses a zsh shell. On Linux, it uses a bash shell. Because the shell loads your local profile, the agent uses your active Kubernetes identity.
Kubernetes controls what that identity can do through role-based access control. In Kubernetes RBAC, rules are purely additive. There are no deny rules at all. You start with zero rights and add explicit permissions through roles. A Role grants rights inside one specific namespace. A ClusterRole grants rights across all namespaces or for cluster-wide objects like nodes.
To apply these rules, you create a RoleBinding or a ClusterRoleBinding. A RoleBinding links a Role or ClusterRole to a user or service account in one namespace. A ClusterRoleBinding grants those permissions across the entire cluster. For an AI coding agent, you should create a dedicated service account. Bind it to a Role in a single dev or staging namespace. Give it read verbs on pods and deployments so the agent can check status.
Controlling subresources like logs and pod exec
Developers often ask the agent to read app logs or debug a failing pod. In Kubernetes RBAC, logs and remote shell commands are subresources. The API server checks permissions for subresources using a slash after the resource name. For example, reading pod logs requires permission on the pods log subresource. Running a command inside a container requires permission on the pods exec subresource.
You should separate these two rights when you set up your roles. Reading pod logs is usually safe for debugging, though logs may hold emails or phone numbers. Granting pod exec permissions is much riskier. If the agent can run commands inside a pod, it can read mounted secrets. It can also reach internal network services from inside the cluster. Leave pod exec out of the agent role unless a specific task requires it.
Kubernetes RBAC + AI Agent Permissions: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native RBAC solves and what it leaves open
Native Kubernetes RBAC is great for static boundaries. It decides which service account can call a given API group and resource. By scoping the agent to one namespace, you protect the rest of the cluster. If the agent tries to delete a node, the API server blocks the call.
Still, static RBAC only checks who logs in and which API resource they hit. It does not inspect what individual commands or payloads do in flight. If an agent has pod exec rights, RBAC cannot stop a destructive shell command inside the container. If the agent reads pod logs, RBAC cannot mask card numbers or national IDs in the output. Also, storing static kubeconfig keys on a laptop leaves credentials exposed to any local process. Teams need runtime controls to approve risky actions and rewrite matched fields in results.
Govern kubectl and API calls in flight
Identity providers and Kubernetes RBAC decide who logs into a cluster. They cannot redact keys inside returned JSON objects or hold a risky delete call for review. By design, hoop.dev sits inline as an open-source proxy, a sidecar for your Kubernetes API, without replacing RBAC. On every production call from an engineer or AI agent, hoop.dev decides to pass, mask, block, or hold it for human approval.
First, hoop.dev guardrails refuse banned methods, paths, or headers before they run or hold risky deletes for review. Next, hoop.dev data masking rewrites sensitive keys in returned Secret, ConfigMap, and log responses in memory, and writes each decision to the audit trail. Explore the repo on GitHub.
Frequently asked questions
Did Windsurf change its name to Devin Desktop?
Yes, Cognition renamed Windsurf to Devin Desktop on June 2, 2026. It keeps the same IDE features, and the Cascade agent still runs terminal commands and MCP tools.
Can I add a deny rule in Kubernetes RBAC to block my agent?
No, Kubernetes RBAC permissions are purely additive and do not support deny rules. To block an action, remove the broad role binding and grant only the exact verbs needed.
Why does my agent have cluster admin rights by default?
The agent terminal loads your local shell profile and active variables. If your default local context uses a cluster admin role, the agent inherits those same permissions.
Related guides
In this post