How to Configure Windsurf Kubernetes Sandbox

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a windsurf kubernetes sandbox by scoping a Role to one test namespace. Next, you bind that role to the credentials the coding agent uses. Teams often let AI tools use a developer workstation shell with full cluster rights. When roles are too broad, a bad command can delete shared workloads or leak secrets. How a windsurf kubernetes sandbox works with native RBAC Cognition renamed Windsurf to Devin Desktop in June 2026. The IDE keeps the same features and uses the Cascade agent. Thi

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 sandbox by scoping a Role to one test namespace. Next, you bind that role to the credentials the coding agent uses. Teams often let AI tools use a developer workstation shell with full cluster rights. When roles are too broad, a bad command can delete shared workloads or leak secrets.

How a windsurf kubernetes sandbox works with native RBAC

Cognition renamed Windsurf to Devin Desktop in June 2026. The IDE keeps the same features and uses the Cascade agent. This agent can run terminal commands on its own after the user gives permission. It opens a dedicated shell on your machine, using zsh on macOS or bash on Linux. Because this shell loads your normal profile, the agent inherits your aliases and local variables. It also inherits your default cluster context and any active cloud keys.

To isolate the agent, you must restrict what that cluster user can do. Kubernetes Role-Based Access Control lets you define exact rules for API objects. A Role sets permissions inside a single namespace. A ClusterRole sets permissions across the whole cluster or for cluster-scoped items like nodes. You then attach the Role to a user or service account with a RoleBinding. If you use a ClusterRoleBinding, you grant those rights across every namespace in the cluster.

For a safe sandbox, create a dedicated namespace just for agent testing. Build a Role in that namespace that allows reading and writing basic workloads. Bind that Role to a specific identity made only for the IDE shell. Never give this test identity a ClusterRoleBinding that spans production areas.

Handling subresources and additive rules in your sandbox

Kubernetes permissions are purely additive, which means there are no deny rules. You cannot give an agent broad cluster rights and then block one secret namespace. You must start with zero rights and add only the exact actions the agent needs.

You also have to watch out for API subresources. In Kubernetes, actions like reading pod logs or running commands inside a pod are subresources. The API writes these with a slash, covering pod logs or pod exec paths. If you let the agent use the pod exec subresource, it can open a shell inside containers. From inside a container, the agent might read mounted keys or reach internal network services.

Kubernetes RBAC + AI Sandbox Environments: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Even if you try to restrict subresources by specific object names, Kubernetes has limits. The resource name filter on creation only works for top-level items, not for subresources. So, you should omit the pod exec rule from your sandbox Role unless the agent needs it.

What native RBAC solves and what it leaves open

Native cluster roles and bindings solve the first layer of isolation. They decide which identity can log in and which namespace API endpoints it can reach. If the Cascade agent tries to delete a deployment in another namespace, the API server blocks it. This stops an agent in a test namespace from breaking production apps on the same cluster.

Still, static roles leave a big operational gap during daily work. RBAC only checks the resource type and the verb before the request runs. It does not inspect what individual commands, queries, or scripts do inside an allowed session. If the sandbox role allows reading secrets or pod logs, the agent sees every field in plain text. If the role allows pod exec, RBAC cannot see or block the bash commands run inside the pod. Also, when developers switch their local shell back to production, the IDE terminal inherits that change right away. One forgotten context switch turns a safe test session into live production access.

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

Does Devin Desktop handle terminal access the same way Windsurf did?

Yes, Devin Desktop is the new name for Windsurf and keeps the same IDE features. Its agent runs commands in a local zsh or bash terminal that loads your user profile.

Can I add a deny rule in Kubernetes RBAC to block production namespaces?

No, Kubernetes RBAC rules are purely additive and do not support deny rules. You must grant rights to one sandbox namespace with a Role and RoleBinding instead.

Why is the pod exec permission risky for an AI coding agent?

The pod exec subresource lets the agent run arbitrary commands inside a running container. Once inside, the agent can read local container files or call other services on the pod network.

The query runs. The emails stay hidden.