Repository navigation
Description
Split from #3041.
The shell guard cannot stop a write outside the checkout. src/devops_cli/roadmap/implement_run.py states that the shell check reads the first word only and is no security boundary. uv run python can write anywhere the user can. The refusal limit also counts a refused argument of a catalog program such as find -exec. A loop of such calls can run without bound. This part needs the real sandbox of #2695 and a budget decision. It is deferred from #3041. Acceptance criteria: a test SHALL verify that a scoped-write tool cannot write outside the checkout; a test SHALL verify that the file outside the checkout is unchanged after the refused write; the refusal limit SHALL count only calls that the catalog has no entry for; a test SHALL verify that a loop of refused arguments stops at the budget.
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Proposed design
Problem statement
The refusal limit counts a refused argument of a catalog program such as find -exec. One call can use the budget more than once. A loop of refused calls can run without bound. The change counts one unit for each refused call, whatever the number of its refused arguments, and no unit for an accepted call. A refused argument refuses the whole call. The scoped-write part waits on the runner sandbox of #2695 and is deferred.
Acceptance criteria
Requirement: One refused call uses one unit
The shell policy SHALL count one refused call against the refusal limit, whatever the number of its refused arguments.
Scenario: A refused call with two refused arguments
- WHEN A step runs a call that the shell policy refuses and the call holds two refused arguments.
- THEN A unit test of the shell policy asserts that the refusal count of the step increases by one.
Requirement: An accepted call uses no unit
The shell policy SHALL NOT count a call whose program and arguments the catalog admits against the refusal limit.
Scenario: An accepted call leaves the count
- WHEN A step runs a call whose program and arguments the catalog admits.
- THEN A unit test of the shell policy asserts that the refusal count of the step stays the same.
Requirement: A refused argument refuses the whole call
The shell policy MUST refuse the whole call when the catalog has no entry for one of its arguments, and MUST NOT run it.
Scenario: find -exec is refused
- WHEN A step runs
findwith-exec. - THEN A unit test of the shell policy asserts that the policy returns a refusal that names
-exec, runs no program, and adds one to the refusal count.
Requirement: A refused loop stops at the consecutive limit
The job MUST stop the step when the shell refuses roadmap.implement.max_consecutive_refusals calls in a row with no admitted call between them.
Scenario: A loop of refused find -exec calls stops
- WHEN A step makes refused
find -execcalls in a row up toroadmap.implement.max_consecutive_refusals, with no admitted call between them. - THEN A unit test of the job asserts that the step stops with the class
refused_tooland the refusal stop message.
Requirement: A step stops at the total limit
The job MUST stop the step when the refused calls of the step are more than roadmap.implement.max_refusals.
Scenario: A step with interleaved refused calls stops
- WHEN A step makes more than
roadmap.implement.max_refusalsrefused calls, with an admitted call between them. - THEN A unit test of the job asserts that the step stops with the class
refused_tooland the refusal stop message.
Existing Tool Considered
No alternatives check has run for this item. No open, maintained tool or library covers a refusal budget for a shell that a model drives, because the budget belongs to this project's shell policy. The change builds its own code in the shell policy. Written cost: about 2,000 tokens to build, about 400 tokens a month to keep, about 800 tokens to fix, and less than one day elapsed. The scoped-write part waits on the runner sandbox of #2695 and is deferred.
Key questions
- What does the shell check read, and is it a security boundary?: The shell check reads the first word of a command only. It is no security boundary. The runner pod is the sandbox. [sources: CONTEXT.md, src/devops_cli/roadmap/implement/implement_run.py]
- What do the refusal limits count today?:
docs/ROADMAP_WORKFLOW.mdstates that a step stops when the shell refusesroadmap.implement.max_consecutive_refusalscommands in a row (default 3), or more thanroadmap.implement.max_refusalscommands in the step (default 30). Both stops use the classrefused_tool. [sources: docs/ROADMAP_WORKFLOW.md] - What unit does the refusal limit count?: One unit for each refused call, whatever the number of its refused arguments. An accepted call adds no unit. A refused argument refuses the whole call. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, CONTEXT.md]
- Chosen: One unit for each refused call. The documentation counts commands. One unit for each call bounds a loop of refused calls.
- Rejected: One unit for each refused argument. One call can use the budget many times, so the count does not match the calls.
- Rejected: No unit for a refused argument of a catalog program. A loop of
find -execcalls then never reaches the limit, which is the defect.
- Which values do the refusal limits use?: Keep
roadmap.implement.max_consecutive_refusalsat 3 androadmap.implement.max_refusalsat 30. The defect is the unit that counts, not the number. (best practice) [sources: docs/ROADMAP_WORKFLOW.md]- Chosen: Keep the current values. The item gives no evidence that the current values are wrong, and a new value needs evidence.
- Rejected: Raise the values. A higher limit lets a longer loop run and does not bound it.
- Rejected: Lower the values. A lower limit can stop a step that a person expects to run.
- How does the job stop a loop of refused calls?: The step stops on its existing stop path with the class
refused_tooland the refusal stop message. The refusal returns to the model as a tool result and adds no tool retry. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, src/devops_cli/roadmap/implement/implement_run.py]- Chosen: Stop the step at the limit. The stop path exists, and the step ends with a comment that names the refusal.
- Rejected: Refuse the call and go on. A loop of refused calls then runs without bound.
- Rejected: Ask the model to change the call. The model can loop, and each request costs tokens.
- Which part of the item does the proposal defer?: The scoped-write part. The shell check reads the first word of a command only and is no security boundary, so a scoped-write tool needs the runner sandbox of feat(roadmap): run the implement agent shell in a real sandbox #2695. The refusal budget remains in this item. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/implement/implement_run.py]
- Chosen: Defer the scoped-write part to a new issue. The part needs feat(roadmap): run the implement agent shell in a real sandbox #2695 and is a different deliverable, so one pull request delivers the refusal budget only.
- Rejected: Keep the scoped-write part with feat(roadmap): run the implement agent shell in a real sandbox #2695 as a dependency. The item would mix two deliverables and wait for two items.
- Rejected: Keep the scoped-write part with no dependency. The shell check is no security boundary, so the part cannot be built as written.
Fit
Fits in one pull request.
Suspected block
None.
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.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It is deferred, depends on #2695 for the real sandbox, and is a split of an open umbrella item.Preventing writes outside the checkout and stopping unbounded refused-argument loops protect user data and job stability.It needs new tests for scoped-write enforcement, a budget-counting fix, and integration with the #2695 sandbox.Both concern the implement agent tool catalog, but #3041 adds the catalog and policies while this item enforces scoped writes and fixes the refusal budget count.devops-cli-service commentedon Nov 6, 2026
Refine cannot set this item to Ready at e9bf5a9. A bot opened the item, so a review of the issue and of the proposal must approve it first. The review found the defects below. A person edits the body to answer them. The next refine round looks at the item again only after a body edit.
false_premiseat key_questions 1: The plan saysimplement_run.pyimports ashownhelper fromimplement_shell_policy.py. The issue names onlyimplement_run.py, andfilesholds no text of either file to support the claim. Evidence: "implement_run.pyimports itsshownhelper and states that the shell check reads the first word of a command only"feat(roadmap): list the local devops commands in the shell catalog (#…
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
devops-cli-service commentedon Nov 20, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
devops-cli-service commentedon Nov 20, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Nov 26, 2026
Closed: the catalog tools no longer exist.
Implement runs a stock harness shell since #7031.
implement_shell_policy.py, the tool catalog and its refusal limit are gone. The Job container is now the boundary for writes.