How to Configure Devin Kubernetes Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up devin kubernetes permissions by assigning a narrow role to its account. Then you bind that role to one namespace so the agent only touches allowed resources. Many teams start by giving their autonomous coding agent wide cluster admin rights to move fast. Broad rights let a single bad command delete workloads, read secret keys, or change live services. Scoping the agent down to exact verbs and objects stops big mistakes before they happen. How native devin kubernetes permissions work

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 devin kubernetes permissions by assigning a narrow role to its account. Then you bind that role to one namespace so the agent only touches allowed resources. Many teams start by giving their autonomous coding agent wide cluster admin rights to move fast. Broad rights let a single bad command delete workloads, read secret keys, or change live services. Scoping the agent down to exact verbs and objects stops big mistakes before they happen.

How native devin kubernetes permissions work

Kubernetes uses Role-Based Access Control to check every request that hits the API server. In this system, rules are always additive, and there are no deny rules at all. You start with zero access and add exact verbs like get, list, watch, or create. A Role sets these rules inside a single namespace for local work. A ClusterRole sets rules across the whole cluster for nodes or all namespaces at once.

To connect the agent to those rules, you create a binding object in the cluster. A RoleBinding links a Role or ClusterRole to the agent within one specific namespace. A ClusterRoleBinding grants those rights across every namespace in the entire cluster. For an autonomous agent, teams should prefer a RoleBinding scoped to a test or staging namespace. This keeps the agent away from core system pods and other team projects.

Kubernetes also splits some actions into subresources that match the API URL path. Reading pod output uses the pods and log subresource rather than the base pod object. Running a shell command inside a container requires permission on the pods and exec subresource. If you grant pod read rights without the exec rule, the agent cannot run shell commands. You must list each subresource by name in your role rules when the agent needs it.

Why static role bindings fall short for autonomous agents

Native roles and bindings do a good job of deciding who can call an API endpoint. They stop an agent from touching namespaces or resource types outside its assigned role. If the agent only has read rights on pods, it cannot delete a deployment. This static boundary is a solid first step for any team running automated tools.

Still, static roles cannot inspect what happens inside an allowed action while it runs. Once you grant the pods and exec subresource, the agent can run any command inside that container. Native RBAC cannot tell a safe diagnostic check apart from a destructive shell command. In the same way, pod log output might hold raw emails, phone numbers, or card numbers. Native cluster rules hand that raw text straight to the agent without rewriting sensitive fields. Teams also struggle to approve single risky commands without changing role bindings back and forth.

Kubernetes RBAC + AI Agent Permissions: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Scoping subresources and secrets for safer agent runs

When you build a role for an AI agent, start with read-only rules on core objects. Give the agent get, list, and watch verbs on pods, services, and deployments in one namespace. Leave out secrets from the role rules so the agent does not pull stored keys. If the agent needs to check app output, add the pods and log subresource by itself.

Keep the pods and exec subresource out of the baseline role for day-to-day work. Opening an interactive shell inside a pod gives the agent full reach over that container. Also avoid using ClusterRoleBinding for an agent unless it must inspect cluster-wide node health. Keeping rules inside one namespace limits the blast radius when the agent tries an unexpected fix.

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 runs beside the API server as a sidecar for your Kubernetes API and checks every request and response alongside RBAC.

With hoop.dev Kubernetes controls, guardrails can allow listing Secret names while refusing reads of Secret data before execution. 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

Should I give Devin a Role or a ClusterRole in Kubernetes?

Use a Role with a RoleBinding so the agent stays inside one single namespace. You can also bind a shared ClusterRole with a RoleBinding to limit it to one namespace. Avoid ClusterRoleBinding unless the agent must read cluster-wide objects like nodes.

How do I let Devin read pod logs without letting it run shell commands?

Grant the get verb on the pods and log subresource in your role rules. Do not include the pods and exec subresource in that same role. This lets the agent read container output while blocking interactive shell sessions.

Can Kubernetes RBAC block specific shell commands inside a pod exec session?

No, native RBAC only checks if the account can open the exec subresource on a pod. Once the session starts, Kubernetes does not filter or block individual shell commands inside the container. You need runtime controls outside native RBAC to inspect or approve commands in flight.

The query runs. The emails stay hidden.