Step 8: Prove it fails safely¶
Preview: coming in Artifact Keeper 1.12.0
The agentplugins format is not in a released version of Artifact Keeper yet. It first
ships in 1.12.0. Until then this walkthrough runs a development build from main
(sha-c3a650e) and a CLI prerelease (v1.11.0-rc.2), so details may still change before
the release.
A registry earns trust by what it refuses. The ten gates in
gates/
run every refusal this walkthrough relies on, and make gates repeats them at any time. Each
check prints one verdict (PASS, FAIL, or BLOCKED with the reason) and asserts on
status codes, exit codes and documents, never on message text. Gates that need clean state
work in scratch repositories they recreate on every run, so the walkthrough's own repositories
stay as the earlier steps left them. The verdicts and timings of the reference run are on the
results page.
G1 Auth¶
g01-auth.sh runs the access matrix from Step 7:
anonymous 401, the read token 200 but 403 on publish, a token for another repository
refused, a bogus path token 401, the public repository 200 with no credentials. Then it
greps every file git tracks for every token value, the admin password, and token-shaped
strings in URLs and headers. None.
G2 Publish rules¶
g02-publish-rules.sh publishes a valid plugin, then tries to
overwrite it (same bytes, then different bytes: both 409) and sends the ten ambiguous uploads
from Step 3: no manifest, a mismatched name or version, 1.0.0+build, 1.0,
an uppercase slug, a ../ entry, a symbolic link, a wrong file name, a wrong
X-Checksum-Sha256. Every one is 400, and afterwards the five documents list exactly the
valid publish and no refused name has an index.json. The fixtures are built by
mkzip.py, because zip will not write a ../ entry.
G3 Index contract¶
g03-index-contract.sh holds the documents to the rules Claude
Code enforces: marketplace and entry names match ^[A-Za-z0-9][A-Za-z0-9._-]*$ with no
.., owner.name present, every source an archive with an https URL and a 64-hex
sha256, every entry's version equal to the version in its path. It downloads every archive
and compares the bytes with the sha256. In a scratch repository it publishes one plugin per
layout plus a plugin whose 2.0.0 is Cursor-only, and checks each document's membership and
chosen version:
marketplace.json: g3-claude@1.0.0,g3-codex@1.0.0,g3-cursor@1.0.0,g3-mixed@2.0.0,g3-plain@1.0.0,g3-pre@2.0.0-rc.1,g3-standard@1.0.0
claude-marketplace.json: g3-claude@1.0.0,g3-mixed@1.0.0,g3-plain@1.0.0,g3-pre@2.0.0-rc.1,g3-standard@1.0.0
cursor-marketplace.json: g3-cursor@1.0.0,g3-mixed@2.0.0,g3-standard@1.0.0
codex-marketplace.json: g3-codex@1.0.0,g3-standard@1.0.0
vscode-marketplace.json: g3-standard@1.0.0
g3-plain has a root plugin.json without the Standard $schema next to its Claude
manifest: the registry treats that file as content, not a marker. g3-pre shows SemVer
ordering, 2.0.0-rc.1 above 1.9.0. Then the caching rules: an ETag with 304 on
If-None-Match, Cache-Control: no-cache on plain routes, private, no-store on the token
route and its archives, and token-route archive URLs that keep the token prefix.
One check reports BLOCKED(F1): the backend documents Referrer-Policy: no-referrer on the
token route, but the build used here sends strict-origin-when-cross-origin, because its
global security-headers layer overwrites the route's value. Caddy restores no-referrer in this
deployment, so the check on the wire passes; the check against the backend directly stays
blocked until the backend is fixed (lab notes, F1).
G4 Claude Code end to end¶
g04-claude-code.sh does Step 4's
settings route in a fresh home and checks the result rather than the messages: the marketplace
is not registered before a session starts and is afterwards, with its URL; acme-review is
installed and enabled at the registry's latest version; the skill, command, agent and hook are
in the cache; the cache is byte-identical to the published zip (diff -r against the
downloaded zip); the Standard plugin installs with its skills; claude plugin details works.
Using the plugin in a session is BLOCKED(account), with the commands to run after
/login.
G5 Tampering¶
g05-tampering.sh builds a mirror, https://mirror.internal
(static files from Caddy, a certificate from the same CA), that serves the registry's genuine
acme-review/index.json and marketplace entry, sha256 unchanged, but a zip with one line
added to the review skill:
That is the attack: a cache, a proxy or a compromised mirror that serves different bytes under
the same name. ak agent plugins install against the mirror exits non-zero and installs
nothing; the same command against the registry succeeds. claude plugin install from a
marketplace on the mirror exits non-zero, and nothing is listed or cached. Both name the two
digests:
× Server error: The download of acme-review 1.1.0 has SHA-256
│ 19abe6444a523a529f649a696bd9a5012cf1b726f1be0f548466756ce614029e,
│ and the index says
│ f248747d0f02e9575bdc1b1f9b0af7c612f7d8b354df8ce8fd2658131f5d40e2. Nothing
│ was installed
✘ Failed to install plugin "acme-review@tampered-mirror": Plugin archive integrity check failed for
https://mirror.internal/agentplugins/agent-plugins/acme-review/1.1.0/acme-review-1.1.0.zip: expected sha256
f248747d0f02e9575bdc1b1f9b0af7c612f7d8b354df8ce8fd2658131f5d40e2, got
19abe6444a523a529f649a696bd9a5012cf1b726f1be0f548466756ce614029e. The archive was not installed.
The sha256 in the document is only as trustworthy as the document, which is why the documents
come from the registry over TLS and the archives must come from the same origin.
G6 Immutability after delete¶
g06-immutability.sh publishes 1.0.0 and 1.1.0, deletes 1.1.0
through the REST API, and checks that every document falls back to 1.0.0 at once and the
deleted download is 404. Re-publishing 1.1.0 with different bytes is 409: a version
number, once used, means those bytes forever, because Claude Code downloads again only when the
version changes. Re-publishing the identical bytes is 201 and restores it.
G7 Scan gate¶
g07-scan-gate.sh uses a scratch repository with a
block_unscanned policy and scans on request. An unscanned 1.0.0 downloads 403 and has no
index.json; after its scan it is listed. An unscanned 1.1.0 is hidden from the documents and
index.json (they keep listing 1.0.0) and downloads 403; after its scan it is the listed
version and downloads 200.
G8 ak harness installs¶
g08-cli-harnesses.sh installs a plugin for all four harnesses
at 1.0.0 with 1.1.0 on the server. Every directory exists with a correct
.ak/plugin-info.json; the local Claude Code and Codex marketplaces list it; Claude Code,
Codex and Copilot report it through their own CLIs. list --check-updates says behind for
all four, update --all makes them current, and after the server drops 1.1.0 they are
ahead. uninstall removes the directories and the marketplace entries ak wrote. A
session in each agent is BLOCKED(account).
G9 Generic upload¶
g09-generic-upload.sh writes a valid plugin zip into the
repository through the generic artifact API, once at a path that looks like a new version of a
published plugin and once for a name that exists nowhere else. The upload is accepted (peer
replication delivers through that API), but the format ignores both: index.json lists only
the native version, the native download of the side-loaded one is 404, and the side-loaded
name has no index.json. Only what passed the publish rules is ever served.
G10 Token hygiene¶
g10-token-hygiene.sh requests a marketplace document and an
archive with the token in the path, then reads both logs since that moment: the token appears in
neither; Caddy's access log shows /agentplugins/t/REDACTED/... for both URLs and REDACTED
for an Authorization header; the backend logs /agentplugins/t/[REDACTED]/.... On the
client side it states what the token-in-path route costs: in the claude-token home the token
is in settings.json, known_marketplaces.json and the cached marketplace. In the
claude-settings home it is only in settings.json and Claude Code's copy of that entry in
known_marketplaces.json, never in a URL.
Now the results.