Skip to content

[FEATURE] Portable, content-bound approval for transitive MCP servers in apm.yml #3902

Closed

Description

Problem

Since 0.36.0 (#3716), transitive MCP servers that define their own command or endpoint need --trust-transitive-mcp on every apm install or apm update, and the lockfile no longer carries that consent. That keeps bots and lockfile edits from granting trust, but it has two costs:

  • Not portable. One teammate runs with the flag and the server is deployed; the next runs without it and the server is removed. .mcp.json and apm.lock.yaml flip depending on who ran the command, and --frozen cannot reproduce the result.
  • Weak in practice. Teams put the flag in CI scripts, so it trusts every transitive MCP server, including ones added later, and leaves no review artifact.

Separately, apm install --frozen runs its own MCP comparison that ignores the executables gate, so a frozen install of a gate-parked server fails (found in #3893).

Proposal

Record transitive MCP trust in apm.yml, the reviewed manifest, next to existing executables approvals:

  • An approval binds to the declaring package, the server name and a fingerprint of its definition (command, args, env keys and values or references, url, headers). If an upstream change alters the definition, APM leaves the server out and warns until it is re-approved.
  • apm approve <pkg> lists the MCP servers the package brings (with command or URL) before recording approval.
  • Org policy (mcp.transport.allow, executables policy) still wins over local approval. The lockfile records only what was deployed or omitted and why, never consent.
  • --trust-transitive-mcp stays for one-off runs and warns that it does not persist.
  • Check whether existing hook approvals bind to content or only to the package version; if only to the version, give them the same content binding.
  • apm install --frozen applies the executables gate the same way as install and audit.

Precedent: pnpm 10 onlyBuiltDependencies / pnpm approve-builds, Bun trustedDependencies.

Done when

Two clones with the same apm.yml and apm.lock.yaml produce the same .mcp.json and lock without any flag; --frozen and apm audit --ci pass; a changed upstream server definition is omitted with a re-approve message; a lockfile-only edit cannot grant trust.

Activity

  1. danielmeppiel commented on Nov 19, 2026

    @danielmeppiel
    CollaboratorAuthor

    Decision: approve
    Area: project
    Scope: Record transitive MCP server trust in apm.yml alongside executables approvals, bound to the declaring package, server name and a fingerprint of the server definition; extend apm approve to list and record MCP servers; keep --trust-transitive-mcp as a non-persistent one-off with a warning; give hook approvals the same content binding if they bind only to version; make apm install --frozen apply the executables gate consistently with install and audit.
    Done when: Two clones with the same apm.yml and apm.lock.yaml produce identical .mcp.json and lockfile without flags; --frozen and apm audit --ci pass; a changed upstream definition is omitted with a re-approve message; a lockfile-only edit cannot grant trust; lifecycle tests cover each case and fail before the change; docs, apm-usage skill and CHANGELOG updated.
    Out of scope: Storing consent in apm.lock.yaml; changes to org policy semantics; runtime tool permissions inside harnesses.
    Review contact: Daniel Meppiel (@danielmeppiel)

  2. danielmeppiel commented on Nov 19, 2026

    @danielmeppiel
    CollaboratorAuthor

    Decision: approve
    Area: project
    Scope: Supersedes the earlier record on this issue; it reflects the approved design (revision 2, Daniel 2026-11-19) delivered in ONE PR. One trust owner (security/trust.py admit = org deny ladder AND manifest item grant AND definition fingerprint match) with one fingerprint owner (full SHA-256, canonical JSON), used by install, update, install --frozen, apm audit --ci, apm approve and the install prompt. Content-pinned item grants in apm.yml executables.allow...: sha256:<64 hex> for MCP servers (direct and transitive, including registry-resolved overlays, which apm approve refuses to pin offline) and per hook file. apm approve lists definitions and records pins; the first project approval confirms on a TTY and warns otherwise. Legacy true approvals are still read and WARN in 0.37 with the re-approve remedy; legacy mcp: true never satisfies transitive trust. --trust-transitive-mcp stays as a one-off that warns it does not persist. --user grants stay local and audit never reads them. apm install --frozen applies the gate like install. audit --ci enforces consent. The lockfile records evidence only (new mcp_omissions reasons definition-changed and denied), never consent. Spec amendment 0.1.64 (req-sc-016; req-sc-011 extended to frozen).
    Done when: Every row of the design's blast-radius matrix has a test (real-binary lifecycle for the user flows) that fails before the change; two clones give identical .mcp.json and lock without flags; a changed definition is parked with a re-approve message; a lockfile-only edit cannot grant trust; guards and MutationCases for the owners; docs, apm-usage skill and one-line CHANGELOG entries with BREAKING and upgrade notes (audit consent, APM >= 0.37 for pinned grants); supply-chain and devx-ux review on the PR; apm-spec-guardian fold_and_ship on the spec diff.
    Out of scope: Parking name conflicts between two declarers (D10); apm approve -g (D7); enforcing org mcp.trust_transitive; storing consent in apm.lock.yaml; org policy semantics.
    Review contact: Daniel Meppiel (@danielmeppiel)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/acceptedHuman scope approval; verify the issue's approval record and review contact before work.type/featureNew capability, new flag, new primitive.

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions