Repository navigation
Description
Context
Follow-up to #1670 / PR #1765, which added a harness-specific extra passthrough to MCPDependency so keys like Claude Code's remote-MCP oauth block (clientId / callbackPort) survive apm.yml -> generated .mcp.json rendering instead of being silently dropped.
PR #1765 ships the bare-key ergonomics: any unknown top-level key on a self-defined MCP dependency is auto-captured into extra (matching the documented oauth: examples). It also adds a modeled-field-name denylist (a passthrough value can never shadow/redirect name/transport/command/url/headers/env/... or the Codex http_headers alias) so the concrete injection edge is closed.
The deferred tightening
The supply-chain-security review lens flagged that auto-capturing bare unknown keys is fail-open: a transitive dependency package's apm.yml is parsed straight through from_dict, and the prior contract dropped unknown keys (fail-closed) whereas the new contract preserves them. The denylist closes the high-severity shadow/redirect edge, but the residual posture question remains: should passthrough require an explicit extra: block and drop bare unknown keys with a warning (fail-closed), so only keys the author deliberately nests under extra: flow through?
This was deliberately sequenced out of #1765 by maintainer decision (Option B + denylist) because it is a user-facing authoring-contract change (the documented examples use bare top-level oauth:), i.e. a breaking change that needs a deprecation path rather than a silent flip.
Proposed scope (this issue)
- Introduce explicit
extra:as the only sanctioned passthrough surface. - Deprecation window: keep capturing bare unknown keys, but emit a deprecation warning instructing authors to nest them under
extra:. After the window, drop bare unknown keys (restore fail-closed drop-and-warn). - Rewrite the three doc examples (
install-mcp-servers.md,reference/manifest-schema.md,apm-usage/dependencies.md) to nestoauth:underextra:. - Update
test_mcp_from_dict_unknown_keys.pyexpectations accordingly.
Also captured here (deferred from #1765, non-blocking)
- Per-harness scoping:
extra: { copilot: {...}, codex: {...} }so a Claude-specific block is not broadcast to every target. - Secret-shaped-value scan: warn when an
extravalue looks like a token/secret being written to a world-readable config. to_dictcollision debug-warn: emit a debug log when anextrakey shadows a known field during re-serialization.
Why not now
Per the PR #1765 maintainer decision, #1765 keeps bare-key ergonomics + denylist (closes the concrete trust-boundary edge) and defers this fail-closed contract tightening here so the posture change is explicit, deprecation-gated, and reviewable on its own.
/cc the #1670 thread.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
fix(mcp): denylist modeled-field names in extra passthrough (#1670)
github-actions commentedon Jun 18, 2026
Triage decision
needs-design
Proposed labels
Milestone
null
Suggested next action
Write a mini-design doc (or inline comments on this issue) covering: (1) deprecation window timeline and warning UX, (2) the per-harness
extra: { copilot: {...} }schema definition, and (3) the secret-detection heuristic, then link it back here.Suggested issue comment
Per-lens notes (collapsed)
DevX UX Expert -- User-Need Reviewer
The request maps directly to the
area/mcp-configauthoring surface: authors who writeoauth:as a bare top-level key in an MCP dependency block need a clear migration path when the contract tightens. The deprecation window (warn -> drop) matches the npm deprecation and pip removed-feature patterns. Theextra:nesting is a one-line change perapm.ymlfile; the UX cost is low given the security benefit. The three doc files named in the body are the canonical surfaces that must be updated before any user encounters the new behavior.Supply Chain Security Expert -- Risk-Surface Reviewer
This issue tightens a fail-open surface introduced in #1765: bare unknown top-level keys on MCPDependency being auto-captured into passthrough. Moving to explicit
extra:-only restores the fail-closed default, preventing transitive dependency packages from silently passing through arbitrary unknown keys to MCP server config. The existing denylist (#1765) blocks shadow/redirect of known fields; this change blocks silent passthrough of arbitrary unknowns from transitive sources.theme/securityandarea/mcp-trustare the right labels. The per-harness scoping sub-item and secret-shaped-value scan are additive improvements. No escalation beyond existing labels needed.OSS Growth Hacker -- Contributor-Tone Reviewer
Not activated -- danielmeppiel is a COLLABORATOR with deep context on the issue history; standard maintainer-to-maintainer tone is appropriate with no first-timer adjustment.
Python Architect -- Architecture Reviewer
The core tightening (fail-open -> fail-closed with deprecation warning) is bounded to
MCPDependency.from_dict()plus the three doc files and test updates. The per-harness scoping sub-item is an additive schema change that needs a formal field-shape decision before implementation. The secret-detection heuristic is also design-dependent (false-positive risk on legitimate values). The currentstatus/needs-designis correct: the core tightening is independently implementable once the three sub-item designs are documented. The issue could be split for faster progress on the core tightening, but that is a maintainer call.Doc Writer -- Documentation Reviewer
Three doc files are explicitly named in the acceptance criteria:
install-mcp-servers.md,reference/manifest-schema.md, andapm-usage/dependencies.md. All three will be factually wrong the moment the deprecation warning appears. The implementing PR MUST update all three in the same diff. Anarea/docs-sitesecondary label would be appropriate but is omitted here to stay within the 6-label limit (existing maintainer-applied labels already fill it); the doc requirement is noted in the suggested comment instead.APM CEO -- Triage Arbiter
The issue is correctly labeled by the maintainer;
status/needs-designholds because the deprecation window timeline, per-harness schema, and secret heuristic are unresolved design decisions. Addingstatus/triagedcloses the sweep loop. The suggested comment asks for exactly the three documented design decisions needed before implementation, which is the right unblocking action. No milestone (needs-design issues are milestone-free per rubric). No priority per rubric.{ "decision": "needs-design", "decision_detail": "Three sub-items require design documentation: deprecation window timeline and warning UX, per-harness extra: schema definition, and secret-detection heuristic.", "theme": "theme/security", "areas": ["area/mcp-config", "area/mcp-trust"], "type": "type/feature", "status": "status/needs-design", "priority": null, "preserved_labels": ["breaking-change"], "milestone": null, "next_action": "Write a mini-design doc covering the deprecation window timeline, per-harness extra: schema, and secret-detection heuristic, then link it back here.", "comment_markdown": "Thanks for the detailed write-up on the deprecation path for the `extra:` tightening! The direction is well-grounded: moving to explicit `extra:`-only (fail-closed) is the right supply-chain posture, and the deprecation window approach balances the authoring-contract change against a smooth migration for authors currently using bare `oauth:` syntax. Before implementation lands, three design decisions need to be documented: (1) Deprecation window and warning UX -- which apm versions carry the warning-only mode and what does the message say? (2) Per-harness `extra:` schema -- is the harness key a known target name or freeform? (3) Secret-detection heuristic -- what patterns trigger the warning to avoid false positives? Once those three are documented, the implementation scope is deterministic. Doc rewrites for install-mcp-servers.md, manifest-schema.md, and apm-usage/dependencies.md are part of the acceptance criteria." }Add extra passthrough for harness-specific MCP keys (microsoft#1670) (m…