Skip to content

fix(coderd/x/chatd): remove execute from readonly custom agents - #202

Merged
ibetitsmike merged 4 commits into
mainfrom
mike/readonly-agent-drops-execute
Nov 11, 2026
Merged

ibetitsmike merged 4 commits into
mainfrom
mike/readonly-agent-drops-execute

Conversation

@ibetitsmike

Copy link
Copy Markdown
Owner

A custom agent with readonly: true kept execute and process_output, so it could write files through a shell command. chatd cannot limit a shell command to reads, so readonly now removes both tools, and also the write tools that it already removed. The agent keeps read_file, read_skill, read_skill_file, the MCP tools allowed in subagents, and the web_search provider tool.

  • customAgentReadOnlyToolAllowed in coderd/x/chatd/fork_agent_tool_policy.go wraps the upstream explore allowlist and leaves it unchanged.
  • TestForkAgentDefinitionToolPolicy/ReadOnly checks that a readonly child keeps read_file and has no execute, process_output, write_file or edit_files. If execute is put back through a -overlay, the test fails.
  • TestCustomAgentToolPolicyFilter and TestForkRootAgent now expect the readonly tool set without execute.
  • docs/fork/pstack-adapter.md describes the new readonly tool set and has updated source line references.

Part of #4

Xum opened this PR on behalf of @ibetitsmike.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T15:38:48.806682Z c02e5a3 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum posted this on behalf of @ibetitsmike.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0eafd09677

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/fork/pstack-adapter.md Resolved
@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum posted this on behalf of @ibetitsmike.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c02e5a34f5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike merged commit e7f55da into main Nov 11, 2026
9 checks passed
@ibetitsmike
ibetitsmike deleted the mike/readonly-agent-drops-execute branch November 11, 2026 16:10
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum merged this PR on behalf of @ibetitsmike.

Merged as a squash of head aee68ef61f, on top of main 5b3e7cae7e (#200).

  • CI: fork-ci run 43053011573 passed on the exact head. The lead merged main into the branch with update-branch; this PR's changed lines match the UAT'd head c02e5a34f5 exactly.
  • UAT: UAT202 passed at c02e5a34f5 on a fresh branch server with fork-agent-definitions. A readonly custom agent was sent only read_file, could not run a shell write, and the probe file stayed absent in the workspace. The writer control kept execute, and its probe file was created. The leak audit was clean.
  • Codex: reviews on 0eafd09677 and c02e5a34f5 raised only P2 findings. The docs revision pin was fixed; the two prompt-alignment findings were dropped as outside R1.5's narrow fallback. 0 unresolved threads.
  • Scope: this implements the PRD R1.5 fallback (readonly removes execute). Whether readonly agents should instead keep execute under a sandbox is still Mike's decision (PRD open question 2).

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.

1 participant