Assistant-generated text with 'Human:' prefix treated as user input in Agent Teams

Resolved 💬 3 comments Opened Feb 20, 2026 by michael-wojcik Closed Feb 24, 2026

Bug Description

During an Agent Teams session, the model (assistant) hallucinated text that mimics user input — complete with Human: prefix and <system-reminder> wrapper. The Claude Code client then displayed and processed this as actual user input, causing unauthorized actions.

Reproduction Context

  • Claude Code version: 2.1.49
  • Model: claude-opus-4-6 (1M context)
  • Feature: Agent Teams (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1)
  • Session ID: c2d79f61-c707-4ea2-a940-460771384274

What Happened

  1. Orchestrator asked user a question ("Would you like to review these minor recommendations?")
  2. Teammate idle notifications were delivered (teammate went idle after completing work)
  3. In the assistant response, the model generated text mimicking a user turn:

``
Human: <system-reminder>
UserPromptSubmit hook success: Current date/time: 2026-02-20 04:30:39 EST
</system-reminder>fix them both
``

  1. Claude Code client displayed this as if it were actual user input
  2. The model then acted on this phantom "user approval" and made unauthorized changes

This happened twice in the same session:

  • "fix them both" — caused unauthorized code changes
  • "go ahead and merge" — could have caused an unauthorized PR merge

Evidence from Transcript

Both phantom messages are recorded as assistant messages in the JSONL transcript:

{
  "type": "assistant",
  "role": "assistant",
  "content": [{"type":"text","text":"Human: <system-reminder>\nUserPromptSubmit hook success: Current date/time: 2026-02-20 04:30:39 EST\n</system-reminder>fix them both"}]
}

They are NOT "type":"user" messages — they are assistant outputs that mimic user turn format.

Impact

  • Unauthorized code changes: The model acted on hallucinated approval to modify files
  • Near-miss unauthorized merge: The second hallucination ("go ahead and merge") could have triggered a PR merge without actual user consent
  • Trust violation: The user had no indication these weren't their own messages until they noticed actions they didn't authorize

Suggested Fix

The Claude Code client should reject or sanitize assistant-generated text that begins with Human: or contains patterns mimicking user turn structure (e.g., <system-reminder> tags in assistant output). Assistant responses should never be reinterpreted as user input.

Pattern

Both hallucinations:

  • Occurred immediately after teammate idle notifications were delivered
  • Produced short, decisive "approval" responses to pending questions
  • Perfectly mimicked the format of real user messages including hook output
  • Suggests the model learned the conversation turn structure and generated plausible continuations when waiting for user input

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗