Repository navigation
Description
Summary
Keep the App key out of each container that runs the agent. One runner Job pod runs three containers, one after the other: prepare, agent and publish. The owner chose this design on 2026-11-20 (comment 7045868447). It replaces the design of 2026-11-05 (comments 6662676867 and 6667773105).
This item is the parent. The split items hold the work. The section Split gives their order.
Problem
- The App key and the agent share one pod and one process tree. The runner Job (
k8s/devops/cronjob-runner.yaml) has one container. It loads the App private key and the model key (fix(k8s): load only the needed Secret keys in runner Jobs #6518). The implement Job and the fix-checks Job run the agent shell in that container. The shell runs as the same user as the job code that mints App tokens. - The boundary is a set of guards in the job code.
OriginGitruns each git call that holds the token in an isolated git folder.check_settingsreads the git settings of the clone (src/devops_cli/roadmap/implement/git_isolation.py).end_leftover_processesends the processes that a step leaves.deny_environment_readsstops a child from reading/proc/1/environ. Each code path that holds a key must call each guard. The fix-checks Job did not calldeny_environment_readsuntil fix(roadmap): harden the fix-checks Job process as implement does #6540 (advisory GHSA-jvhh-jjjr-5mxf, release 0.183.2). - The stage Job pushes with plain git from the agent tree (
_pushinsrc/devops_cli/roadmap/stage/stage.py). This is safe only while stage has no shell. refactor(roadmap): run stage on Coder in the runner image #6528 gives stage a shell. - The
workflowschain. Each runner token asks forworkflows: write(CONST_GITHUB_APP_TOKEN_PERMISSIONS, fix(roadmap): the App token can push a workflow file #3519). So a pushed branch can add or change a workflow that runs onpush, before a person reads it. The release key is only in the environmentrelease, which allows onlymain, so a branch workflow cannot read that key.
Design
Use a sequential split in one Job pod (option A).
| Container | Kind | Secret key | What it does |
|---|---|---|---|
prepare |
init container 1 | App private key | It reads the item and the plan, does the claim and the status, and makes an anonymous clone. It records the base SHA and the item state in a folder that the agent does not mount. It runs only git and GitHub API calls. |
agent |
init container 2 | model key only | It runs stock Coder on LocalWorkspace with its shell (#6527). It writes a patch, a summary and an outcome to a shared emptyDir. It makes no GitHub call. |
publish |
app container | App private key | It starts only after the agent container exits. It reads the patch as data and applies it to a new bare clone at the recorded base. It writes its own commit, mints a narrowed token, pushes and opens a draft PR. |
The reasons:
- Kubernetes runs the init containers one after the other, each to completion, before the app container starts. When PID 1 of the agent container exits, the kernel ends each process that the agent left. So no agent process is alive while a container holds the App key.
- It fits stock
Coder. It needs no command server, noWorkspaceBackendof this project and no file import. - Comparable products give the output of the agent as data to a step that holds the credential. Examples are the safe outputs of GitHub Agentic Workflows, Codex cloud and the Copilot cloud agent.
- The fix-checks Job and the stage Job (refactor(roadmap): run stage on Coder in the runner image #6528) use the same template and the same
publishstep.
Decided rules:
workflows: write.publishasks for it only when the merged plan of the item names a workflow file.preparereads the plan frommain, where the agent cannot change it.- Model key. Runner Jobs keep the current model key for now. The agent container holds it, and
deny_environment_readsstays in the agent phase. This key is the gateway master key, so it stays a known risk.
Options compared
| Criterion | A: sequential split (chosen) | B: command server (design of 2026-11-05) | C: separate publish Job, or the Service publishes |
|---|---|---|---|
| App key next to a live agent process | Never | Yes, in the job container for the full run | Never with a separate Job. If the Service publishes, its process with the most rights parses agent data. |
| Race on shared files | None. No agent process is alive when publish reads. |
Yes. The file import runs while shell processes are alive. | None |
| Custom code | Phase flag, publish step, policy rules. Implement loses code. |
sandboxd adapter, a WorkspaceBackend, file import, policy |
The code of A, plus a transport between Jobs and its cleanup |
Fit with stock Coder |
Exact | A custom backend. #6527 deletes the allowlist that B carries. | Exact |
Requirements that no longer apply
These requirements of the design of 2026-11-05 do not apply now:
- the job-side command allowlist
- the command time and output limits
- the
WorkspaceBackendrouting - the file import
runAsUser: 1001- the wait for feat(k8s): measure runsc against runc for RuntimeClass gvisor #5434
Split
Do the split items in this order. Each item is one pull request.
- feat(roadmap): run implement and fix-checks as prepare/agent/publish phases #3702: run implement and fix-checks as the phases
prepare,agentandpublish.--phase allkeeps the current one-container template working. - feat(roadmap): add the three-container runner Job, policy and log reads #3700: the three-container runner template, the admission policy and the Job readers of the Service. It is blocked by feat(roadmap): run implement and fix-checks as prepare/agent/publish phases #3702 and by the runner image release that holds feat(roadmap): run implement and fix-checks as prepare/agent/publish phases #3702.
#3694 (the sandboxd command server) is closed as not planned. #5431 and #5434 (the gVisor RuntimeClass and its measurement) are done.
Each blocker that the critic of the design study found is an acceptance criterion of one split item:
| Blocker | Item |
|---|---|
prepare runs no code from the tree. |
#3702 |
deny_environment_reads runs first in each phase. |
#3702 |
The base of a Staged item is on GitHub before publish fetches it. |
#3702 |
The agent phase writes the PR body text, and publish checks it. |
#3702 |
publish refuses a new or changed symlink or gitlink. |
#3702 |
| The Service reads the Job log and the container status by container name. | #3700 |
Each per-container policy rule also checks the init containers, and the policy refuses a container-level restartPolicy. |
#3700 |
Acceptance criteria
- feat(roadmap): run implement and fix-checks as prepare/agent/publish phases #3702 and feat(roadmap): add the three-container runner Job, policy and log reads #3700 are merged and released.
- A live implement Job and a live fix-checks Job run the three phases. No container holds the App key while an agent process is alive.
Key questions
- Where the implement Job ends. In the split,
publishends the implement Job at "draft PR opened". The Service watch row then marks the PR ready and starts the fix-checks Jobs. The WIP pushes and the in-Job loop that watches, fixes and marks ready can then go. An OOM kill or a deadline kill of the agent container then loses the work of that run. The implement grade must follow the PR across the fix-checks Jobs, and some check classes lose their repair. feat(roadmap): add the three-container runner Job, policy and log reads #3700 makes the split live, so feat(roadmap): add the three-container runner Job, policy and log reads #3700 needs this answer before it merges. Do you accept that the implement Job ends at "draft PR opened"? - One approval on App PRs. The ruleset of
mainneeds no approval, and auto-merge is on. So a token with contents and pull-request write can merge a PR after the checks pass. Only the owner changes this repository setting. Do you want to require one approval on the PRs that the App opens? - gVisor as a later layer. The split keeps the App key away from the agent without gVisor. feat(k8s): a gVisor RuntimeClass for pods that run untrusted code #5431 added the RuntimeClass
gvisor, and feat(k8s): measure runsc against runc for RuntimeClass gvisor #5434 measured it. Can this work ship without gVisor, and a later item addruntimeClassName: gvisorto the whole runner pod?
Cost
This is an estimate, not a measurement. The critic of the design study gives these values for the full work:
- about 2-3k changed lines
- 25-40 M input tokens and 150-300 k output tokens
- 2.5-4 days
The first estimate of the study was 0.9-1.2k lines and 13-22 M input tokens. That estimate did not include these parts:
- the Service readers
- the state between the phases
- the reads from git objects in
publish - the Staged base
- the policy rules for the init containers
- the grade change
Existing tool considered
- Kubernetes init containers give the order and a Secret per container.
- Git plumbing applies the patch:
read-tree,apply --cached,write-treeandcommit-tree. - Stock
CoderandLocalWorkspaceofpydantic-ai-harnessrun the agent, as the gh-aw engine of pydantic does (https://pydantic.dev/docs/ai/harness/gh-aw/). - The harness
SSHWorkspaceis the stock fallback if a concurrent split is necessary later. - The harness
KubernetesSandboxneeds the agent-sandbox controller and the right to create SandboxClaims. A runner Job gets no write RBAC, so it does not apply.
Related
- refactor(roadmap): re-architect stage and implement on Coder #6519 is the tracker (experiment 1, step 3).
- refactor(roadmap): run implement on stock Coder with a real shell #6527 runs implement on stock
Coderwith a real shell. The unrestricted shell needs this split first. - refactor(roadmap): run stage on Coder in the runner image #6528 runs stage on
Coderin the runner image. Stage must push through the samepublishstep. - build(runner): bootstrap the dev env with uv in each Job #6517 and PR feat(roadmap): bootstrap the dev env with uv in each Job #6537 bootstrap the dev environment with uv in each Job.
- fix(k8s): load only the needed Secret keys in runner Jobs #6518 and PR fix(k8s): load only the needed Secret keys in runner Jobs #6520 load only the needed Secret keys in runner Jobs.
- fix(roadmap): harden the fix-checks Job process as implement does #6539 and PR fix(roadmap): harden the fix-checks Job process as implement does #6540 added
deny_environment_readsto the fix-checks Job.
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-17, maintained.
Reason: Search results led to kubernetes-sigs/agent-sandbox, whose sandboxd daemon serves commands in a co-located container with root-dir path confinement, so it covers the command server only, not the allowlist, limits, import or Job template.
Covers:
- Command server for a co-located container over pod-local localhost
- Commands run with the shell container's user and image
- Path confinement to a root directory with symlink evaluation
- Serves the split item's first step: test sandboxd before writing a server
Lacks:
- No pinned image; upstream example uses a latest-main tag
- No first-word command allowlist at the process edge
- No command time or output limits
- Unconfirmed whether it runs outside a Sandbox resource
- No artifact import, Job template, admission policy or job-side git hardening
Proposed design
Problem statement
The implement job runs the agent shell in the same pod and user as the GitHub token. The shell can write a git hook, a .git/config value or a changed uv.lock that a later git or uv process runs with the token. The change runs the shell in a second container with no token, under a gVisor RuntimeClass. The job imports the shell files as untrusted input. The job also hardens its own git and uv calls. The work waits on #5431 and #5434 before the runner Job uses the gVisor RuntimeClass.
Acceptance criteria
Requirement: Shell container isolation
The implement Job MUST run the agent shell in a second container as user 1001 with its own worktree and no token.
Scenario: Shell container has no token
- WHEN The shell container starts.
- THEN Its environment has no GitHub token, no DEVOPS_CLI_SERVICE_GITHUB_APP_PRIVATE_KEY and no DEVOPS_CLI_AI_API_KEY. It has no Secret envFrom. Its security context sets runAsUser 1001, readOnlyRootFilesystem true, allowPrivilegeEscalation false, seccompProfile RuntimeDefault and capabilities drop ALL. The shell worktree is a directory on the shared emptyDir volume.
Requirement: gVisor RuntimeClass
The runner Job MUST set runtimeClassName gvisor after #5434 measures runsc as usable on the runner image.
Scenario: Runner Job uses gVisor
- WHEN The runner Job spec is rendered and feat(k8s): measure runsc against runc for RuntimeClass gvisor #5434 reports runsc as usable.
- THEN The Job sets runtimeClassName gvisor. The Job still sets the two-container layout and the shared home emptyDir.
Requirement: Job-side command allowlist
The job MUST reject a shell command whose first word is not in the allowlist.
Scenario: Disallowed command rejected
- WHEN The agent requests a command whose first word is not in the allowlist.
- THEN The job returns an error. It sends no command to the shell container.
Requirement: Command time and output limits
The job MUST stop a shell command that exceeds its time limit or its output limit.
Scenario: Output limit stops command
- WHEN A shell command writes more output than the output limit.
- THEN The job stops the command. It masks the excess output. It reports the output limit as the reason.
Requirement: Artifact import security
The job MUST import the shell worktree as untrusted files and skip .git, symbolic links and out-of-path files.
Scenario: Symbolic link refused
- WHEN The shell worktree contains a symbolic link.
- THEN The import step rejects the file. It does not follow the link.
Requirement: WorkspaceBackend routing
The implement job MUST run agent shell commands through a pydantic-ai WorkspaceBackend.
Scenario: Step command routed to shell container
- WHEN An agent step issues a shell command.
- THEN The command server in the shell container receives the command. The job container does not run it.
Requirement: Job git isolation
The job MUST run its own git with core.hooksPath=/dev/null, MUST ignore the shell worktree's git settings and MUST run uv with --no-config.
Scenario: Hook not executed
- WHEN The shell container writes a git hook into the shell worktree.
- THEN The job's git does not run that hook.
Requirement: Admission policy permits the shell container and gVisor
The Service admission policy SHALL permit a runner Job with the job container, the shell container, the worktree directory on the shared home emptyDir and runtimeClassName gvisor.
Scenario: Two-container Job with gVisor admitted
- WHEN A runner Job with the job container, the shell container, the worktree directory on the home emptyDir and runtimeClassName gvisor is submitted.
- THEN The policy admits it. The policy still rejects a Job with an unpinned image. The policy still rejects a shell container with a Secret envFrom. The policy still rejects a runtimeClassName other than gvisor.
Existing Tool Considered
vstorm-co/pydantic-ai-backend (MIT, maintained, https://github.com/vstorm-co/pydantic-ai-backend) covers the pydantic-ai WorkspaceBackend and a Kubernetes-pod-backed workspace. It lacks the two-container single-Job-pod layout. It lacks the artifact import. It lacks a way to attach the sandbox without a cluster credential. It does not state that the first-word allowlist and the time and output limits hold at the process edge. It lacks the job-side git hardening. The item keeps only the WorkspaceBackend interface. The gVisor RuntimeClass is a cluster feature, not a library. The fallback builds a command server, a WorkspaceBackend adapter, a two-container Job template and an artifact import. The written cost is about 20 to 30 M input tokens, 100 to 200 k output tokens, and about one day. The upkeep is a small adapter and a version pin. With sandboxd the build is about one third less.
Key questions
- Which sandbox approach separates the agent shell from the job's token?: Use two containers in one Job pod. Run the pod under the gVisor RuntimeClass that feat(k8s): measure runsc against runc for RuntimeClass gvisor #5434 measures. The shell container runs as user 1001. It has no token and no Secret envFrom. It sets readOnlyRootFilesystem true, allowPrivilegeEscalation false, seccompProfile RuntimeDefault and capabilities drop ALL. The containers share one emptyDir volume. The shell works in its own directory. The job keeps its own checkout in another directory. The job imports the shell files. The job runs git and uv only in its own checkout. The owner decided on 2026-11-13 to proceed with gVisor. That decision replaces the rejection of 2026-11-05. (best practice) [sources: k8s/devops/cronjob-runner.yaml:33, k8s/devops/cronjob-runner.yaml:36, k8s/devops/cronjob-runner.yaml:39, k8s/devops/cronjob-runner.yaml:47, k8s/devops/cronjob-runner.yaml:48, k8s/devops/cronjob-runner.yaml:50, k8s/devops/roadmap-service/admissionpolicy.yaml:41, docs/CLUSTER.md:65, openspec/specs/roadmap-implement-runner/spec.md:4]
- Chosen: Two containers in one Job pod under gVisor RuntimeClass. A different user in a different container is a real boundary for the token. gVisor adds host-kernel isolation. Pod Security restricted allows it. It needs the RuntimeClass from feat(k8s): a gVisor RuntimeClass for pods that run untrusted code #5431 and the feat(k8s): measure runsc against runc for RuntimeClass gvisor #5434 measurement.
- Rejected: gVisor alone without a second container. It isolates the pod from the host kernel. It does not separate the shell from the token in the same user and filesystem.
- Rejected: One Job per step with a read-write worktree volume. A pod start for each step costs seconds and an image pull check for each step. It still needs the artifact import.
- Rejected: User namespace with bubblewrap or unshare. The default seccomp profile refuses CLONE_NEWUSER without CAP_SYS_ADMIN. Pod Security restricted forbids seccomp=unconfined.
- How does the job communicate with the shell container?: The shell container exposes a command server on localhost. The job reaches it through a pydantic-ai WorkspaceBackend. The backend implements SupportsCommands and SupportsFilesystem. The job enforces the first-word allowlist before it sends a command. The job enforces the time and output limits around the call. The job holds no Kubernetes API credential. (best practice) [sources: src/devops_cli/roadmap/implement/implement_step.py:571, src/devops_cli/roadmap/implement/implement_step.py:576, k8s/devops/cronjob-runner.yaml:33, docs/CLUSTER.md:65, tests/roadmap/implement/test_roadmap_implement_shell_policy.py:15]
- Chosen: Localhost command server behind a pydantic-ai WorkspaceBackend. It reuses the pydantic-ai agent interface. It keeps the Kubernetes credential out of the job.
- Rejected: Direct exec into the shell container through the Kubernetes API. It requires a Kubernetes token in the job. That adds a new credential to the token-holding trust zone.
- Rejected: pydantic-ai-backend KubernetesWorkspace. It uses pods/exec and needs pods/exec RBAC on the namespace. The runner pod sets automountServiceAccountToken false and has no API-server egress.
- Should kubernetes-sigs/agent-sandbox be adopted for this item?: Do not adopt its controller and CRDs. Keep the two-container layout under gVisor. The runner pod mounts no Kubernetes token. The admission policy admits only the volumes tmp, home and config. A controller that reads Sandbox status does not fit. A worktree that crosses pods does not fit. In the first split item, test the sandboxd daemon as the command server. Do this before you write a server. Adopt sandboxd only if it runs outside a Sandbox resource. It must confine each path to the worktree root. It must have a pinned image. Keep the first-word allowlist on the job side. Enforce the time and output limits around the call. (best practice) [sources: AGENTS.md:11, k8s/devops/cronjob-runner.yaml:33, k8s/devops/roadmap-service/admissionpolicy.yaml:80, openspec/specs/roadmap-implement-runner/spec.md:4, docs/CLUSTER.md:65]
- Chosen: Test sandboxd first and keep the two-container layout under gVisor. AGENTS.md:11 requires an open tool before the project builds its own. The test is bounded. The allowlist and limits stay on the job side. The daemon is not adopted until it runs outside a Sandbox resource with a pinned image.
- Rejected: Adopt the agent-sandbox controller and CRDs. The controller adds no isolation by itself. It needs a Kubernetes credential, which the runner pod does not hold. The worktree would cross pods.
- Rejected: Write the small server without testing sandboxd. An open, maintained tool may cover the command path. The project should test it before it builds and keeps its own server.
- How does the job import the shell work without trusting it?: The job copies the working files from the shell directory into its own checkout. The checkout is on the shared volume. It skips .git. It resolves each path through safe_resolve_subpath against the shell worktree root with allow_symlinks=False. A symbolic link, a .. escape or an absolute path outside the root is refused. It refuses files outside the group's paths. It then runs its checks, commits and pushes from its own tree. The job never imports the shell's .git. (best practice) [sources: src/devops_cli/core/paths.py:35, src/devops_cli/core/paths.py:81, src/devops_cli/core/paths.py:87, ARCHITECTURE.md:218, SECURITY.md:32, src/devops_cli/roadmap/implement/implement_strays.py:1, src/devops_cli/roadmap/implement/git_isolation.py:1]
- Chosen: Copy working files, skip .git, refuse symlinks and out-of-path files through safe_resolve_subpath. The job owns the repository metadata. It never reads a git setting that the shell wrote. The existing helper refuses a symbolic link and a .. escape from the root.
- Rejected: Share the full worktree including .git. The shell could write hooks or config that the job's git would run with the token. This is the attack the sandbox prevents.
- Rejected: Copy the tree with shutil.copytree and follow symbolic links. A symbolic link to a file outside the shell worktree would be copied as its target. The job would import a file the shell did not create. safe_resolve_subpath refuses the link instead.
- Is the cheap step (core.hooksPath=/dev/null, uv --no-config) a sufficient fix?: No. It mitigates the hook and config attack vector. It does not separate the shell from the token. The shell still runs as the same user. It can read the token from /proc or the environment. Use the two-container sandbox under gVisor. Keep the cheap step as defense in depth. (best practice) [sources: k8s/devops/cronjob-runner.yaml:4, src/devops_cli/roadmap/implement/git_isolation.py:5, src/devops_cli/config/constants.py:1211, src/devops_cli/commands/install_tools.py:288, k8s/devops/cronjob-runner.yaml:52]
- Chosen: Two-container sandbox under gVisor plus the cheap step as hardening. It separates the shell from the token by user, filesystem and process tree. gVisor adds host-kernel isolation. The cheap step protects the job's own git and uv calls.
- Rejected: Cheap step only. The shell still shares the user and filesystem with the token-holding process. It can read the token from /proc or the environment.
- Does the Service admission policy allow a two-container runner Job with the gVisor RuntimeClass?: No. The policy refuses a Job of the Service with more than one container. It refuses an init container. It refuses other volumes. It does not admit the gVisor RuntimeClass. The second split item must change k8s/devops/roadmap-service/admissionpolicy.yaml. The new policy must permit the shell container and the worktree directory on the shared home emptyDir. It must permit runtimeClassName gvisor. It must still pin the image, account, secrets, volumes and host. It must refuse a shell container with a Secret envFrom or valueFrom. (best practice) [sources: k8s/devops/roadmap-service/admissionpolicy.yaml:41, k8s/devops/roadmap-service/admissionpolicy.yaml:42, k8s/devops/roadmap-service/admissionpolicy.yaml:65, k8s/devops/roadmap-service/admissionpolicy.yaml:73, k8s/devops/roadmap-service/admissionpolicy.yaml:80, k8s/devops/roadmap-service/admissionpolicy.yaml:81]
- Chosen: Change the policy to permit the two-container Job and runtimeClassName gvisor. The policy must admit the chosen layout. It must still pin the image, account, secrets, volumes and host. It must refuse a shell container with a Secret envFrom or valueFrom.
- Rejected: Keep the policy and use one container. One container cannot separate the shell from the token.
- Rejected: Use a separate Job per step. It adds pod start cost and still needs the artifact import.
- Does vstorm-co/pydantic-ai-backend cover the chosen two-container layout without a cluster credential?: No. Its KubernetesWorkspace runs commands through pods/exec. It needs pods/exec RBAC on the namespace. The runner pod sets automountServiceAccountToken false. It has no API-server egress. The package has no artifact import. It has no job-side git hardening. It is partly useful for the WorkspaceBackend interface. It does not cover the chosen transport. Keep the item with this reason. (best practice) [sources: k8s/devops/cronjob-runner.yaml:33, docs/CLUSTER.md:65]
- Chosen: Keep the item and use only the WorkspaceBackend interface. The package covers the pydantic-ai WorkspaceBackend. It does not cover the chosen transport, the artifact import or the job-side hardening.
- Rejected: Adopt KubernetesWorkspace. It needs a cluster credential and pods/exec RBAC. The runner pod has no Kubernetes token and no API-server egress.
- Does the item fit in one pull request?: No. Split the item into three sequential items. Each item fits one pull request. The first item evaluates sandboxd and adds the command server and the WorkspaceBackend adapter. The second item adds the two-container Job template under the gVisor RuntimeClass, the artifact import and the admission policy change. The third item routes the implement steps through the backend. It also updates the guarantee text. (best practice) [sources: CONTEXT.md:36, AGENTS.md:9]
- Chosen: Split into three sequential items. The command server, the Job template and the job integration are each substantial changes. The dependency chain keeps each pull request reviewable.
- Rejected: Deliver as one large pull request. The change is too large for one pull request. It mixes process-edge code, Kubernetes policy and job integration.
- Should the runner Job send HTTPS through an SNI allowlist proxy in this item?: No. Do not add the egress proxy to this item. File it as a separate issue with its own host list and acceptance criteria. The item's boundary is the two-container shell isolation under gVisor. The egress change affects every runner Job. It also needs the owner's acceptance, which feat(roadmap): track the shared command gate #5199 has not recorded. (best practice) [sources: k8s/devops/networkpolicy.yaml:56, k8s/devops/networkpolicy.yaml:60, k8s/devops/networkpolicy.yaml:71, docs/CLUSTER.md:65, CONTEXT.md:36, AGENTS.md:9]
- Chosen: Defer the egress proxy to its own issue. It changes the network of every runner Job. It needs its own host list and acceptance criteria. The item already splits into three pull requests. The owner has not accepted the egress part in feat(roadmap): track the shared command gate #5199.
- Rejected: Add the egress proxy to this item. It mixes a cluster-wide network change with the shell isolation. A missing host makes a Job fail until the list gets that host. It has no acceptance in this item.
Fit
Needs splitting into 3 items:
- feat(roadmap): test sandboxd and add the shell command backend #3694: test sandboxd as the command server, and add the shell command backend.
- feat(roadmap): add the three-container runner Job, policy and log reads #3700: add the two-container runner Job under the gVisor RuntimeClass, the user and volume layout, the file import, and the admission policy change. Blocked by feat(roadmap): test sandboxd and add the shell command backend #3694 and feat(k8s): measure runsc against runc for RuntimeClass gvisor #5434.
- feat(roadmap): run implement and fix-checks as prepare/agent/publish phases #3702: route the implement steps through the shell backend, and update the guarantee text. Blocked by feat(roadmap): add the three-container runner Job, policy and log reads #3700.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 29, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The candidate isolates the agent shell from the token to prevent credential leakage to child processes.The token is scoped to one repository and lasts one hour, so the risk is real but bounded.It removes a token-leakage path to git hooks and uv, but the blast radius is already small.Three candidate designs need measurement and cluster support, plus a cheaper mitigation step.Both concern the implement runner Job, but #2667 creates the Job infrastructure and the candidate adds a sandbox boundary for the agent shell inside it.feat(roadmap): run the implement job as a cluster Job (#2698)
dan-petty commentedon Oct 30, 2026
Decision for this item, 2026-10-30, with the evidence from #2667 and the code on
main.The cheap step is not a fix. The job and the agent shell run as one user in one pod. Any file that the job's
gitreads (a hook,.git/config, auvsetting), the shell can write. Options such ascore.hooksPath=/dev/nulldo not remove the other keys that run a program from a repository config (core.fsmonitor,core.sshCommand,credential.helper,alias.*,filter.*,diff.external). A separate bare repository for the job does not help either, because the same user can write its path. Only a different user in a different container, or a different runtime, is a boundary.Chosen design: privilege separation by container (option 1).
git,ghand the model loop. The shell container runs as another user (runAsUser1001,readOnlyRootFilesystem, all capabilities dropped, no token, no SecretenvFrom). It holds the toolchain (uv,ruff,mypy,gitfor status only).emptyDirfor the worktree. The job container owns the repository metadata; the shell container gets the working files only. Pod Securityrestrictedallows both users.localhost, behind aWorkspaceBackendof pydantic-ai (SupportsCommands,SupportsFilesystem). The server executes the same first-word allowlist and the same time and output limits..gitand refuses symbolic links and files outside the group's paths, then runs its checks, commits and pushes from its own tree. The job never reads a git setting that the shell container wrote.Rejected, with the reason
unshare: user namespaces fail under the default seccomp profile, which Pod Securityrestrictedrequires (evidence on this issue).This item is too big for one pull request. It needs these items, each depending on the one before it:
WorkspaceBackendoverlocalhost, with tests at the process edge.design.mdandk8s/README.mdchanges to what the layout provides.Label
needs-splitis set so that refine proposes the split.devops-cli-service commentedon Oct 30, 2026
Refine cannot set this item to Ready at 46fd02d until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
dan-petty commentedon Nov 1, 2026
New candidate for design 3 of this issue:
kubernetes-sigs/agent-sandbox, a Kubernetes SIG Apps controller. It runs untrusted code from a model in an isolated sandbox (gVisor or Kata) and offers warm pools and claims. The API isv1beta1and the project is young (v0.5.x), so measure it before a choice.A second reason to choose a real sandbox boundary: the shell policy of the runner refuses commands that the agent needs (
git diff | head,rmof its own scratch file, redirects), and a refusal makes the agent lose steps or stop (#3072 widens the table by hand). If the sandbox is the boundary, the policy can allow more programs and stay safe.Open points to check first: whether gVisor or Kata runs on the homelab nodes (a RuntimeClass), the start-up time of a sandbox against the 23 s to 15 min Jobs we see now, and how the worktree reaches the sandbox.
Sources: https://github.com/kubernetes-sigs/agent-sandbox
11 remaining items
dan-petty commentedon Nov 12, 2026
The command gate plan (tracker #5199) proposes an egress part for this item. The owner has not accepted it yet (open question 3 of #5199).
Why: the runner Job can reach any public host on 443 (the public HTTPS rule of
networkpolicy.yaml). The allowlisteduv run python <file>can send any data to any host, so neither the gate lists (#5201) nor Jev (#5206) limit the harm "sends data to a host". The cluster has no FQDN network policy (no CiliumNetworkPolicy or toFQDNs ink8s/).Proposed scope to add:
roadmap.command_gate.hosts.implement_shell(feat(roadmap): build the command gate facts from the manifests and a probe #5203) change from "public 443, any host" to the host list.What stays in the gate: #5201 blocks curl, wget and git to a host off the host list, but only as an accident filter. The egress limit of this item is the boundary.
Acceptance to add: a Job test where
curl https://example.orgfails anduv sync --frozenpasses.Risk: the change affects the network of every runner Job. A host that is missing from the list makes a Job fail until the list gets that host.
devops-cli-service commentedon Nov 13, 2026
The proposal at 4ef7c6f needs splitting into 3 items. A person splits the item into the items below, or replies in a comment or edits the body to keep one item, and the next refine round looks at the item again.
sandboxdas the command server, and add the shell command backend.dan-petty commentedon Nov 13, 2026
Owner decision of 2026-11-13: proceed with gVisor. This replaces the rejection of gVisor that this issue body records from 2026-11-05.
gvisor(feat(k8s): a gVisor RuntimeClass for pods that run untrusted code #5431, PR feat(k8s): add RuntimeClass gvisor for the runsc nodes #5436), and feat(k8s): measure runsc against runc for RuntimeClass gvisor #5434 measures runsc against runc on the runner image and a Chromium smoke before any workload uses the class.devops-cli-service commentedon Nov 13, 2026
The proposal at b4a4ffb needs splitting into 3 items. A person splits the item into the items below, or replies in a comment or edits the body to keep one item, and the next refine round looks at the item again.
docs(openspec): plan #3703 Share one tracker rule with refine (#5901)
devops-cli-service commentedon Nov 18, 2026
The result in the alternatives block of the issue body changed. Before this check:
partly, tool https://github.com/vstorm-co/pydantic-ai-backend. A person decides what the new result means for the item.Searches (6)
Tools considered:
Searches run:
Sources:
dan-petty commentedon Nov 20, 2026
Owner decisions (2026-11-20, direct answers), after a design study with a critic (#6519, experiment 1 step 3):
prepare(init container, App key) does the GitHub reads and the clone and records the base;agent(init container, model key only) runs stockCoderwith its shell and writes a patch and a summary to a sharedemptyDir;publish(app container, App key) starts only after the agent container exits, applies the patch as data to a fresh clone, writes its own commit, pushes and opens a draft PR. This is the pattern of GitHub Agentic Workflows safe outputs, Codex cloud and the Copilot cloud agent. feat(roadmap): test sandboxd and add the shell command backend #3694 (sandboxd command server) closes as not planned; feat(roadmap): run implement and fix-checks as prepare/agent/publish phases #3702 and feat(roadmap): add the three-container runner Job, policy and log reads #3700 get new scopes. The critic's blockers become acceptance criteria (no agent-written code inprepare, the Job log read per container, the base of a Staged item, per-container policy rules for init containers, where the PR body text is written, the symlink stop, the guards inprepareandpublish).workflows: writeis granted only when the merged plan of the item names a workflow file;preparereads that frommain, where the agent cannot change it.Cost estimate of the critic (not measured): about 2-3k changed lines, 2.5-4 days. The rewrite of this issue and of #3700/#3702 follows.
dan-petty commentedon Nov 20, 2026
Owner answers (2026-11-20) to the key questions of this item:
dan-petty commentedon Nov 25, 2026
Verified complete on
origin/main(62f17da50) and on the livedevopsnamespace:#3702closed (54de847da/ PR#6670,6e497c2b7/ PR#6709, shipped inv0.189.0+).#3700closed (97d6bc7ba/ PR#6732,84c0627e7/ PR#6695, shipped inv0.194.0).#6691(8f363e6c1/ PR#6790).2026-11-20T18:39:46Z.devopsnamespace (kubectl -n devops).devops-cli-implement-devops-cli-4704-7f165d(poddevops-cli-implement-devops-cli-4704-7f165d-s6p6w,succeeded: 1, PR#7007merged):prepare(init):2026-11-24T17:30:32Zto17:34:11Z, exit0, holdsDEVOPS_CLI_SERVICE_GITHUB_APP_PRIVATE_KEYonly, mountsrun,state,prepare-tmp,prepare-home,config.agent(init):2026-11-24T17:34:12Zto18:20:23Z, exit0, holdsDEVOPS_CLI_AI_API_KEYonly (no App key), mountsrun,agent-tmp,agent-home,config(nostateorprepare-home).publish(main):2026-11-24T18:20:23Zto18:21:25Z, exit0, started afteragentterminated, holdsDEVOPS_CLI_SERVICE_GITHUB_APP_PRIVATE_KEYonly, mountsrunandstatereadOnly: true.devops-cli-fix-checks-devops-cli-4704-58184c1c44(poddevops-cli-fix-checks-devops-cli-4704-58184c1c44-62tld,succeeded: 1,--pull 7007):prepare(init):2026-11-24T18:41:27Zto18:42:23Z, exit0,DEVOPS_CLI_SERVICE_GITHUB_APP_PRIVATE_KEYonly.agent(init):2026-11-24T18:42:24Zto18:59:24Z, exit0,DEVOPS_CLI_AI_API_KEYonly.publish(main):2026-11-24T18:59:25Zto18:59:41Z, exit0, started afteragentterminated,DEVOPS_CLI_SERVICE_GITHUB_APP_PRIVATE_KEYonly.Note: moving CronJob
roadmap-stageto the three-container shape is tracked separately in#6814(after#6705and#6813).docs(k8s): name Secret devops-cli for stage Job key (#7133)