Skip to content

fix(coderd/x/chatd): tell parent agents never to ask for a secret answer in chat - #162

Merged
ibetitsmike merged 1 commit into
mainfrom
mike/descendant-questions-8-secret-note
Nov 11, 2026
Merged

ibetitsmike merged 1 commit into
mainfrom
mike/descendant-questions-8-secret-note

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #153. Part of #73.

Xum opened this PR on behalf of @ibetitsmike.

The paired #153 check on daily found a way for a secret to leak. While a child chat waited for a secret answer, the root model told the user to paste the token into the chat. A value sent that way reaches the model, which the secret answer route exists to prevent.

The cause was the text the parent model gets. The secret note in wait_agent and the message_agent refusal said only that the user gives the value "in the root chat", and the model read that as the chat composer.

What changes

  • wait_agent note: for a child with a pending secret question, the note now says the user enters the value in the question panel above the root chat's input, which keeps it out of every model's context. It also tells the model never to ask for the value as a chat message or for itself.
  • message_agent refusal: the error for a message to that child now names the same panel and gives the same instruction.

Only these two strings change. The secret answer route, the stored answers and the UI are unchanged.

Validation

  • go vet and gofmt are clean on ./coderd/x/chatd/.
  • TestDescendantQuestionWaitAgent, TestDescendantSecretQuestion, TestSecretAnswer* and TestSecretQuestionRefusesSubagentMessage pass. They check that wait_agent returns the secret note and that the message_agent refusal holds.
  • UAT on a branch server (3200) at 258bec6e56, as a member user with fork-nested-subagents on and a model. A root chat spawned a child that asked a secret question, then called wait_agent.
    • The wait_agent result carried the new note.
    • Asked what to do next, the root model told the user to paste the token into the question panel above the chat input, and not into the chat message box. The paired feat: let descendant chats ask secret questions #153 check had found the opposite.
    • A message_agent call to the waiting child returned the new refusal text.
    • The value was submitted in the root dock. The child's execute reported the expected sha256.
    • The value was in 0 database text columns except chat_secret_answers.value (1 row), 0 times in server.log, and 0 times in the root's message dumps.

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum posted this comment on behalf of @ibetitsmike.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 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-10T22:24:23.851482Z 258bec6 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 258bec6e56

ℹ️ 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

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this on behalf of @ibetitsmike.

Closing and reopening only to make GitHub recompute the merge ref against current main (50e9121c3b) and run fork-ci on it. The head is unchanged.

@ibetitsmike ibetitsmike reopened this Nov 10, 2026
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this again on behalf of @ibetitsmike.

The merge ref now points at current main (50e9121c3b), but the run started by the first reopen was queued against the old merge ref. This second reopen starts fork-ci on the recomputed merge. The head is unchanged.

@ibetitsmike ibetitsmike reopened this Nov 10, 2026
@ibetitsmike
ibetitsmike merged commit 87f8e1f into main Nov 11, 2026
22 of 29 checks passed
@ibetitsmike
ibetitsmike deleted the mike/descendant-questions-8-secret-note branch November 11, 2026 00:40
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike.

Merge evidence for head 258bec6e56d267cd08b7b15f390b11160a32228a:

  • fork-ci pull_request run 42926839566 passed; its build job checked out Merge 258bec6e56 into 50e9121c3b (current main). Run 42913883857 had also passed on this head against 15cfeed5f5. All checks green.
  • Codex on this exact head: no major issues (comment 6780926658). No unresolved review threads.
  • UAT on :3200 at this head with a real model, as a member user: the root's wait_agent result carried the new note. Asked what to do next, the root told the user to enter the token in the question panel above the chat input and not to paste it into a chat message, the opposite of what the feat: let descendant chats ask secret questions #153 check saw. message_agent to the waiting child returned the new refusal, the panel answer reached the child, and the value appeared only in chat_secret_answers.value and never in the server log. One model run shows the note helps; it can't prove a model always follows it.
  • No migration.

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