How to Configure Cline Kubernetes Audit Log
You set up a cline kubernetes audit log by turning on API server logs. Then you bind the agent to a dedicated cluster role for clear tracking. Many teams let the coding agent use a developer's local cluster profile. This shortcut makes it hard to tell human actions from agent actions. Broad roles also let the agent read or change resources across every namespace. How a cline kubernetes audit log works with native roles Cline runs terminal commands and external tools on a developer machine. Wh
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 cline kubernetes audit log by turning on API server logs. Then you bind the agent to a dedicated cluster role for clear tracking. Many teams let the coding agent use a developer's local cluster profile. This shortcut makes it hard to tell human actions from agent actions. Broad roles also let the agent read or change resources across every namespace.
How a cline kubernetes audit log works with native roles
Cline runs terminal commands and external tools on a developer machine. When the agent checks a cluster, it sends requests to the API server. The API server checks the identity and role attached to each request. In Kubernetes, a Role sets rules within a single namespace. A ClusterRole sets rules across the whole cluster or for cluster-wide items. All permission rules in the cluster are purely additive. There are no deny rules in native role bindings. A RoleBinding links the agent identity to a Role in one namespace. A ClusterRoleBinding gives the agent permissions across the whole cluster.
Every request that hits the API server can create an audit log entry. The API server writes down who sent the request and what resource they touched. Some API requests target subresources like pod logs or pod exec sessions. In role rules, these subresources use a slash, such as pods and log. If the agent shares a human key, the log shows the human name. Give the agent its own identity so the log shows its real name. Then your team can filter log files to see every API call.
Steps to separate agent traffic in cluster logs
First, create a separate cluster identity just for the coding agent. Never let the agent share a personal admin file on a laptop. Second, write a Role that only allows safe read verbs in one namespace. Avoid using a ClusterRoleBinding unless the agent truly needs cluster-wide reach. Third, bind that Role to the agent identity with a standard RoleBinding. Fourth, set your API server log rules to record events from that identity.
Check the log output to make sure the agent name appears on each line. You will see when the agent lists pods or reads pod logs. You will also see if the agent tries to run a forbidden request. The API server blocks unauthorized calls and writes the failed attempt to the log. This setup gives your security team a baseline record of API calls.
Audit Log Integrity + Kubernetes Audit Logs: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native setup solves and what it leaves open
Native roles and logs solve the basic problem of who can log in. They also show which top-level API endpoints an identity called over time. A Role can stop an agent from deleting a pod or reading secrets. The cluster log proves when an API call happened and whether it passed.
Still, native setup only checks the start of an API request. It does not inspect what happens inside an open session or data stream. When an agent gets access to pod exec, it opens a shell stream. The API log records that the exec session started on that pod. It does not reliably control every shell command run inside that container stream. Also, when the agent reads pod logs, raw output flows back to the model. Those logs often hold user emails, phone numbers, or card numbers. Native roles cannot rewrite matched fields in results before the agent reads them. They also cannot pause a single risky command inside a shared developer session.
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
Why do agent actions look like human actions in cluster logs?
The agent uses the local shell and inherits the developer's cluster key. Because both use the same key, the API server logs the same user name. Giving the agent a separate identity fixes this naming overlap in the log.
Can native roles block specific shell commands inside a pod exec session?
No, native role rules only govern the pods and exec subresource at the API level. Once the API server allows the exec request, the shell stream opens. Native roles do not filter individual commands typed inside that open shell.
Do cluster audit logs hide sensitive data in pod log responses?
No, the API server sends the full pod log stream back to the caller. If app logs contain emails or card numbers, the agent receives that raw text. You need payload filtering to rewrite sensitive fields before they reach the agent.
Related guides
In this post