Cluster-admin is the default that quietly wins. An engineer grants an AI agent cluster-admin to get it unstuck during setup, the agent starts working, and nobody walks the permission back. Now an agent that only ever needs to read logs in one namespace can delete any resource in the cluster. Least-privilege access is the discipline of refusing that default. For AI agents on EKS it means the agent's reach is mapped to exactly its job and no further.
Least-privilege access for AI agents on EKS is a blast-radius problem. The smaller the grant, the less an error or a compromise can do, and an agent acting at machine speed makes both an error and a compromise more likely to matter.
Two layers have to agree
EKS access runs through two permission layers: AWS IAM and Kubernetes RBAC. An agent reaching the cluster is governed by the IAM identity used to authenticate and by the RBAC role that identity maps to. Least-privilege access means both layers are narrow and they agree. A tight IAM role mapped to a broad RBAC role still gives the agent the broad role's power, and a tight RBAC role behind an over-broad IAM identity leaves room for trouble elsewhere. The effective permission is the looser of the two, so both have to be deliberate.
How hoop.dev keeps the least-privilege access grant narrow
hoop.dev is an open-source Layer 7 access gateway. Its kubernetes-eks connector proxies kubectl and exec to the cluster through a network-resident agent that assumes a configured IAM role, the EKS_ROLE_ARN, as its service identity. You set that role's BINDING_USER_ROLE to a specific Kubernetes RBAC role, so the connection can do only what that RBAC role permits. The AI agent reaches the cluster only through this connection, so its ceiling is the RBAC role you chose, not whatever the agent might otherwise hold.
Scoping steps
- Define a Kubernetes RBAC role with the minimal verbs and resources the agent needs, for example
getandliston pods and logs in one namespace. - Create an IAM role for the connection and map it to that RBAC role through aws-auth and the binding user role.
- Configure the EKS connection in hoop.dev with the cluster URL, region, cluster name, and the role ARN.
- Grant the agent only this connection, not a broader one.
- Verify with
kubectl auth can-i delete podsthrough the gateway and confirm it returnsno.
# RBAC role the connection maps to
rules:
- apiGroups: [""]
resources: ["pods", "pods/log"]
verbs: ["get", "list"] # no delete, no exec, one namespaceThe can-i check is the proof. If the agent cannot delete a pod through the gateway, the narrow RBAC role is doing its job, and no amount of clever prompting or compromised logic gives the agent a verb the role does not grant.
