Skip to content

Claude access

Most of the code and configuration in this project is written by Claude (Anthropic's LLM), run via Claude Code inside a dedicated devcontainer. This page describes what that access actually is: scoped and revocable, not blanket admin.

Environment

Claude runs Claude Code inside a devcontainer defined in thomelab-infra/docker/devcontainer/ and deployed via thomelab-infra/kubernetes/applications/devcontainer/. It is a separate instance from Thomas's own devcontainer (devcontainer-claude vs. devcontainer-user), each reachable at its own subdomain (claude-dev.thomelab.net / thomas-dev.thomelab.net), each gated by Keycloak SSO restricted to a devcontainer-users group.

Kubernetes

Each cluster runs a dedicated claude ServiceAccount in a claude-access namespace, deployed via ArgoCD like everything else. It is read-only, and scoped by an explicit allowlist:

  • Cluster-wide, read-only: namespaces, nodes, PersistentVolumes, StorageClasses, VolumeSnapshots, Velero backup/schedule/restore status, node and pod metrics.
  • Namespace-scoped, read-only, only in explicitly listed namespaces: pods and logs, deployments, statefulsets, daemonsets, replicasets, jobs, cronjobs, services, endpoints, configmaps, events, PVCs, ingresses, network policies, Traefik IngressRoutes/middlewares/TCP-UDP routes, ArgoCD Applications, CNPG clusters, ExternalSecret status, Longhorn volumes and backups.
  • Secrets are excluded entirely — not read, not listed.

Which namespaces are visible is a per-cluster, explicit list (RoleBinding resources in thomelab-infra/kubernetes/cluster-tools/claude-access/overlays/<cluster>/), not a default-allow policy. Adding access to a new namespace is itself a change to thomelab-infra, going through the same issue/branch/merge-request flow as everything else.

The kubeconfig is rendered by chezmoi from OpenBao, using this ServiceAccount's token. There is no admin kubeconfig in the devcontainer. The default *-tailscale contexts go through a Tailscale sidecar to Tailscale's Kubernetes-operator API-server proxy, where Claude's tailnet identity is mapped to the same read-only permissions. The plain public / thomelab contexts connect directly; for public, whose host firewall permits only port 443 by default, that path is normally closed. The devcontainer's Tailscale identity has its own auth key and state, separate from Thomas's devcontainer. Writes to the cluster (syncs, restarts, patches) are handed to Thomas as commands, or go through ArgoCD.

Git and CI

Access to each GitLab repository is a separate project access token, one per repo, with the Developer role, rather than one token with access to everything. A token scoped to thomelab-site cannot touch thomelab-infra. The tokens are created by OpenTofu, stored in OpenBao and rendered into the devcontainer by chezmoi; git remotes carry no token. Developer can push branches and open merge requests, but main is protected and only Maintainers can merge.

On GitHub, Claude uses a GitHub App installed on a hand-picked list of repositories. The devcontainer mints a one-hour installation token from the App's key when it needs one. Each of those repositories has a ruleset on its default branch: pull request with one approval, no force-push. So the App can open pull requests but can't merge its own.

Every repository's stated convention is the same: no direct commits to main (enforced by branch protection on main). Every change is a GitLab issue, a branch named after the issue, and a merge request. In practice, this means Claude opens the issue, does the work on a branch, opens the merge request, and assigns it — merging is a separate, human action.

Merge requests are assigned to Thomas, with a review request, and start with what he needs to do (merge order, an apply to run first, what to check afterwards).

Harbor (the container registry) works the same way by omission: Claude has no credentials for harbor.thomelab.net/thomelab-private, the auth-required project.

Encrypted content

ansible-vault and sops+age are real boundaries here, not just documented ones: ~/.vaultpass and the age private keys (Thomas's personal one, and the dedicated one seeded for chezmoi) are provisioned only into Thomas's own devcontainer, never Claude's. So Claude can't decrypt sops files or run an OpenTofu plan that needs them; it writes the change and Thomas runs plan/apply.

OpenBao is scoped the same way. Claude's devcontainer authenticates with its own Kubernetes-auth role, which can read a short list of exact paths (its kubeconfig, its GitLab tokens, its GitHub App key, its Nextcloud app password). The only thing it can write is the login token for its own browser terminal. New secrets are handed to Thomas as bao kv put commands.

Other services

Claude has a local Nextcloud account, claude-bot: not an SSO account, not an admin, with a small quota. It only sees what Thomas shares with it: the homelab backlog (a Deck board), the homelab notebook (a Collective) and the calendars he chooses.

Destructive operations

Force-pushes, git reset --hard, --no-verify, and similar are not run without asking first. On a branch, this is a session-level operating instruction rather than a platform-enforced control — unlike the Kubernetes RBAC and per-repo token scoping above, nothing currently prevents it there at the infrastructure level. main is the exception: branch protection (see above) blocks a force-push regardless of what Claude does.