How to Configure JetBrains AI Kubernetes Prevent Delete
You set up a jetbrains ai kubernetes prevent delete workflow by binding restricted RBAC roles. You must omit the delete verb from the user role that the IDE uses. Many teams let coding assistants use a developer's local cluster context directly. If that local context has broad cluster admin rights, the AI assistant inherits them. A single bad prompt can then wipe out live pods or namespaces. How to set up jetbrains ai kubernetes prevent delete with RBAC Kubernetes RBAC uses Roles and ClusterR
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 jetbrains ai kubernetes prevent delete workflow by binding restricted RBAC roles. You must omit the delete verb from the user role that the IDE uses. Many teams let coding assistants use a developer's local cluster context directly. If that local context has broad cluster admin rights, the AI assistant inherits them. A single bad prompt can then wipe out live pods or namespaces.
How to set up jetbrains ai kubernetes prevent delete with RBAC
Kubernetes RBAC uses Roles and ClusterRoles to group permission rules together. These rules are purely additive, which means Kubernetes has no deny rules. To block deletions, you must build a new role from scratch. You grant only safe verbs like get, list, watch, create, and patch. You leave the delete and deletecollection verbs out of the rule set entirely.
A standard Role sets these permissions inside a single namespace. A ClusterRole sets permissions across the whole cluster and covers cluster-scoped resources like nodes. Once you define the role, you attach it to an identity. A RoleBinding grants those permissions inside one specific namespace. A ClusterRoleBinding grants the permissions across the entire cluster.
JetBrains AI runs actions through the user's local cluster credentials. You must create a dedicated user or service account for IDE tasks. Then you bind that account to your restricted Role or ClusterRole. When the assistant tries to drop a resource, the API server checks the role. Because the delete verb is missing, the API server blocks the request.
Why static role bindings fall short for AI assistants
Native RBAC roles work well when you want a permanent block on deletions. Still, daily cluster work rarely fits into a rigid read-only or create-only box. Engineers often need to delete stuck pods during a rollout or clean up test jobs. Because RBAC has no deny rules, you cannot easily layer a temporary block over an admin role.
If a user holds a second binding with broader rights, those permissions add together. The user gets the union of both roles, and the delete permission comes right back. To keep the block active, engineers must switch contexts between a safe role and an admin role. Most developers skip this extra step and stay logged in with full rights.
AI Data Exfiltration Prevention + Kubernetes RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Static roles also lack context about what happens inside a running pod. RBAC treats pod subresources like logs and exec as separate permission targets. If you grant exec rights so the assistant can debug a container, RBAC stops checkingafter the session starts. It decides who can open the session, not what commands run inside the shell. An AI tool with exec rights can still delete files or stop processes inside the pod.
Why teams need per-command controls for IDE assistants
Relying only on static cluster roles forces a bad trade-off between safety and speed. Give the IDE too few rights, and the assistant cannot help fix broken deployments. Give it normal developer rights, and a hallucinated command can take down a service.
Safe AI operations require checking each action at the moment it runs. Teams need a way to inspect the exact command or API call in flight. Instead of switching kubeconfig files all day, developers can use their normal workflow. Read and update calls can pass through right away. Destructive actions like deleting a deployment can pause and wait for a human to approve them. Sensitive fields like emails, phone numbers, card numbers, and national IDs can also be masked in outputs, rewriting 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 runs as an open-source proxy, a sidecar for your Kubernetes API, checking requests and responses without replacing RBAC.
First, hoop.dev guardrails refuse banned methods, paths, or headers before they run. 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
Can I add a deny rule to an existing Kubernetes admin role?
No, Kubernetes RBAC permissions are purely additive and do not support deny rules. To prevent deletions, you must create a new role that leaves out the delete verb and remove any broader role bindings from that user.
Does blocking pod deletion stop JetBrains AI from breaking a running container?
No, blocking the delete verb on pods only keeps the pod object itself from being removed. If the role still grants access to the pod exec subresource, commands run inside the container can still remove app files or kill processes.
Should I use a RoleBinding or a ClusterRoleBinding for IDE access?
Use a RoleBinding when you want to limit the IDE assistant to one specific namespace. You can reference either a namespace Role or a shared ClusterRole inside that RoleBinding to keep the permissions scoped to that single namespace.
Related guides
In this post