Repository navigation
Description
Problem
The implement job runs the agent shell in the same pod and as the same user as the job that holds the GitHub session token (#2695). The owner chose two containers in one Job pod, so that the shell has no token. The job must then send each command of the agent to the shell container. This path does not exist.
The job cannot use the Kubernetes API for this path. The runner pod sets automountServiceAccountToken: false and its egress does not include the API server. A Kubernetes credential in the job adds a new credential to the zone that holds the token.
The owner accepted this order on 2026-11-05 (comment 6662676867 and the newest comment of #2695): test the sandboxd daemon of kubernetes-sigs/agent-sandbox as the command server before you write a server. If the test fails, build the small server and record the cost. Do not adopt the controller and the CRDs of that project.
Expected
A pydantic-ai WorkspaceBackend sends commands and file operations to a command server on localhost, with no Kubernetes credential. The server is sandboxd if the test passes, and a small server of this project if it fails. The change records the result of the test.
This item does not change the Job template (the next item in the split) or the implement job (the item after that).
Open points of sandboxd, not tested
Comment 6662676867 lists these points. The guide says that a co-located container "is useful only as a client of the sandboxd API (reaching it over pod-local networking)", and this is the chosen layout. Commands run in the container that hosts it, so they get the user and the image of the shell container. It has --listen-host=127.0.0.1 and --auth-token-file. It resolves each path with symlink evaluation and refuses a path outside --root-dir. Nobody ran it. Test these points:
- It may not run outside a Sandbox resource.
- The
sandboxdmodes of the Python clientk8s-agent-sandboxneed a Sandbox, and the client needsgeton Sandboxes. So the backend must call the REST API and the gRPCProcessServicedirectly. - The guide names no command allowlist. The allowlist stays on the job side.
- The time and output limits are not checked.
- The upstream example uses a staging image with the tag
latest-main, and the v1.0.9 release assets are 3 manifests. No pinned image was found, so check the source of the binary first.
Adopt sandboxd only if it runs outside a Sandbox resource, confines each path to the worktree root, and has a pinned source.
Acceptance criteria
- The
## Feasibilitysection of the proposal gives the result of each of the 5 open points, and how each was measured. - The change states one result:
sandboxdis adopted, or it is refused with the point that failed. If it is refused, the pull request states the cost of the small server (AGENTS.md rule 3). - If
sandboxdis adopted, the runner image holds it at a pinned version: a row inRUNNER_TOOLSofsrc/devops_cli/roadmap/runner_tools.py. The admission policy admits only the runner image, so a second image is not an option for this item. - The backend implements
WorkspaceBackend,SupportsCommandsandSupportsFilesystemofpydantic_ai.workspacesat the version thatpyproject.tomlpins. - The job side refuses a command whose first word is not in the allowlist. A test shows that the job returns an error and that no request gets to the server.
- The job stops a command that passes its time limit or its output limit, and it reports the limit that stopped it. A test covers each limit. When a command writes more output than the limit, the job masks the excess output.
- The server listens on
127.0.0.1only. A test shows that it refuses a request with no auth token, or the proposal gives the reason that no token is necessary. - A test shows that a path outside the worktree root is refused, also through a symbolic link.
- The tests run at the process edge: a real server process, a real socket and real commands.
- The backend holds no Kubernetes client and reads no Kubernetes credential.
Existing tool considered
sandboxdofkubernetes-sigs/agent-sandbox(https://github.com/kubernetes-sigs/agent-sandbox): SIG Apps, Apache-2.0, v1.0.9 of 2026-10-29, APIv1beta1, active. This item tests it first. The project is runtime-agnostic.- The controller and CRDs of
agent-sandbox: refused by the owner for this item. Its threat model says: "Agent Sandbox itself does not implement isolation but supports configuring these runtimes." It needs a Kubernetes credential to read the Sandbox status, and the worktree must cross pods. vstorm-co/pydantic-ai-backend(https://github.com/vstorm-co/pydantic-ai-backend): MIT, v0.2.39 of 2026-10-30. ItsKubernetesWorkspaceworks throughpods/execand "the caller needspods/execRBAC on the namespace". Itsmode="http"path is gone, so a job with no credential cannot use it. Itssandboxdis a different program, which holds a Docker socket.
Cost to build (AGENTS.md rule 3). These numbers are estimates for all 3 items of the split, from comment 6662676867. The base is the one eval run in k8s/README.md.
| Option | Build | Elapsed | Keep and fix |
|---|---|---|---|
| Two containers, own server | 20 to 30 M input tokens, 100 to 200 k output tokens | About 1 day | Our server code, and its bugs are ours |
Two containers, sandboxd |
About one third less | About 1 day | A small adapter, and a pin to update |
Related
- feat(roadmap): run the implement agent shell in a real sandbox #2695 is the parent. Comments 6511916331 (the layout), 6662676867 (the evidence) and 6667773105 (the decision) hold the reasons.
- feat(k8s): the implement job runs as a cluster Job on a runner image with uv, the dev dependencies and the pinned tools, submitted by the Service #2667 made the runner Job.
- feat(roadmap): the implement agent can use the project's development tools #3041 asks for more tools in the implement shell. The allowlist of this item is the one that exists now.
Source: #2695
Alternatives check of 2026-11-18: partly.
Tool: kubernetes-sigs/agent-sandbox (https://github.com/kubernetes-sigs/agent-sandbox), Apache-2.0, last activity 2026-11-18, maintained.
Reason: Searches found no pydantic-ai Workspaces backend that reaches a localhost command server with no Kubernetes credential; sandboxd supplies only the server side, and its run outside a Sandbox resource is untested.
Covers:
- Serves commands and file operations over pod-local localhost networking
- Binds on 127.0.0.1 and checks an auth token file
- Refuses paths outside the root directory, also through symbolic links
Lacks:
- No pydantic-ai Workspaces backend on the job side
- No command allowlist, and no time or output limits
- Unproven outside a Sandbox resource, and no pinned image
Activity
devops-cli-service commentedon Nov 5, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
It is a prerequisite for the two-container design but is not a security fix or a blocking defect.Without this backend the implement job cannot send commands to the shell container at all.It requires testing sandboxd, possibly building a server, implementing three interfaces, and writing tests for limits, auth, and path confinement.Both extend the implement shell, but the candidate builds the command transport while #3563 adds scoped review and RAG access through it.devops-cli-service commentedon Nov 8, 2026
Alternatives check: partly
Reason: The searches and the repository facts found
kubernetes-sigs/agent-sandbox, whosesandboxdis the co-located command/file server this item wants to test, andvstorm-co/pydantic-ai-backend, whose Kubernetes path needspods/execRBAC and whosemode="http"path is gone, so a tokenless job cannot use it.sandboxdcovers only the server half of the need: it gives pod-local REST and gRPCProcessServiceaccess,--root-dirpath confinement and an auth token, but it is not a pydantic-aiWorkspaceBackend, it is unverified outside a Sandbox resource, and it has no allowlist, limits or pinned image, so the backend and its controls must still be written.Tool: kubernetes-sigs/agent-sandbox (https://github.com/kubernetes-sigs/agent-sandbox)
Covers:
sandboxd) in the shell container, reachable over pod-local networking through a REST API and a gRPCProcessService.--root-dir, and offers--listen-host=127.0.0.1plus--auth-token-file.Lacks:
WorkspaceBackend,SupportsCommandsorSupportsFilesystemadapter; the item still writes that backend against the REST and gRPC APIs.k8s-agent-sandboxclient needsgeton Sandboxes, so the backend must bypass the client.latest-mainstaging tag and the v1.0.9 release assets are manifests, so a pinned source is unconfirmed.Tools considered:
Searches run:
Sources:
Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.
dan-petty commentedon Nov 20, 2026
Closed as not planned. The owner chose a sequential split for #2695 on 2026-11-20 (comment 7045868447 on #2695). That design has no command server and no
WorkspaceBackendof this project. The agent runs stockCoderonLocalWorkspacein its own container. #6527 deletes the job-side allowlist that this item would carry.The design study found these facts about
sandboxd. They stay here for a later concurrent split:registry.k8s.io/agent-sandbox/sandboxd:v1.0.11.--listen-hostis0.0.0.0. There is no auth unless--auth-token-fileor--auth-token-sha256is set.ExecuteWithLimits, with the flags--execute-{default,max}-time-limitand the stdout and stderr byte limits, gives time and output limits.--root-dirconfines the paths. There is no user switch.SSHWorkspace, in the pinnedpydantic-ai-harness0.59.0, is the stock fallback if a concurrent split is necessary later.