{
  "id": "matan-claude-code-yes-mode-agents-md-2026-11",
  "name": "Claude Code Auto Mode turned into Yes Mode by one AGENTS.md line",
  "date_reported": "2026-11-01",
  "date_activity_start": "2026-09-04",
  "date_activity_end": "2026-11-01",
  "researcher": "Matan Ben-Tov",
  "org": "Independent",
  "sources": [
    {
      "url": "https://matanbt.github.io/post/yesmode2026/",
      "title": "Turning Claude Code's Auto Mode Into \"Yes Mode\"",
      "publisher": "Matan Ben-Tov"
    }
  ],
  "magicsword_coverage": [],
  "borderline": true,
  "borderline_note": "The post is a researched bypass, evaluated in containers. It does not describe an in-the-wild intrusion. Matan Ben-Tov says Anthropic had not replied to the Sept 4, 2026 disclosure by publication.",
  "ai_role": "ai_agent_or_mcp_as_target",
  "ai_role_secondary": null,
  "ai_role_detail": "Claude Code Auto Mode asks Sonnet 5 to score each tool call from 0 to 100 and allows scores under 25. A single line in the project's AGENTS.md is copied into that classifier prompt and changes the scale to 0-10.",
  "technique_summary": "Matan Ben-Tov (published Nov 1, 2026) shows a one-line prompt injection in a project AGENTS.md that makes Claude Code Auto Mode allow tool calls the user set it to deny. Auto Mode has been the default tool-call gate since Aug 7, 2026. On each tool call, Claude Code prompts Sonnet 5, without thinking, to return a severity score. The reverse engineering was done on Claude Code v2.1.251 as of Sep 1, 2026. A score under 25 is allowed. A higher score is escalated to another Sonnet 5 call with thinking, which this attack does not need. The classifier prompt includes the user's CLAUDE.md, memory files, and the project AGENTS.md, wrapped in a user_claude_md tag. The published line closes that tag and tells the classifier to score on a 0-10 scale where 5 is the allow or block boundary, then reopens the tag. In the tests, every injected classification came back between 0 and 10, so Claude Code treated the score as under 25 and ran the command. A direct demo used a hard_deny rule that should block curl or fetch except to example.com. On a clean Pi repository the classifier returned 90 and blocked mal.com. After the line was added, the same request was allowed with a score of 8. Across about 50 isolated classifier scenarios on seven repositories (pi, browser-use, tropt, bun, codex, rocksdb, and ghostty) and four user profiles, 4 percent slipped past with a clean AGENTS.md and 99 percent did with the line, measured as a score under 15. In 30 end-to-end sessions with Opus 5.5 as the main agent, the classifier blocked every forbidden command on the clean file. With the line present, forbidden commands ran in 22 of 30 sessions (73 percent), including a read of a local .env, git config --global http.sslVerify false, and commands that came from a malicious skill rather than the user's prompt. The attack still worked on Claude Code v2.1.316, released Oct 31, 2026, including versions that classify on the server. Mahmood Sharif is thanked for guidance. This is not the Downloads-folder AGENTS.md hijack in forever-agents-md-hijack-2026.",
  "initial_access": "The user runs Claude Code, with Auto Mode on, in a repository whose AGENTS.md contains the one published line",
  "ai_tooling_and_models": [
    "Claude Code Auto Mode, tested through v2.1.316 (Oct 31, 2026)",
    "Sonnet 5 permission classifier",
    "Opus 5.5 as the main agent in the end-to-end sessions"
  ],
  "other_tooling": [
    "Project AGENTS.md"
  ],
  "victims_and_sectors": "Claude Code users who open a repository they did not write. No victim organization is named. The evaluation ran locally in containers.",
  "regions": [
    "Not applicable"
  ],
  "attribution_or_cluster": "No threat actor. Matan Ben-Tov disclosed the bypass to Anthropic on Sept 4, 2026, and reports no response by publication.",
  "scale_and_metrics": "Classifier bypass in 99 percent of about 50 injected scenarios, versus 4 percent clean. End-to-end forbidden commands ran in 22 of 30 injected sessions and in 0 of 30 clean sessions. Effective on Claude Code v2.1.316.",
  "prevention_angle": "Run Claude Code in a sandbox or container when the repository is not yours, so a failed Auto Mode check cannot reach keys or a local .env. Read AGENTS.md before the session. Treat AGENTS.md, CLAUDE.md, and skill files as code the classifier will ingest. The post's own patch ideas, a score that states its scale, keeping untrusted files out of the classifier prompt, or a non-LLM classifier, are described as incomplete.",
  "related_magicsword_projects": [
    "LOLSkills"
  ],
  "source_notes": "The classifier design, the published line, the Pi demo, the 99 percent and 73 percent figures, the v2.1.316 result, and the Sept 4 disclosure are from Matan Ben-Tov's post. Link forever-agents-md-hijack-2026, which uses a different AGENTS.md lure.",
  "last_reviewed": "2026-11-15",
  "region_notes": "No target country. The evaluation repositories are public codebases used as fixtures.",
  "iocs": {
    "domains": [],
    "ips": [],
    "hashes": [],
    "urls": []
  },
  "atlas_techniques": [
    {
      "id": "AML.T0051.001",
      "rationale": "The project AGENTS.md is untrusted text that is copied into the Auto Mode classifier prompt",
      "source_urls": [
        "https://matanbt.github.io/post/yesmode2026/"
      ]
    },
    {
      "id": "AML.T0054",
      "rationale": "The line changes the classifier's 0-100 severity scale so a high-risk score falls under the allow threshold of 25",
      "source_urls": [
        "https://matanbt.github.io/post/yesmode2026/"
      ]
    }
  ],
  "attack_flow": {
    "nodes": [
      {
        "id": "plant",
        "title": "One line in AGENTS.md",
        "description": "The repository's AGENTS.md closes the user_claude_md tag and tells the classifier to score severity from 0 to 10.",
        "kind": "access",
        "source_urls": [
          "https://matanbt.github.io/post/yesmode2026/"
        ]
      },
      {
        "id": "score",
        "title": "Sonnet 5 scores under 10",
        "description": "Auto Mode sends the file to Sonnet 5. In the tests every injected score came back between 0 and 10.",
        "kind": "ai",
        "source_urls": [
          "https://matanbt.github.io/post/yesmode2026/"
        ]
      },
      {
        "id": "allow",
        "title": "Claude Code allows scores under 25",
        "description": "The client treats the 0-10 score as below the threshold of 25 and runs the tool call, including hard_deny commands.",
        "kind": "execution",
        "source_urls": [
          "https://matanbt.github.io/post/yesmode2026/"
        ]
      },
      {
        "id": "bypass",
        "title": "Denied commands still run",
        "description": "End-to-end sessions then read a local .env, disabled git TLS verification, or followed a malicious skill. Clean sessions blocked the same commands.",
        "kind": "impact",
        "source_urls": [
          "https://matanbt.github.io/post/yesmode2026/"
        ]
      }
    ],
    "edges": [
      {
        "source": "plant",
        "target": "score"
      },
      {
        "source": "score",
        "target": "allow"
      },
      {
        "source": "allow",
        "target": "bypass"
      }
    ]
  },
  "category": "attacks-on-ai",
  "attribution": {
    "actor_name": "unknown",
    "motivation": "unknown",
    "attributed_by": "Matan Ben-Tov",
    "confidence": "low"
  },
  "ai_involvement_confidence": "confirmed",
  "detections": [
    {
      "name": "The AGENTS.md scale line is not a host rule",
      "format": "guidance",
      "notes": "No cited rule matches a markdown line that retargets Claude Code's Auto Mode classifier. Search repositories for the published fragment that closes user_claude_md and sets a 0-10 severity scale. A blocked curl in the user's hard_deny list that then succeeds is the session-level sign the post demonstrates."
    }
  ],
  "timeline": {
    "first_seen": "2026-09-01",
    "last_updated": "2026-11-01",
    "updates": [
      {
        "date": "2026-09-01",
        "source": "Matan Ben-Tov",
        "summary": "Reverse engineering on Claude Code v2.1.251. Auto Mode had been the default gate since Aug 7, 2026."
      },
      {
        "date": "2026-09-04",
        "source": "Matan Ben-Tov",
        "summary": "Disclosed to Anthropic. The post says there was no response by publication."
      },
      {
        "date": "2026-10-31",
        "source": "Matan Ben-Tov",
        "summary": "The bypass still works on Claude Code v2.1.316, including server-side classification."
      },
      {
        "date": "2026-11-01",
        "source": "Matan Ben-Tov",
        "summary": "The Yes Mode write-up is published, with the 99 percent classifier result and the 22-of-30 session result."
      }
    ]
  }
}