How to Configure Windsurf Kubernetes Read Only Access

Published
Length
4 min read

Luis Felipe Dias

All posts

To set up windsurf kubernetes read only access, bind a restricted role to the agent identity. You must limit this role so it can only view cluster state. Teams often let their coding agent use a personal admin file on their laptop. That broad setup lets an automated helper delete pods or read secret keys by mistake. A safer plan gives the agent its own identity with strict view rules. How windsurf kubernetes read only access works in native RBAC Cognition renamed Windsurf to Devin Desktop in

Auditor Read-Only Access + Kubernetes API Server Access: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

To set up windsurf kubernetes read only access, bind a restricted role to the agent identity. You must limit this role so it can only view cluster state. Teams often let their coding agent use a personal admin file on their laptop. That broad setup lets an automated helper delete pods or read secret keys by mistake. A safer plan gives the agent its own identity with strict view rules.

How windsurf kubernetes read only access works in native RBAC

Cognition renamed Windsurf to Devin Desktop in June 2026, while keeping the same IDE features. Its Cascade agent can run terminal commands on its own after a user approves. The agent runs these commands in a dedicated shell on macOS or Linux. This shell loads the local user setup, including aliases and variables. Because it shares your shell, the agent inherits your local cluster keys by default. The agent can also reach external tools through Model Context Protocol servers.

To limit what the agent can do, you use native Kubernetes role-based rules. In Kubernetes, a Role sets permissions inside one single namespace. A ClusterRole sets rules across all namespaces or for cluster-wide items like nodes. Both role types are purely additive, which means there are no deny rules. You start with zero rights and add only the safe view actions you need.

After you make a role, you link it to an identity with a binding. A RoleBinding grants those rules inside one specific namespace. A ClusterRoleBinding grants the rules across the whole cluster. Note that you can reference a ClusterRole inside a single RoleBinding. This trick lets you reuse one read definition for many single namespaces. For a coding agent, you allow read actions on pods, deployments, and services. You also include subresources like pod logs so the agent can debug crash loops.

What native RBAC solves and what stays exposed

Native roles stop the agent from changing or deleting workloads in your cluster. If the agent tries to delete a deployment, the API server blocks the call. If you leave Secrets out of the role, the agent cannot list secret objects. You can also leave out the pod exec subresource to block shell sessions inside containers. This stops a bad prompt from turning a simple check into a cluster outage.

Still, static roles only check who logs in and which resource type they call. They do not inspect what happens inside the data returned by a valid call. For example, an agent with log read rights can fetch thousands of app log lines. Those logs often hold customer emails, phone numbers, or card numbers printed by mistake. Native cluster rules send all that raw text straight into the agent prompt context. Masking tools can rewrite matched fields like emails or card numbers in those results.

Auditor Read-Only Access + Kubernetes API Server Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Also, static keys on a developer laptop stay active all day long. Because the agent loads the user shell, it can use any saved local token. If an engineer switches their local context to production, the agent follows right along. Native role bindings cannot pause a single command or ask a human for approval first. They also cannot record the exact prompt that triggered a specific cluster check.

Separating agent keys from human admin profiles

A strong setup separates the human engineer from the local coding assistant. Do not let the agent use your default admin file from your home folder. Instead, make a dedicated service identity just for the agent to use. Bind that identity to a RoleBinding in one test namespace first. Keep secret objects and pod exec rights out of the rule list.

Next, pass a dedicated config path to the agent shell or tool setup. This step ensures the agent always uses the read-only identity for its checks. Meanwhile, the human engineer keeps their own separate profile for real changes. Even with separate files, teams must still watch what data flows back in logs.

Check Kubernetes API requests and responses on the wire

Kubernetes RBAC decides who may call the API server. RBAC does not check response payloads or split listing Secret names from reading Secret values when a role grants get access. With hoop.dev, you run an open-source proxy, a sidecar for your Kubernetes API, inline on the API connection. On every kubectl or API call an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

On each call, hoop.dev guardrails read the method, normalized path, and headers to refuse bad deletes or full Secret reads with a 403 error, or hold risky calls for approval. On the way back, hoop.dev data masking walks JSON responses by key and masks matched values in Secrets, ConfigMaps, and pod logs in memory. View the project on GitHub.

Frequently asked questions

Can Kubernetes RBAC block an agent from reading secret values?

Yes, Kubernetes RBAC is purely additive and has no deny rules. If you omit Secrets from the Role, the API server blocks secret reads. Still, the agent might still see secret values if apps print them into pod logs.

How does the Windsurf agent run cluster commands on a laptop?

Windsurf, now called Devin Desktop, runs commands in a dedicated bash or zsh shell. This shell loads your normal shell setup, including saved variables and aliases. It can also use configured Model Context Protocol servers to talk to external systems.

Should I use a RoleBinding or a ClusterRoleBinding for an AI agent?

Use a RoleBinding whenever the agent only needs to check one specific namespace. A RoleBinding keeps the agent isolated even if it references a shared ClusterRole definition. Use a ClusterRoleBinding only when the agent must inspect nodes or all namespaces at once.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.