Opencode Helm Chart

Published
Length
3 min read

Luis Felipe Dias

All posts

You deploy the opencode helm chart by defining a values file and running Helm install. This setup runs an AI coding agent inside your Kubernetes cluster. Teams often start by giving the agent a broad cluster role to speed up testing. When roles have too much power, one bad prompt can delete production resources. Running an AI agent in a cluster brings new risks to your team. The agent can run shell commands, read files, and talk to the cluster API. If you do not lock down its role, it can read

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 deploy the opencode helm chart by defining a values file and running Helm install. This setup runs an AI coding agent inside your Kubernetes cluster. Teams often start by giving the agent a broad cluster role to speed up testing. When roles have too much power, one bad prompt can delete production resources.

Running an AI agent in a cluster brings new risks to your team. The agent can run shell commands, read files, and talk to the cluster API. If you do not lock down its role, it can read secret keys across namespaces. A safe rollout needs tight limits on both the pod and the database.

How the opencode helm chart works in Kubernetes

The opencode helm chart bundles the agent image, a service account, and storage volumes. When you install the chart, Kubernetes creates a pod that runs the agent loop. The chart also sets up secrets to hold your model API keys. You pass these keys into the pod through standard secret mounts.

Inside the cluster, the pod uses its service account to talk to other services. You can map this service account to a specific Kubernetes role. That role tells the cluster API which pods or logs the agent can read. Teams also mount persistent volumes so the agent can save code files during a task.

Network rules in the chart control where the pod can send traffic. The agent needs outbound paths to reach external model APIs and git hosts. Many teams also let the pod reach internal databases to test code changes. Each network path you open expands what the agent can touch during a run.

What native chart roles solve and what they miss

Native Kubernetes roles do a good job of controlling who starts a session. Role bindings stop the pod from touching namespaces outside its scope. Pod security standards also block the container from taking over the host node. These native tools form a solid base for your cluster setup.

Still, chart roles only check who logs in when the pod starts. They do not inspect the actual SQL queries or shell commands in flight. Once the agent has a database key, it can run any query that role allows. A native chart cannot stop the agent from dropping a table by mistake.

Helm Chart Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Static secrets in the chart create another big gap for security teams. If the pod mounts a raw database key, the agent can read that file. A bad prompt could trick the agent into printing that key in its output. Chart values also cannot mask emails, phone numbers, or card numbers in query results.

Securing agent workloads beyond cluster roles

To run coding agents safely, teams must look past pod startup settings. You need controls that check every command and query the agent sends. Instead of giving the pod full database write rights, require human approval for risky actions. This step stops an automated loop from breaking live data.

Teams should also rewrite sensitive fields before data reaches the agent context window. When the agent queries a table, masking rules should replace card numbers and national IDs. This keeps real user data out of external model logs while keeping schemas intact. Pairing tight chart roles with runtime checks gives you a safe agent setup.

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 HTTP proxy, a sidecar for your Kubernetes API. The kubectl client changes only the server address it talks to while RBAC stays in place.

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. On the way back, hoop.dev data masking walks JSON responses by key and masks matched values in Secrets, ConfigMaps, and pod logs. Every request and verdict is logged without storing bearer tokens. View the project on GitHub.

Frequently asked questions

How should we manage model API keys in the chart?

Store your model API keys in an external secret store instead of plain values files. Mount them into the pod at runtime or inject them outside the container.

Should the opencode pod have cluster-admin rights?

No, never give an AI agent cluster-admin rights in your cluster. Scope the service account role to a single namespace with read-only permissions where possible.

How do we stop the agent from reading sensitive user data?

Native Helm charts cannot filter database rows or columns on their own. You must apply data masking in front of the database to rewrite emails and phone numbers.

The query runs. The emails stay hidden.