anthropics / anthropics/claude-code

[FEATURE] AskUserQuestion tool result cannot be distinguished from a genuine human response

オープン
#88,790 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:agents area:permissions area:security enhancement
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

### Preflight Checklist

- [x] I have searched [existing requests](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20label%3Aenhancement) and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)

### Problem Statement

When a subagent session calls the AskUserQuestion tool, the tool's return value has the same format regardless of whether a human actually saw and clicked an option, or whether the answer was auto-returned without any human interaction (e.g. under a bypass-permissions-style mode).

Return format observed:
"Your questions have been answered: ""="" selected"

In our case, a subagent running inside an isolated worktree called AskUserQuestion twice for real approval decisions (whether to proceed with implementation, whether a UI line could be deleted). Both times the tool returned a result with the "(recommended)" labeled option selected, while no human had actually seen or interacted with the question. The subagent had no way to tell, from the tool result alone, whether this was a real human answer or an automatic one.

This is a trust/safety-relevant gap: any workflow that treats AskUserQuestion results as a human approval gate (e.g. "proceed only after user confirms") cannot currently verify that a human was actually involved.

### Proposed Solution

Have the AskUserQuestion tool result (or an adjacent signal available to the calling agent) indicate whether the answer came from an actual UI interaction versus an automatic/bypassed path. For example, an explicit field like "source": "human" | "auto" alongside the selected answer, so agents can distinguish real approval from auto-approval before treating it as authorization for consequential actions (implementation, commit, push, deletion, etc.).

### Alternative Solutions

Currently the only workaround we found is: after receiving an AskUserQuestion result from a subagent, have the parent/coordinating session (or a human) independently re-confirm with the actual user whether they were really shown and answered the question. This is manual, easy to forget, and only discovered after the fact in our case.

### Priority

High - Significant impact on productivity

### Feature Category

API and model interactions

### Use Case Example

1. A parent Claude Code session delegates a task to a subagent session running in an isolated worktree (e.g. via Orca-style multi-session orchestration), possibly in a permission mode that can auto-approve some actions.
2. The subagent calls AskUserQuestion for a real decision (e.g. "should I proceed with this implementation?").
3. The subagent receives a result in the normal format: "Your questions have been answered: ""="" selected".
4. The subagent has no way to tell whether a human actually saw and clicked that option, or whether the answer was returned automatically without any human involved.
5. The subagent (reasonably) treats this as a real human approval and proceeds with consequential actions (implementation, commit, push).
6. It later turns out no human was ever shown the question.

### Additional Context

_No response_

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

The issue does not name files, tests, or implementation entry points. Start by locating the AskUserQuestion tool result and tracing how answers are produced in human-interaction and automatic/bypassed paths. Done means the calling agent can reliably distinguish a real UI response from an automatic answer; check the relevant tool and agent tests for both paths.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api, authentication
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。