Skip to content

fix(roadmap): refused shell programs name their replacement - #2783

Merged
dan-petty merged 6 commits into
mainfrom
fix/2773-refused-shell-programs
Oct 30, 2026
Merged

dan-petty merged 6 commits into
mainfrom
fix/2773-refused-shell-programs

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The shell of an implement step refuses a program outside its allowlist. Each refusal counts against a limit of 5 retries. A model that does not know what to run in its place is refused until the step stops, and the step loses its work.

This change makes three things clear:

  • The refusal tells the model what to run in place of the program. A table of replacements covers python, pytest, pip, cat, ls, grep, cd and similar habits. The refusal of python also says that python -m pip is not to run. An unknown program gets the list of allowed programs. An operator gets the rule of one command in each call. The text of the shell stays, cut to a fixed length. What the shell allows does not change.
  • The prompt of the step shows the same table. A test pins the table, the prompt and the allowed programs together. A second test checks that no shell command in the prompt holds an operator that the shell refuses.
  • The Job log and the stop reason name the refused program. They show a program of the allowlist or of the table, and "other" for any other word, so a password that the model read from a file cannot reach a comment on GitHub. The reason counts refused commands by program, for example "Refused commands: python 4, cd 2".

The hint is a pydantic-ai Hooks capability. pydantic-ai-harness has no setting for the refusal text.

Closes #2773

…t example passes the shell (#2773)

The log and the stop reason showed any short bare word, so a password that
the model read from a file could reach the stop comment. They now show a
program of the allowlist or of the table of replacements, else other.
The text of the shell is cut before the hint. The refusal of python says
that python -m pip is not to run. The directory example of the prompt had a
semicolon that the shell refuses, so it now has none. A test checks each
shell command of the prompt against the denied operators.
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results and review record for #2773.

Full uv run devops ci: all checks passed. The test check took 219 seconds (3m 39s). The whole run took 3m 50s of check time.

Fail-to-pass (uv run devops ci fail-to-pass --base origin/main): 9 tests failed on the base and pass on this branch. 2 more errored on the base. The failures are in tests/test_roadmap_implement_shell_refusal.py, tests/test_roadmap_implement_step.py and tests/test_roadmap_implement_tool_log.py.

Review findings fixed

  • major, prompt: the directory example had a ; inside quotes, and the shell refuses it. The example now has no refused operator. A new test checks each shell command of the prompt against CONST_ROADMAP_IMPLEMENT_DENIED_OPERATORS.
  • minor, spec: a refused python -m pip install x led the model to uv run python -m pip. The replacement of python and python3 now says not to run python -m pip. The prompt table, the code table and the tests agree.
  • minor, model-facing: the echoed first word had no length limit. The text of the shell is now cut to CONST_ROADMAP_IMPLEMENT_ERROR_CHARS before the hint. A test uses a 5000 character word and an interactive command.
  • minor, model-facing: the log showed any short bare word, so a password or token header could reach the stop comment. The log now shows only a program of the allowlist or of the table of replacements, and "other" for any other word. This replaces the bare-word pattern and the secret mask.

Findings not fixed: none.

Note on the log: a refused program outside the table, such as curl, now shows as "other" in the log. The refusal text that the model reads still names it. Add a program to the table to see it by name.

@dan-petty
dan-petty marked this pull request as ready for review October 30, 2026 14:39
@dan-petty
dan-petty merged commit 0458f8f into main Oct 30, 2026
19 checks passed
@dan-petty
dan-petty deleted the fix/2773-refused-shell-programs branch October 30, 2026 15:20
dan-petty-release Bot added a commit that referenced this pull request Oct 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.22.4](v0.22.3...v0.22.4)
(2026-10-30)


### Bug Fixes

* **pr:** pr create adds the labels of the title
([#2782](#2782))
([7183af3](7183af3)),
closes [#2748](#2748)
* **roadmap:** refused shell programs name their replacement
([#2783](#2783))
([0458f8f](0458f8f)),
closes [#2773](#2773)
* **roadmap:** restore the own group text in an implement step
([#2780](#2780))
([163a840](163a840)),
closes [#2774](#2774)
* **security:** lock joserfc at 1.7.7
([#2787](#2787))
([0b9f9e5](0b9f9e5)),
closes [#2786](#2786)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): the implement agent keeps calling shell programs outside the allowlist and loses its work

1 participant