Repository navigation
Description
Problem
The largest class of plan defects is a false premise that only a command run can show: 8 of 48 findings in the first five plan fixes. Examples: devops --dry-run config unset deletes a key (#3218), a help text shows a form that the tool refuses (#2743), a report excludes LOW (#2646). The planner reads files and cannot run a command. The model pass of #3182 reads text and runs nothing.
A run tool is a risk. In the plan fixes, devops --dry-run config unset deleted a key and wrote a backup. A tool that runs commands in the job must not touch the checkout, the cluster, the network or a secret.
Proposed change
Write the design first, as an ADR and a plan, and wait for a person to approve it. Do not build the tool before the approval.
The design answers these questions:
- Allow-list. Which commands run:
devops <read command> --help, anddevopsread commands that the exposure table marks read-only with no path option (see fix(mcp): pr_check_readiness is read-only in the exposure table but can resolve threads #3235 and fix(mcp): read-only tools take paths that reach the server file system #3236), and the repro that the issue gives? - Isolation. A temporary
HOME, a copy of the config with no credential, a read-only copy of the staged commit, no network (a network policy of the Job or an unshared network namespace), a memory and time cap, a non-root user, and no service account token. - Output. The answer is cut and masked, and is quoted into
## Feasibilityby the planner. - Open tools. Name the sandbox tools that exist (for example
bubblewrap,nsjail, gVisor, the runner image) and the cost to build and keep one (SECURITY.md rule 3). - Where it runs. In the stage Job, or in a separate Job that the stage Job asks for.
- Proof. A test that a command cannot write outside the sandbox, read a secret or open a connection.
Acceptance criteria
- An ADR in
docs/adr/states the decision, the alternatives and the rejected options. - A person has approved it in a comment on this issue.
- The follow-up implementation issues exist and name this ADR.
Related: #3238, #3218, #3235, #3236, #3207.
Scope from #3288
These criteria replace criteria 2 and 3 above.
- Criterion 2. A person merges the pull request that adds the ADR under
docs/adr/. This merge is the approval. A merge of the plan pull request does not approve the ADR. A person asks for changes in the review of the ADR pull request. - Criterion 3. The follow-up implementation issues exist and name this ADR. Each follow-up issue lists docs(security): design a sandboxed read-only run tool for the planner #3242 as a dependency, or it is filed only after the merge. So the Service does not build the tool before the approval. The Service refines and stages open issues by itself, and the refined design files the follow-up issues inside the ADR, before the merge.
- Record. The ADR states that the merge is the approval. The merge record replaces the approving person and the comment URL in the Status section.
Add these inputs to the design questions:
- Where it runs. No stage Job exists. The plan runs in the Service pod (
src/devops_cli/roadmap/run.py:555-572). The refined design choosesHostSandboxin a "stage Job" and rejects a command on the Service, so the ADR must answer this again. - The sandbox tool.
k8s/devops/roadmap-service/deployment.yaml:47setsseccompProfile, and feat(roadmap): run the implement agent shell in a real sandbox #2695 reports thatunshare --userfails underRuntimeDefault.bwrapis inNOT_IN_RUNNER(src/devops_cli/roadmap/runner_tools.py:226). Nobody ran bubblewrap in that pod, so its failure there is unverified. - The decision on feat(roadmap): run the implement agent shell in a real sandbox #2695. The ADR takes the owner decision of 2026-10-30 as an input: privilege separation by container, with bubblewrap and
unsharerejected. The owner comment of 2026-11-01 addskubernetes-sigs/agent-sandboxas a candidate to measure, and that question stays open. This item does not change feat(roadmap): run the implement agent shell in a real sandbox #2695.
Proposed design
Problem statement
The planner reads files and cannot run a command. So a plan can rest on a false premise that only a run shows: 8 of 48 findings in the first five plan fixes. A run tool is a risk, because a command that looked read-only deleted a key (#3218). This item writes the ADR that designs a sandboxed, read-only run tool and lists the follow-up issues that build it. The approval of the ADR is #3288, and this item does not wait on it.
Acceptance criteria
Requirement: ADR file
The change SHALL add one ADR under docs/adr/ that records the decision, the alternatives and the rejected options for the sandboxed read-only run tool.
Scenario: The ADR file holds its sections
- WHEN A check reads the new file in
docs/adr/after the change merges. - THEN The file holds a Decision section, an Alternatives section and a Rejected options section, and each section holds text.
Requirement: Closed allow-list
The ADR SHALL define the allow-list as devops --help for every command and the commands that the MCP exposure table marks read-only and that take no path option.
Scenario: The allow-list names the exposure table and refuses every other command
- WHEN A check reads the allow-list section of the ADR.
- THEN The section names the exposure table as the source of the read-only commands and refuses every command that is not on the list, including a command that an issue quotes.
Requirement: Isolation controls
The ADR SHALL require a temporary HOME, a copy of the config with no credential, a read-only copy of the staged commit, no network, a memory and time cap, a non-root user and no service account token.
Scenario: The ADR lists each control and the container boundary
- WHEN A check reads the isolation section of the ADR.
- THEN The section names each of the seven controls and states that a container with the
RuntimeDefaultseccomp profile applies them.
Requirement: Run location
The ADR SHALL state that the command runs in a separate Kubernetes Job that the planner creates for one run, and it MUST refuse the Service pod and the planner process.
Scenario: The ADR names the run Job and refuses the Service pod
- WHEN A check reads the run-location section of the ADR.
- THEN The section names the separate run Job and gives a reason to refuse the Service pod and the planner process.
Requirement: Cut and masked output
The ADR SHALL cap the command output, mask each secret in it and quote it into ## Feasibility.
Scenario: The ADR states the cap and the mask
- WHEN A check reads the output section of the ADR.
- THEN The section states the byte cap, the line cap and the mask function, and it names
## Feasibilityas the place of the quote.
Requirement: Sandbox tools compared
The ADR SHALL compare bubblewrap, nsjail, gVisor and kubernetes-sigs/agent-sandbox, state what each tool lacks and state the cost to build and keep a sandbox.
Scenario: The comparison of the sandbox tools
- WHEN A check reads the alternatives section of the ADR.
- THEN The section names each tool, states what each tool lacks, and states the cost of the chosen option and the cost of a sandbox built from scratch.
Requirement: The #2695 decision as an input
The ADR SHALL take the owner decision of 2026-10-30 as an input, which separates privilege by container and rejects bubblewrap and unshare, and it MUST state that #2695 owns the measurement of kubernetes-sigs/agent-sandbox.
Scenario: The ADR records the #2695 input and the open measurement
- WHEN A check reads the decision section of the ADR.
- THEN The section names privilege separation by container, rejects bubblewrap and
unshare, and names feat(roadmap): run the implement agent shell in a real sandbox #2695 as the owner of thekubernetes-sigs/agent-sandboxmeasurement.
Requirement: Proof tests
The ADR SHALL specify one test that a command cannot write outside the sandbox, one test that it cannot read a secret and one test that it cannot open a connection.
Scenario: The proof section names the three tests
- WHEN A check reads the proof section of the ADR.
- THEN The section names the test file and one test for each of the three cases.
Requirement: Follow-up issues
The ADR SHALL list the follow-up implementation issues in a Follow-ups section, and each listed issue SHALL name the ADR.
Scenario: The Follow-ups section lists the issues
- WHEN A check reads the Follow-ups section of the ADR.
- THEN The section lists at least one issue number, and the body of each listed issue names the ADR.
Requirement: Approval record
The ADR SHALL state that the merge of its pull request is the approval, and it MUST record the merge commit in its Status section instead of an approving person and a comment URL.
Scenario: The Status section records the merge
- WHEN A check reads the Status section of the ADR.
- THEN The section names the merge commit as the record of the approval, and it holds no approving person and no comment URL.
Existing Tool Considered
No alternatives check has run on this issue. kubernetes-sigs/agent-sandbox is the open, maintained candidate that the owner named on 2026-11-01. #2695 owns its measurement, and no image here installs it, so the repository holds no measurement. bubblewrap is open and maintained, and HostSandbox wraps it. The owner decision of 2026-10-30 rejects bubblewrap for this path, and NOT_IN_RUNNER leaves it out of the runner image. nsjail and gVisor cover more, but no image here installs them. The change builds no sandbox: it adds one Job manifest and a thin runner. That code costs about 3,000 tokens to write, about 500 tokens a month to keep and one day of elapsed time. A sandbox built from scratch costs about 40,000 tokens and about two weeks.
Key questions
- Which commands may the run tool execute?: The allow-list holds two forms. The first form is
devops --helpfor every command. The second form is adevopscommand that the MCP exposure table marks read-only and that takes no path option. The tool builds the list at start from the CLI command tree and the exposure table. No other command runs. A command that an issue or a model quotes does not run. (best practice) [sources: SECURITY.md, src/devops_cli/ai/mcp/roles.py, src/devops_cli/ai/mcp/generator.py]- Chosen: Closed allow-list from the CLI tree and the exposure table. The exposure table is the tested record of a read-only tool, and a job role holds only a tool that it marks read-only.
- Rejected: Deny list of the known write commands. A new or renamed command passes a deny list, which is the failure that SECURITY.md rule 7 records for the kube-api path filter.
- Rejected: Run any command that an issue quotes. An issue is untrusted input, and fix(config): config unset with --dry-run deletes the key #3218 shows a read command that deleted a key.
- Rejected:
--helponly. A help text alone does not show the behaviour that the defects of fix(output): the network table colors a safe low-risk reference red #2646 and fix(ai): fix MCP ai_benchmark models description #2743 hold.
- What confines the command, now that bubblewrap and
unshareare rejected?: Privilege separation by container confines the command, as the owner decision of 2026-10-30 for feat(roadmap): run the implement agent shell in a real sandbox #2695 requires. The run pod uses UID 1000 and theRuntimeDefaultseccomp profile. It mounts no service account token. Its NetworkPolicy admits no egress. A CPU, memory and wall-clock cap bounds it. It gets a temporary HOME on an emptyDir, a copy of the config with no credential, and a read-only copy of the staged commit. (best practice) [sources: SECURITY.md, k8s/devops/roadmap-service/deployment.yaml, k8s/devops/roadmap-service/networkpolicy-egress.yaml, k8s/devops/roadmap-service/serviceaccount.yaml, src/devops_cli/roadmap/runner_tools.py, CONTEXT.md]- Chosen: Privilege separation by container. The owner decision of 2026-10-30 for feat(roadmap): run the implement agent shell in a real sandbox #2695 takes it, and the platform gives it without new code.
- Rejected:
HostSandboxwith bubblewrap. The owner decision rejects bubblewrap andunshare, andNOT_IN_RUNNERleaves bwrap out of the runner image. - Rejected: A NetworkPolicy alone. It stops egress only and leaves the filesystem, the HOME and the environment open.
- Rejected: nsjail or gVisor. No image here installs them, and gVisor needs a runtime class on the cluster.
- Where does the command run: in the Service pod, in a stage Job, or in a separate run Job?: The command runs in a separate Kubernetes Job that the planner creates for one run. The Service pod holds the App private key and runs the lanes, so a model-driven command does not run there. The planner process does not run it either. No stage Job exists today. (best practice) [sources: CONTEXT.md, docs/adr/0015-roadmap-jobs-act-as-a-github-app-on-the-personal-account.md, src/devops_cli/roadmap/run.py, SECURITY.md]
- Chosen: A separate run Job. It gives the container boundary, holds no service account token and keeps the App private key away from the command.
- Rejected: The Service pod, in the planner process. The Service pod holds the App private key and runs the lanes, and
src/devops_cli/roadmap/run.pyruns the plan there. - Rejected: A stage Job. No stage Job exists, so the ADR cannot put the command in one.
- How is the output cut and masked before the planner quotes it?: The tool cuts stdout and stderr at a byte cap and a line cap. It passes the text through
mask_secrets. The planner quotes the command, the exit code and the cut text under## Feasibility, with a note that names the cap. (best practice) [sources: SECURITY.md, src/devops_cli/sandbox/host.py, CONTEXT.md]- Chosen: A byte cap, a line cap and
mask_secrets. The cap keeps the planner within its budget, and the mask keeps a credential out of the plan, as SECURITY.md rules 1 and 12 require. - Rejected: The full output. It floods the planner budget and can carry a credential or a private address.
- Rejected: A model summary of the output. A model adds a claim that no run made, which is the class of defect that this item removes.
- Chosen: A byte cap, a line cap and
- Which open sandbox tools exist, and what does each cost to build and keep?:
bubblewrapis open and maintained, andHostSandboxwraps it, butNOT_IN_RUNNERleaves it out of the runner image and the owner decision of 2026-10-30 rejects it here.nsjailand gVisor cover more, but no image here installs them, and gVisor needs a runtime class.kubernetes-sigs/agent-sandboxis the open candidate that the owner named on 2026-11-01, and feat(roadmap): run the implement agent shell in a real sandbox #2695 owns its measurement. The chosen option is the container boundary, which the platform provides, so the change builds no sandbox. The thin run Job costs about 3,000 tokens to write, about 500 tokens a month to keep and one day of elapsed time. A sandbox built from scratch costs about 40,000 tokens and about two weeks. (best practice) [sources: SECURITY.md, src/devops_cli/sandbox/host.py, src/devops_cli/roadmap/runner_tools.py, tests/sandbox/test_host_sandbox.py]- Chosen: The container boundary of the run Job. The platform provides it, and the owner decision of 2026-10-30 takes privilege separation by container.
- Rejected: bubblewrap (
bwrap). The owner decision rejects it here, and the runner image leaves it out. - Rejected: nsjail. No image here installs it, and the container boundary already gives the limits that the tool needs.
- Rejected: gVisor (
runsc). It needs a runtime class on the cluster and a second kernel path, which exceeds the need. - Rejected:
kubernetes-sigs/agent-sandbox. The owner named it as a candidate to measure, and feat(roadmap): run the implement agent shell in a real sandbox #2695 owns that measurement, so this ADR records it as an open question and does not adopt it. - Rejected: Build our own sandbox. The platform already gives the container boundary, so new sandbox code adds a second path to keep.
- Which tests prove that a command cannot write outside the sandbox, read a secret or open a connection?: The ADR names three tests in
tests/roadmap/test_run_job_manifest.py. One test writes outside the read-only copy of the staged commit. One test reads a credential path and the service account token. One test opens a connection. Each test reads the rendered Job manifest offline, and a live test markedk8sruns the same three cases against a real Job. (best practice) [sources: tests/sandbox/test_host_sandbox.py, k8s/devops/roadmap-service/networkpolicy-egress.yaml, k8s/devops/roadmap-service/serviceaccount.yaml]- Chosen: Manifest tests offline and one live test marked
k8s. The manifest test runs offline in the gate, and the live test proves the pod, the token mount and the network policy. - Rejected: A unit test with a fake executor. It never starts a pod, so it proves nothing about the token mount or the network policy.
- Rejected: The bubblewrap suite in
tests/sandbox/test_host_sandbox.py. It proves the host sandbox, and the owner decision rejects bubblewrap for this path. - Rejected: A live cluster test only. It needs a cluster, so it cannot check the manifest offline.
- Chosen: Manifest tests offline and one live test marked
- How does the ADR record the approval?: The merge of the pull request that adds the ADR is the approval. The ADR states this in its Status section, which records the merge commit. The section holds no approving person and no comment URL. A person asks for changes in the review of that pull request. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md, docs/adr/0014-required-checks-gate-the-merge-and-the-pre-push-hook-runs-the-fast-static-checks.md, CONTEXT.md]
- Chosen: The merge of the ADR pull request. It needs no person to comment on a schedule, and the required checks gate it.
- Rejected: A comment of approval on this issue. It leaves no gate, and it waits for a person to answer on a schedule.
- Rejected: An approval label. It records no review and no merge.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-06: not-applicable.
Class: docs, no search.
Tool: none found.
Activity
devops-cli-service commentedon Nov 2, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
docsprefix of the title gives the type.(security)scope of the title gives the scope.It is a prerequisite for a security-sensitive feature but is not an active incident or blocking defect.It unblocks a future implementation and documents security decisions, but delivers no direct user-facing change.The work is writing one ADR, listing alternatives, and creating follow-up issues; no code is written.Both extend the planner's capabilities; #3037 adds read-only file inspection tools, while this candidate designs a sandboxed command execution tool.devops-cli-service commentedon Nov 2, 2026
Status set to Ready at dc26693 (see proposed design in issue body).
Moved to new items: #3288.
devops-cli-service commentedon Nov 2, 2026
The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.
Evidence:
placeholder
6 remaining items
docs(security): Write the decision record and its decision (#3242)
docs(security): Add the alternatives, the rejected options, the proof…
docs(openspec): archive the change (#3242)
docs(security): Make check Plan Check pass (#3242)
devops-cli-service commentedon Nov 7, 2026
Pull request #3958 is ready for review. The checks passed.
Spend: 186 model requests, 14370815 input tokens, 81759 output tokens.
devops-cli-service commentedon Nov 7, 2026
The runner Job devops-cli-runner-20261107-093414-cf84 ended: succeeded.
Image digest: sha256:a12d8a3601a2f9803ba6a7f77fe19fdcc27a4de30944a1e65fc19d08808e9eff
The last lines of its log:
docs(openspec): plan #3242 Record the sandboxed run tool decision
docs(security): Write the decision record and its decision (#3242)
docs(security): Add the alternatives, the rejected options, the proof…
docs(openspec): archive the change (#3242)