Repository navigation
Description
Epic: graph-2026-10-freeze-b Tier: mechanical Execution: split (exec in sequant_run; AC-1 evidence from #1451, graph doc I-6)
Problem
Phase agents receive the user's claude.ai connectors, outside the #936 phase-MCP allowlist.
Measured 2026-10-10 in #1388's baseline run (stock sequant 2.19.0, Agent SDK 0.3.289, Claude Code 2.1.289, no plugin, committed skills). The phase agent's SDK system/init message listed:
sequant connected source: dynamic (passed by the driver, allowlisted)
claude.ai Claude Docs connected source: claudeai
claude.ai Gmail connected source: claudeai
claude.ai Google Drive needs-auth source: claudeai
claude.ai Google Calendar needs-auth source: claudeai
claude.ai Figma needs-auth source: claudeai
#936 restricted what the driver passes in options.mcpServers (getPhaseMcpServersConfig). The SDK adds the account's claude.ai connectors separately, so the allowlist never sees them.
Failure scenario: an issue body, which isn't trusted input, instructs the agent → a phase agent running permissionMode: "bypassPermissions" reads it → it calls a connected Gmail or Docs tool (send, read, share) on the user's account with no prompt. This is the over-grant #936 closed for Claude Desktop config, reached through a source #936 doesn't cover.
Lever (measured 2026-10-16, graph doc §4 and D-3)
query() aborted at system/init, settingSources: ["project"], one dynamic server passed, on an account with connectors:
| Option | CC 2.1.289 | CC 2.1.296 |
|---|---|---|
| none | 5 claudeai servers |
5 claudeai servers |
strictMcpConfig: true |
passed server only | passed server only |
settings: { disableClaudeAiConnectors: true } |
passed server only | passed server only |
Use settings: { disableClaudeAiConnectors: true }. It gates only auto-fetched claude.ai connectors. strictMcpConfig would also drop project .mcp.json, plugin and agent-frontmatter MCP, which is wider than this bug and would change what #1397/#1398 can load. The driver has one query() call (drivers/claude-code.ts:130, the only SDK import in src).
Acceptance Criteria
- AC-1: A Claude Code phase agent run from a
dist/build ofmainhas noinit.mcp_serversentry withsource: "claudeai", while the allowlistedsequantserver (and anysettings.run.mcpAllowlistserver) is still listed. Evidence: thesystem/initserver list from smoke(graph-2026-10-freeze-b): amainbuild's phase agent has no claude.ai connectors, runs CC ≥ 2.1.296, and starts a fresh-clone worktree from the PR branch #1451's phase run on an account with connectors, pasted in smoke(graph-2026-10-freeze-b): amainbuild's phase agent has no claude.ai connectors, runs CC ≥ 2.1.296, and starts a fresh-clone worktree from the PR branch #1451's report. - AC-2: The driver passes
settingscontainingdisableClaudeAiConnectors: truetoquery(), and no later key in the options object replaces it. Evidence: a test in the Claude Code driver suite asserting the option on thequery()call, mutation-verified by removing the option. - AC-3: The MCP allowlist docs say that claude.ai connectors are switched off for phase agents, and how. Evidence:
grep -n "disableClaudeAiConnectors" docs/guides/mcp-integrations.mdmatches.
Prior fixes / producers
- Prior fix on this artifact: fix(mcp): phase agents receive the user's entire Claude Desktop config — capability over-grant + literal secrets in argv #936 (phase-MCP allowlist via
getPhaseMcpServersConfig,src/lib/mcp-config.ts:114). It covered servers the driver passes, not ones the SDK adds. - Producers of a phase agent's MCP set: the driver's
mcpServers(allowlisted), and the SDK's own sources (claude.ai connectors, project.mcp.json, plugins). This issue closes the claude.ai source only. Whether a project.mcp.jsonserver outside the allowlist reaches a phase agent wasn't measured here; it's out of scope (Non-Goals).
May touch
src/lib/workflow/drivers/claude-code.ts, its tests, docs/guides/mcp-integrations.md, CHANGELOG.md.
Non-Goals
- The Codex and opencode drivers; check them separately.
strictMcpConfigand project.mcp.json/ plugin MCP sources (graph doc D-3).- Any edit under
plugin/,.claude/skills/ortemplates/skills/(plugin freeze).
Activity
admarble commentedon Oct 13, 2026
A second lever to measure for AC-3, from the 2026-10-13 upstream triage. Claude Code v2.1.290: "Fixed
disableClaudeAiConnectorsandallowedMcpServersURL rules not being applied to some MCP entries declared in.mcp.json, plugins or agents."disableClaudeAiConnectorsis a candidate way to drop thesource: claudeaientries from phase agents, next tostrictMcpConfig. Sequant sets neither today: the driver (src/lib/workflow/drivers/claude-code.ts:130-158) passes onlymcpServers,settingSources: ["project"]andbypassPermissions.Caveat: phase agents run the Claude Code bundled in the agent SDK. The lockfile pins 0.3.289 (= CC 2.1.289), which predates this fix. Measure on the SDK after #1440 bumps it, or the result says nothing about current behaviour.
admarble commentedon Oct 16, 2026
Runner context (graph-2026-10-freeze-b, tracker #1452), for the exec and qa phases:
npm test/npx vitest runwith no file filter). Six phase agents run at once and the MCP phase wall is 30 minutes (graph doc I-5). Full-suite evidence comes from CI. Run only the targeted test files, in the foreground, undertimeout 600, after a WIP commit. Do not userun_in_backgroundor Monitor.plugin/,.claude/skills/ortemplates/skills/(plugin freeze, I-1).mainbuild's phase agent has no claude.ai connectors, runs CC ≥ 2.1.296, and starts a fresh-clone worktree from the PR branch #1451's evidence (graph doc I-6): MCP phases run the npm-pinned sequant 2.19.0, so this phase cannot observe its own fix. exec and qa: do not builddist/or probe the SDK live for AC-1. QA should mark AC-1 as pending smoke(graph-2026-10-freeze-b): amainbuild's phase agent has no claude.ai connectors, runs CC ≥ 2.1.296, and starts a fresh-clone worktree from the PR branch #1451, not attempt it.docs/guides/mcp-integrations.md. Keep the AC-3 edit small and local so the later merge stays trivial.admarble commentedon Oct 16, 2026
Complexity: Standard (3 ACs, 3 directories)
AC Quality Check
system/initlist from smoke(graph-2026-10-freeze-b): amainbuild's phase agent has no claude.ai connectors, runs CC ≥ 2.1.296, and starts a fresh-clone worktree from the PR branch #1451. It cannot pass onmaintoday (5claudeaientries), so it is not vacuous. Per the runner comment, exec and qa must not builddist/or probe the SDK live. QA marks AC-1 pending smoke(graph-2026-10-freeze-b): amainbuild's phase agent has no claude.ai connectors, runs CC ≥ 2.1.296, and starts a fresh-clone worktree from the PR branch #1451.settings.disableClaudeAiConnectors === trueon thequery()call. It fails today (nosettingskey), so it is not vacuous.grep -n "disableClaudeAiConnectors" docs/guides/mcp-integrations.mdmatches nothing today, so it gates the edit.Evidence:. No vague or open-ended wording.Scope Assessment
Non-Goals: present (Codex/opencode drivers,
strictMcpConfigand project/plugin MCP, plugin freeze paths).src/lib/workflow/drivers,docs/guides,CHANGELOG.md)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: No
source: "claudeai"entry in a phase agent'sinit.mcp_servers;sequantandmcpAllowlistservers still listedVerification: Manual Test (external evidence from #1451)
Scenario: Given a
dist/build ofmainon an account with connectors → When a phase agent runs → Then thesystem/initlist shows only allowlisted servers.Assumptions: The SDK build the phase agents run honours
disableClaudeAiConnectors(measured on CC 2.1.289 and 2.1.296). TheSettingstype already declares it (sdk.d.ts:7004). Exec and qa cannot observe this: MCP phases run the npm-pinned 2.19.0.AC-2: Driver passes
settings: { disableClaudeAiConnectors: true }and nothing later overrides itVerification: Unit Test (declared evidence, so testgen is not needed)
Scenario: Given the driver runs a phase, with MCP on and with MCP off → When
query()is called → Thenoptions.settings.disableClaudeAiConnectors === true.Assumptions:
settingsaccepts an inlineSettingsobject (sdk.d.ts:2231,string | Settings).AC-3: Docs say claude.ai connectors are off for phase agents, and how
Verification: Manual Test (
grep -n "disableClaudeAiConnectors" docs/guides/mcp-integrations.md)Scenario: Given the docs → When grepped → Then at least one line matches, inside the headless/phase-agent explanation.
Implementation Plan
Phase 1: Driver
src/lib/workflow/drivers/claude-code.ts(thequery()options, ~line 134), addsettings: { disableClaudeAiConnectors: true }as an unconditional key. Place it before any spread (...(mcpServers…),...(config.model…)) or after only keys that cannot carrysettings, so no later key replaces it (AC-2 clause 2). Add a short intent comment citing fix(mcp): phase agents receive the user's claude.ai connectors (Gmail, Docs) outside the #936 allowlist #1396 and fix(mcp): phase agents receive the user's entire Claude Desktop config — capability over-grant + literal secrets in argv #936. Do not addstrictMcpConfig(Non-Goal).Phase 2: Test
src/lib/workflow/drivers/claude-code.test.ts, next to the existingcallOptions.mcpServerstests (~line 109), add two cases. One hasmcp: true, one hasmcp: false. Each assertscallOptions.settingstoEqual({ disableClaudeAiConnectors: true }). Run the file undertimeout 600.Mutation-verified: AC-2 — remove settings option from query() call; src/lib/workflow/drivers/claude-code.test.ts > ClaudeCodeDriver > <case> failed; restored.in the PR body with theSEQUANT_MUTATIONmarker. ThefailedTeststarts with the file path.Phase 3: Docs and changelog
docs/guides/mcp-integrations.md, add a short paragraph after line 38's.mcp.jsonnote (keep it local to ease the merge with PR docs(a11y): WCAG 2.1 AA fixes for the published docs #1438): phase agents also have the account's claude.ai connectors (Gmail, Docs, …) switched off throughsettings: { disableClaudeAiConnectors: true }; interactive Claude Code is unaffected. NamestrictMcpConfigas not used.CHANGELOG.mdentry under Unreleased (check whether the repo uses fragments, improve(release): changelog fragments instead of a shared [Unreleased] block — 121/192 main commits touch CHANGELOG.md #1351, first).Design Review
query()call, the only SDK import insrc.getPhaseMcpServersConfigonly builds themcpServersthe driver passes, and the connectors come from a different source.strictMcpConfig, which also drops project.mcp.json, plugin and agent MCP and would change what investigation(run): verify a skills-only plugin view loads phase skills without hooks or MCP (ADR-0012 follow-up 1) #1397/feat(run): load phase skills from the installed package when the project doesn't commit them (ADR-0012 follow-up 2) #1398 can load. Also rejected: anenvflag or a settings knob, since there is no case for leaving connectors on in a bypassPermissions agent.git log -S'disableClaudeAiConnectors'shows only docs commits (docs: Upstream assessment for v2.1.296 #1437, docs(graph): graph-2026-10-freeze-b — freeze-safe fixes, second batch (tracker #1452) #1453). Prior fix issues on this artifact: fix(mcp): phase agents receive the user's entire Claude Desktop config — capability over-grant + literal secrets in argv #936 only (one), so this is not a ≥2 recurrence stop. The class is "SDK-side MCP sources", and this closes the claude.ai source. Project.mcp.jsonand plugin sources are unmeasured and tracked as Non-Goals.strictMcpConfig?" (answered above). "Does the setting survivesettingSources: ['project']?" That is measured in the issue table. "Can a project settings file turn connectors back on?" The inlinesettingsflag layer sits above project settings, which AC-1 evidence from smoke(graph-2026-10-freeze-b): amainbuild's phase agent has no claude.ai connectors, runs CC ≥ 2.1.296, and starts a fresh-clone worktree from the PR branch #1451 covers.mcpServers(the onlyquery()call,claude-code.ts) and the SDK's own sources. Consumers are every phase agent. Codex and opencode drivers have their own paths (Non-Goal). Only one producer is touched here, so no parity test is needed.Feature Quality Planning
All standard checks pass. Notable items:
mainbuild's phase agent has no claude.ai connectors, runs CC ≥ 2.1.296, and starts a fresh-clone worktree from the PR branch #1451 rather than claiming it.plugin/,.claude/skills/,templates/skills/) are untouched.Open Questions
Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: one-line option plus a test and a docs paragraph. AC-2 declares unit-test evidence, but a two-case test does not need stubs, so testgen is skipped. No UI, so no
testphase. The issue'sExecution: splitmeans exec runs insequant_run.Label Review
Current: bug, graph-2026-10-freeze-b
Recommended: bug, graph-2026-10-freeze-b, planned
Reason: no change beyond
planned.Quality Loop: won't auto-enable (SCOPE_OK).
admarble commentedon Oct 16, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 2/3 met
Gaps:
mainbuild's phase agent has no claude.ai connectors, runs CC ≥ 2.1.296, and starts a fresh-clone worktree from the PR branch #1451's phase runMutation-verified:line and noSEQUANT_MUTATIONmarker for AC-2. The exec summary and commit message don't have them either. See Mutation Verification below.fix(#1396): disable claude.ai connectors for phase agents (#1464)
admarble commentedon Oct 16, 2026
AC-1 is proven post-merge by #1451's smoke on a
mainbuild (main @ 9f1fb3f): the phase agent'ssystem/initlists only[{"name":"sequant","status":"connected","source":"dynamic"}], with noclaudeaiconnectors, on an account that has them (#1451 (comment)). The fix landed in PR #1464. Closed with owner consent.