Repository navigation
Description
Summary
Tracks extending the project-level toolhive.lock.yaml (RFC THV-0080) with a sibling plugins: key so project-scoped thv ai-plugin installs are pinned the same way skills are: source, resolvedReference, digest, contentDigest, and Sigstore provenance, plus thv ai-plugin sync / thv ai-plugin upgrade, signature verification on consume, and signing on push.
THV-0080 owns only version and skills:; it reserved sibling keys (explicitly plugins:) as a contract proposal for a later RFC to ratify. This issue ratifies that contract without a new RFC: same file, additive plugins: key, schema version stays 1. Older binaries already round-trip unknown top-level keys via Lockfile.Extra; bumping to version 2 would hard-fail mixed-version teams that only use skills.
This is the AI-plugin counterpart of the skills track (#5899). It copies that trust model rather than inventing one, and reuses the packages skills already landed (pkg/skills/lockfile.Entry including provenance/unsigned, pkg/skills/verifier, pkg/skills/signer, cmd/thv/app/exitcode.go).
The feature is gated behind TOOLHIVE_PLUGINS_LOCK_ENABLED for the whole rollout — plugin entries must not become user-visible in the lock until verification is wired, because by then the lock file is the live skills trust document (#6139 removes TOOLHIVE_SKILLS_LOCK_ENABLED). Pinning and Sigstore are one v1, not two independently shippable halves.
Prerequisite: start Stack 1 only after #6139 (skills push-signing + ungate) is merged to main. Do not stack these PRs on skills-sig/14-push-signing-ungate.
Related: #5899 (skills lock + Sigstore), #5525 (plugin lifecycle epic, RFC THV-0077).
User Story
As a team maintaining a project that consumes AI-tool plugins,
I want project-scope plugin installs pinned in the same committed toolhive.lock.yaml as skills, cryptographically verified against the publisher's Sigstore identity, and safely upgradable,
So that every teammate and CI run restores the exact same reviewed plugins, and tampered or re-signed artifacts are detected before they reach a developer's machine.
Agreed design
- Same file, additive key, version 1.
plugins:sits next toskills:. A skill and a plugin may share a name; they are separate graphs. - Full skills parity as one v1: pin on project-scope install,
sync/upgrade, verify on consume, sign on push, TOFUprovenance/unsigned: true. - CLI/API:
thv ai-plugin sync/thv ai-plugin upgradeandPOST /plugins/sync/POST /plugins/upgrade. Do not teachthv skill syncto walkplugins:— that would change existing CI--checksemantics. - Lock only explicit plugin installs.
requiresis parsed today but not materialized;requiredBy/explicitstay unused until that Phase-3 wave. Do not record uninstalled deps. - Client-agnostic. No
clientsfield.contentDigestis the frozen skills dirhash over the canonical plugin tree (whatExtractPluginwrites into the client plugin dir), notmarketplace.json/settings.json. - Reuse, don't extract. Keep
pkg/skills/lockfile; addPlugins []EntryplusGetPlugin/UpsertPlugin/RemovePlugin. Validate skills and plugins as separate name/requiredBy graphs. Import existing verifier/signer. Moving signer into toolhive-core stays a Track: Skills lock file + Sigstore signing (RFC THV-0080) #5899 follow-up. - Project-scope only, matching THV-0080.
- Publishing is keyless-only (revised 2026-09-03). Install-time verification is keyless, so a key-signed plugin fails as
ErrKeySigned— distinct fromErrUnsigned, so--allow-unsignedcannot override it — and the artifact is uninstallable project-scoped.plugins.PushOptionsomitsKeyentirely rather than accepting a value it would have to reject. A--keyflag can only follow install-time key verification (--keypush signing has no install-time verification path (plugins) #6442). - A signed push publishes nothing unsigned at the requested reference (added 2026-09-03). Signing reads the artifact back from the registry, so publication necessarily precedes it; content is therefore staged under its immutable digest and the tag promoted only once the signature is attached. Digest-pinned destinations are refused for signed pushes, since staging and promotion collapse into one operation and no ordering upholds the guarantee.
- A stored bundle binds to the artifact digest (added 2026-09-03). A cosign signature covers a simple-signing payload rather than the artifact, so the payload is persisted with the bundle and every verification checks both that the signature covers those bytes and that those bytes name this artifact. Requires toolhive-core#263.
version: 1
skills:
- name: code-review
source: code-review
digest: sha256:...
provenance: { signerIdentity: "...", certIssuer: "..." }
plugins:
- name: my-plugin
source: my-plugin
resolvedReference: ghcr.io/org/my-plugin:1.0.0
digest: sha256:...
contentDigest: sha256:...
provenance: { signerIdentity: "...", certIssuer: "..." }Acceptance Criteria
Stack 1 — Lock file
- AT: Project-scope
thv ai-plugin installwrites aplugins:entry intoolhive.lock.yamlpinningsource,resolvedReference,digest, andcontentDigest;thv ai-plugin uninstallremoves it. Lock-write failure fails the entire install (rollback DB + dematerialize). (Record plugin installs in the project lock file #6314) - AT:
thv ai-plugin sync --checkdetects drift between the lock file and installed plugins (missing, digest mismatch, on-disk tampering viacontentDigest) and exits with code 2 on failure (Add plugin lock-file sync #6316) - AT:
thv ai-plugin sync --adoptrecords out-of-band installs into the lock;--pruneremoves lock entries for manually deleted plugins (Add plugin lock-file sync #6316) - AT:
thv ai-plugin upgrade --previewshows the candidate change without applying; moving to a different resolved reference requires--allow-ref-change(Add plugin lock-file upgrade #6317) - AT: Sync and upgrade are exposed via
POST /plugins/syncandPOST /plugins/upgradewith typed exit codes for CI (0 success / 2 check failure / 3 partial failure / 4 policy rejection) (Add plugin lock-file sync #6316, Add plugin lock-file upgrade #6317) - Unit: a skills-only lock still loads; unknown top-level keys still round-trip via
Extra; plugin names are unique withinplugins:(not acrossskills:) (Add plugins key to lock file schema #6303)
Stack 2 — Sigstore v1
- AT: Project-scope install verifies OCI artifacts via the Sigstore referrers API and git plugins via gitsign; unsigned artifacts are rejected unless
--allow-unsignedis passed, which recordsunsigned: truein the lock (Verify plugin signatures at install time #6397) - AT: First verified install pins the publisher identity (
provenance.signerIdentity+certIssuer, TOFU); subsequent installs/syncs fail withsigner-mismatchif the identity diverges (Verify plugin signatures at install time #6397) - AT:
thv ai-plugin sync --checkre-verifies stored Sigstore bundles offline (no registry access) against the locked provenance (Re-verify stored plugin signatures during sync #6399; only functional from Sign plugin pushes and remove the lock feature gate #6438 — see below)- Implemented in Re-verify stored plugin signatures during sync #6399, but could not succeed for any normally signed OCI plugin until Sign plugin pushes and remove the lock feature gate #6438. A cosign signature covers the simple-signing payload, and a bundle persisted on its own carried no payload, so re-verifying it against the artifact digest the lock records always failed and every signed plugin reported as drift. toolhive-core#263 settles the contract and Sign plugin pushes and remove the lock feature gate #6438 bumps to it. Found in review of Sign plugin pushes and remove the lock feature gate #6438, not by the tests that ticked this box.
- AT:
thv ai-plugin upgradeblocks candidates whose signer identity or cert issuer changed, with--allow-signer-changeas the explicit override (Block plugin upgrades that change the signer identity #6401) - AT:
thv ai-plugin pushsigns by default via keyless OIDC (--identity-token), attaching the signature to the artifact digest before the requested tag is published;--no-signopts out. Key signing (--key,COSIGN_PASSWORD) is deliberately not offered for plugins: install-time verification is keyless-only, so a key-signed plugin fails asErrKeySigned, which--allow-unsignedcannot override, making the artifact uninstallable project-scoped.plugins.PushOptionsomitsKeyentirely; a plugin--keyflag can only follow install-time key verification (--keypush signing has no install-time verification path (plugins) #6442). (Sign plugin pushes and remove the lock feature gate #6438 — criterion revised 2026-09-03, see comment below) - AT: A signed push never leaves unsigned content at the requested reference: the artifact is staged under its digest, signed, and only then promoted to the tag, so a Fulcio/Rekor/attach failure leaves nothing tagged. Digest-pinned destinations are refused before the first registry operation for signed pushes, and remain allowed under
--no-sign(Sign plugin pushes and remove the lock feature gate #6438 — added 2026-09-03) - AT: Signature material that signs a different artifact is refused as an invalid signature and never reported as unsigned, so
--allow-unsignedcannot wave a transplanted signature through. Requires the toolhive-core#263 binding contract (Sign plugin pushes and remove the lock feature gate #6438 — added 2026-09-03) - Unit: Verified bundles are persisted alongside installed plugins (SQLite) for offline re-verification (Store plugin sigstore bundles, carry git signature #6396, Verify plugin signatures at install time #6397)
- Lock plugin entries validate as exactly one of
provenanceorunsigned: true(sharedpkg/skills/lockfilevalidation, applied to plugin entries since Add plugins key to lock file schema #6303)
Delivery
- Work lands as the 10-PR stacked chain below, each PR independently green
- The 10-PR shape held; the size guideline (400 lines / 10 files) did not. Stack 1 stayed within it; in Stack 2 only Store plugin sigstore bundles, carry git signature #6396 (+161/-30, 7 files) did. Verify plugin signatures at install time #6397 (+1137/-175, 26), Re-verify stored plugin signatures during sync #6399 (+597/-50, 17), Block plugin upgrades that change the signer identity #6401 (+908/-45, 16) and Sign plugin pushes and remove the lock feature gate #6438 (+2635/-527, 60) all exceeded it. Recorded rather than quietly dropped: the verification work did not decompose along the same seams as the lock-file work, and a split was offered on Sign plugin pushes and remove the lock feature gate #6438 three times and not taken.
-
docs/arch/14-plugins-system.mddocuments the v1 trust model (cryptographic verification / TOFU identity / human lock-file review), with a pointer from the lock section indocs/arch/12-skills-system.md(Sign plugin pushes and remove the lock feature gate #6438) -
TOOLHIVE_PLUGINS_LOCK_ENABLEDis removed in the last PR, documented as the user-facing change (Sign plugin pushes and remove the lock feature gate #6438)
Stack 1 — Lock file mechanics
Branch chain: plugins-lock/01-schema → plugins-lock/05-upgrade, each PR targeting the previous one's branch. Feature gated; no provenance wiring yet (entries written only behind the gate, and Stack 2 lands before ungate).
- PR1 — Add
plugins:to the lock file schema (GetPlugin/UpsertPlugin/RemovePlugin, validate as its own graph) (Add plugins key to lock file schema #6303) - PR2 — Add
PluginLockServiceinterface andmanagedflag oninstalled_plugins(Add PluginLockService and managed install flag #6311) - PR3 — Record project-scope plugin installs/uninstalls in the lock file (Record plugin installs in the project lock file #6314)
- PR4 — Add
thv ai-plugin sync: restore project plugins from the lock file (POST /plugins/sync,--check/--adopt/--prune, confirmation gate, exit codes 0/2/3/4) (Add plugin lock-file sync #6316) - PR5 — Add
thv ai-plugin upgrade: re-resolve pinned plugins to newer content (POST /plugins/upgrade,--preview/--allow-ref-change/--fail-on-changes) (Add plugin lock-file upgrade #6317)
Each PR includes its own tests (unit + E2E where applicable) and passes CI independently of the rest of the stack.
Stack 2 — Sigstore signing/verification
Branch chain: plugins-sig/06-bundle → plugins-sig/10-push-ungate. Reuse pkg/skills/verifier and toolhive-core's container/signer (#6383 moved skill signing there; pkg/skills/signer no longer exists); no new Sigstore packages.
Minimum toolhive-core: v0.0.43 (carries toolhive-core#263). Below it, offline bundle re-verification cannot succeed for a cosign-signed artifact and signature-to-artifact binding is unchecked. Tagged 2026-09-03 and pinned in #6438 (on main as of the merge); the interim pseudo-version is gone.
- PR6 — Sigstore bundle blob for plugin installs + git commit-signature plumbing (Store plugin sigstore bundles, carry git signature #6396)
- PR7 — Install-time verification, TOFU recording,
--allow-unsigned(Verify plugin signatures at install time #6397) - PR8 — Offline bundle re-verify in
sync --check(Re-verify stored plugin signatures during sync #6399) - PR9 — Upgrade signer-change guard +
--allow-signer-change(Block plugin upgrades that change the signer identity #6401) - PR10 — Push signing + trust-state display on
ai-plugin info/ install; docs; removes theTOOLHIVE_PLUGINS_LOCK_ENABLEDgate (the point the feature is fully "landed") (Sign plugin pushes and remove the lock feature gate #6438)- Grew past the original scope during review, all of it trust-correctness rather than feature work: staged-then-promoted push ordering and refusal of digest-pinned signed destinations; the toolhive-core#263 bump and removal of the two local reconstructions it replaces; rematerialization when an install first locks a record; and explicit consent to migrate a lock entry that records no trust decision.
Follow-ups (tracked separately once reached)
- Plugin
requiresmaterialization andrequiredBylocking (not installed today; a later Phase-3 wave) - Sigstore-staging E2E for plugin push (same deferral as skills; keyless OIDC push signing itself landed in Sign plugin pushes and remove the lock feature gate #6438)
- Catalog-supplied expected identity (needs toolhive-core
Provenanceon plugin types) - Unified
thv lock syncthat walks bothskills:andplugins: - Extracting
pkg/skills/lockfile/ signer into a generic package (signer move into toolhive-core is already sequenced after Track: Skills lock file + Sigstore signing (RFC THV-0080) #5899 PR14) - Example repo (skills has
stacklok/toolhive-skills-lock-example)
Out of scope (v1)
- Version-constraint resolution or a
toolhive.yamlmanifest - Per-client pinning (
clientsfield) - User-scope lock entries
- Org-wide signer policy files
Definition of done
- Sign pushes by default and remove the lock feature gate #6139 merged to
mainbefore Stack 1 starts. - All Stack 1 PRs merged with CI green (including CodeQL).
- All Stack 2 PRs merged.
TOOLHIVE_PLUGINS_LOCK_ENABLEDgate removed in PR10, documented as the user-facing change.- toolhive-core pinned to a tagged release containing Add a method to rotate encryption password #263 — not a pseudo-version. Met: v0.0.43.
Activity
samuv commentedon Aug 13, 2026
#6139 is merged. Stack 1 is unblocked.
PR1 is up: #6303 —
plugins:schema ontoolhive.lock.yaml(version stays 1). No callers yet; install hooks land in PR3.samuv commentedon Aug 13, 2026
Prerequisite met. #6139 is merged, so Stack 1 here is unblocked.
mainnow has noTOOLHIVE_SKILLS_LOCK_ENABLEDand nopkg/skills/feature_gate.go, which also means the gating pattern this issue describes forTOOLHIVE_PLUGINS_LOCK_ENABLEDhas no sibling left to copy — the skills gate and its tests are gone from the tree, so it will need writing fresh rather than mirroring.Two pointers in the description are now stale:
container/signer, so only deleting toolhive's copy remains, blocked on a core release.pkg/skills/lockfile.Entry,pkg/skills/verifier,pkg/skills/signer)" —pkg/skills/signeris on its way out. Import core'scontainer/signerfor anything new rather than adding a consumer to a package scheduled for deletion.One API change to be aware of when reusing the signer: core's
SignOCIreturns*Result{Bundle, PayloadDigest}, not[]byte, and the payload digest is not the artifact digest — passing the artifact digest to a bundle verifier always fails. Core exportsPayloadDigest(ref, digest)for consumers holding only a reference.Also relevant to the
plugins:design here:thv ai-pluginreached parity withthv skillon two fixes released in v0.42.1 — relative--project-root(#6226) and pull-sized timeouts plus a distinct request-timeout error (#6228).PluginsRouternow has per-route timeouts and the plugins client honoursTOOLHIVE_API_TIMEOUT, so sync/upgrade endpoints added here should follow that pattern rather than the flat 60s one.samuv commentedon Aug 13, 2026
PR2 is up: #6311 —
PluginLockService+installed_plugins.managed. No callers yet; install hooks land in PR3.samuv commentedon Aug 20, 2026
Status update — Stack 1 complete.
All five lock-file mechanics PRs are merged to
main:plugins:lock schemaPluginLockService+managedflagthv ai-plugin sync(--check/--adopt/--prune,POST /plugins/sync, exit codes 0/2/3/4)thv ai-plugin upgrade(--preview/--allow-ref-change/--fail-on-changes,POST /plugins/upgrade)All Stack 1 acceptance criteria are checked off in the body. The feature remains gated behind
TOOLHIVE_PLUGINS_LOCK_ENABLEDas planned — nothing is user-visible until Stack 2 lands and PR10 removes the gate.One design note for Stack 2: the body said to reuse
pkg/skills/signer, but #6383 has since moved skill signing to toolhive-core'scontainer/signer(and #6385/#6390 are adding keyless identity-token plumbing on top). I've updated the Stack 2 header accordingly — plugin push signing (PR10) should build on the toolhive-core signer, andpkg/skills/verifieris still the verification entry point for PRs 6–9.Next:
plugins-sig/06-bundle(PR6 — Sigstore bundle persistence for plugin installs + git commit-signature plumbing).Store plugin sigstore bundles, carry git signature (#6396)
Block plugin upgrades that change the signer
Adapt plugin verify to ProvenanceExpectation
33 remaining items
Drop --key from plugin push
samuv commentedon Sep 1, 2026
Status update — Stack 2 is four-fifths merged; only PR10 remains.
Merged since the last update:
installed_plugins.sigstore_bundle) + git commit-signature plumbing--allow-unsignedsync --check, adopt trust decisions--allow-signer-changeAll Stack 2 acceptance criteria except push signing are checked off in the body. The provenance-xor-unsigned validation criterion was already satisfied by the shared
pkg/skills/lockfilevalidation (in place for plugin entries since #6303), now marked.Remaining: #6438 — PR10 (push signing by default via toolhive-core's signer with keyless parity, trust-state display on
ai-plugin info/install, arch docs, and removal ofTOOLHIVE_PLUGINS_LOCK_ENABLED). CI is green; it's in active review with changes requested. Once it merges, the Delivery checklist and Definition of Done are complete and this issue can close.Sign plugin pushes and remove the lock gate
Document the plugins trust model
Address review on plugin push signing
Drop --key from plugin push
samuv commentedon Sep 3, 2026
Ratifying the Stack-2 push-signing criterion as keyless-only
Revised the
thv ai-plugin pushacceptance criterion and the matching follow-up entry, per the review on #6438. Recording the reasoning here rather than leaving the edit unexplained.The criterion and the deferral were inverted relative to what shipped. The AC required signing with a cosign key (
--key,COSIGN_PASSWORD), while the follow-up list deferred "Keyless OIDC push signing". #6438 delivers keyless and offers no key, so the tracker described neither the design nor the delivery.Keyless-only is not a shortcut — a key path would produce artifacts nobody can install. Install-time verification is keyless-only, so a key-signed plugin fails as
ErrKeySigned. That verdict is deliberately distinct fromErrUnsigned, which means--allow-unsignedcannot override it and the plugin is uninstallable project-scoped. Accepting--keyat push time would let people publish artifacts that every consumer refuses.plugins.PushOptionstherefore omits the field entirely, so the unsupported request cannot be constructed by any caller, in-process or over HTTP.A plugin
--keyflag can only follow install-time key verification, which is #6442.What changed:
--identity-token) and states why key signing is excluded.Nothing else in the issue is touched, and the previous wording is in the edit history if this reading is wrong.
samuv commentedon Sep 3, 2026
Bringing the criteria and the stack steps in line with what was actually built
Second pass on the tracker, beyond the keyless-only ratification above. Three things had drifted from reality; the edit history has the previous wording.
1. One ticked criterion was not true when it was ticked. "
sync --checkre-verifies stored Sigstore bundles offline" was marked done at #6399, and it could not have worked for any normally signed OCI plugin. A cosign signature covers the simple-signing payload rather than the artifact, and a bundle persisted on its own carried no payload — so re-verifying it against the artifact digest the lock records always failed, and every signed plugin reported as drift. It is functional from #6438, which bumps to toolhive-core#263. Left ticked with the qualification attached rather than un-ticked, because the code did land in #6399; what was missing was underneath it. Worth noting it was found by review of #6438 and not by the tests that ticked the box.2. Two acceptance criteria were missing entirely — both trust properties that came out of reviewing #6438, not new features:
--no-sign).--allow-unsignedcannot wave a transplanted signature through.The matching design decisions are now in Agreed design, alongside keyless-only publishing, so the reasoning is not buried in PR threads.
3. The size guideline was missed and the box said nothing about it. The 10-PR shape held; the 400-line / 10-file budget did not. Stack 1 stayed inside it. In Stack 2 only #6396 (+161/-30, 7 files) did — #6397 (+1137/-175, 26), #6399 (+597/-50, 17), #6401 (+908/-45, 16) and #6438 (+2635/-527, 60) all exceeded it. That is now stated rather than left as an unchecked box implying it is still pending. A split was offered on #6438 three times and not taken.
Also recorded: Stack 2 now declares a minimum toolhive-core (the release carrying #263) and the Definition of done requires a tagged release, not the pseudo-version #6438 currently pins. PR10's entry lists the trust-correctness work it picked up in review.
Delivery items 2 and 3 (docs, gate removal) are implemented in #6438 and left unchecked until it merges, matching how every other box here is used.
Sign plugin pushes and remove the lock gate
Document the plugins trust model
Address review on plugin push signing
Drop --key from plugin push
Sign plugin pushes and remove the lock feature gate (#6438)
samuv commentedon Sep 3, 2026
Complete — closing
#6438 merged at 14:04 UTC today, which was the last of the ten PRs and the point the gate came off. Verified against
mainrather than against the PR list:TOOLHIVE_PLUGINS_LOCK_ENABLEDno longer appears in any Go source onmain.docs/arch/14-plugins-system.mddocuments the trust model onmain, with the pointer fromdocs/arch/12-skills-system.md.go.modonmainpinstoolhive-core v0.0.43— the tagged release carrying toolhive-core#263, not a pseudo-version.Every acceptance criterion and delivery item is now checked.
Two things this issue records that are worth carrying forward rather than losing on close:
"
sync --checkre-verifies stored bundles offline" was ticked at Re-verify stored plugin signatures during sync #6399 and was not true. A cosign signature covers the simple-signing payload, and a bundle persisted alone carried no payload, so re-verification against the locked artifact digest always failed and every signed plugin reported as drift. It became functional only with the toolhive-core#263 bump in Sign plugin pushes and remove the lock feature gate #6438. It was found by review of Sign plugin pushes and remove the lock feature gate #6438, not by the tests that ticked the box — the tests round-tripped a value that made the inconsistency invisible.The size guideline was missed by four of the five Stack-2 PRs, recorded in the Delivery section with the numbers. The 10-PR shape held; the 400-line / 10-file budget did not, and the verification work did not decompose along the same seams the lock-file work did. Worth weighing when the next trust-model stack is planned.
Follow-ups stay tracked in the section above and are not blocked by this closing: plugin
requiresmaterialization, Sigstore-staging E2E for push, catalog-supplied expected identity, a unifiedthv lock sync, extracting the lockfile/signer packages, and an example repo. Install-time key verification is #6442, which is what a plugin--keyflag depends on.