Skip to content

fix(cli): install skill content from a pinned release, not a branch - #93

Open
MajorLift wants to merge 2 commits into
mainfrom
jongsun/docs/skills-threat-model
Open

fix(cli): install skill content from a pinned release, not a branch#93
MajorLift wants to merge 2 commits into
mainfrom
jongsun/docs/skills-threat-model

Conversation

@MajorLift

@MajorLift MajorLift commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Overview

A lockfile entry pinned the @metamask/skills CLI, never the skill content: ensurePublicSkillsCache cloned --branch main, tools/bootstrap defaulted SKILLS_REF to main — no pin, no checksum. That content is instructions a coding agent loads, plus executable scripts/ and adapters/.

Both now pin to a release tag and fail closed when it is missing — the CLI from its package version (0.2.0v0.2.0), bootstrap via git ls-remote --tags. SKILLS_REF still overrides, now a warned opt-in rather than the default.

Engineer checkouts via METAMASK_SKILLS_DIR are untouched — a working copy, not a delivery channel; tools/sync still pulls --ff-only there.

The trade: a skill merged today ships on the next tagged release, not immediately.

Showcase

Security review is the gate. Open for it, untouched here: whether scripts/ and adapters/ should ship at all, and under what review.

Every check exercises the tag-exists path; fail-closed behavior and the SKILLS_REF warning are stated, not demonstrated. Branch protection on main is unasserted — the endpoint 404s to a non-admin token, which does not distinguish "no rule" from "no permission".

Skills are auto-loaded instructions distributed to engineers' agents across the
org, alongside executable payloads written into agent-trusted paths. The repo's
security posture does not describe that channel anywhere.

Describes three channels — instruction, execution, delivery — with the state of
each verified against the tree: `copy_bundle_dirs` ships `scripts` and
`adapters` (7 payloads today), `tools/sync` pulls from a tracked branch rather
than a reviewed ref, and `tools/bootstrap` is documented as `curl | bash` from
`main` with no checksum. The package is lockfile-pinned; the content it installs
is not, and that distinction is the crux.

States the existing controls with equal care, since the risk is easy to
overstate: auto-update is opt-in behind `SKILLS_AUTO_UPDATE`, this package
declares no `postinstall` of its own, `--ff-only` breaks rather than silently
applying a rewritten history, and CLI distribution is already review-gated.

Descriptive, not a proposal — the five open decisions are listed for the
security team to rule on rather than settled here. Also flags that SECURITY.md
describes the repo as prompt templates with no runtime code, which does not
account for the published CLI or the shipped executables.

Raised during ADR 0057 review (MetaMask/decisions#162).
A lockfile entry pins the `@metamask/skills` CLI. It never pinned the skill
revision that reaches disk: the cache cloned and reset to `main`, so an install
pinned in a lockfile still picked up whatever had merged since, and the
documented `curl … | bash` bootstrap did the same for cloud agents.

The CLI now derives the content ref from its own package version, so one
lockfile entry pins both halves. `tools/bootstrap` resolves the newest release
tag over `git ls-remote` instead of defaulting to `main`.

Both fail closed. A missing tag means this package version has no published
content, and widening to a branch at that point would reinstate the channel
being removed — so the CLI warns and declines, and bootstrap exits non-zero
naming the override.

`SKILLS_REF` still overrides, for development against `main` and for holding a
consumer on a specific release. It is now a deliberate opt-in to a mutable ref
rather than the default, and taking it warns.

Engineer-owned checkouts reached through `METAMASK_SKILLS_DIR` are untouched;
that is their working copy, not a delivery channel.
@MajorLift
MajorLift marked this pull request as draft July 30, 2026 19:21
@MajorLift MajorLift changed the title docs(security): document the skill-delivery threat model fix(cli): install skill content from a pinned release, not a branch Jul 30, 2026
@MajorLift
MajorLift marked this pull request as ready for review August 20, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant