Serve the agent CLI only to agents #118
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/authenticated-cli-downloads"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The agent CLI download endpoints were unauthenticated. Anyone who could reach the server could pull an 84 MB binary, and that anonymous conveyance was the only reason this repository carried third-party notices: the compiled binaries embed Bun, which statically links JavaScriptCore and tinycc under the LGPL. LGPL duties attach on conveying to others, not on private use.
Gate
handlePublicAgentRouteruns beforeauthenticate, so it validates viaresolveBearerTokenitself.?install=<otp>, threaded into the release URLs bypublicAgentCliManifest. The grant is inspected, never consumed, so downloading does not cost the caller the exchange the same link still owes. Once exchanged it stops opening downloads.privatewithVary: Authorization.sha256, plusinstallwhen present.The updater would otherwise have broken silently:
downloadReleaseused a barefetchwith no credentials and now goes through the client's authenticatedrawRequest. A skill-only update carries a stub that throws, pinning the invariant that it must never reach for a release.Removal
With no anonymous conveyance left, the notices, relinking guide, relinkable bundles, and the generator have nothing to serve. This also retires
notices:check, whose committed output (245 packages, rolldown 1.2.1) had drifted from the lockfile (212, rolldown 1.2.5) and failed on any clean checkout.Second commit
The bootstrap smoke asserted that reusing a spent grant fails with 410, but the assertion could never match:
--jsonwrites the error document to stdout while the helper built its rejection from stderr alone. The failure predates this branch;d82ca9ffails it identically, verified by checking that commit out and reproducing.Verification
typecheck, lint, knip, format:check clean. agent-access, build-config, agent-config-distribution, agent-integration-update, validator-schemas pass.
build:agent-cliproduces a valid manifest andsmoke:agent-bootstrappasses end to end, exercising the gated bootstrap download with a real compiled binary.Deploy ordering, not optional
The installed CLI at
d82ca9fdownloads anonymously. The moment this server is live that CLI cannot self-update, including to the build that fixes it. Order must be: build the new CLI, deploy the server, then replace the local binary once by hand. Agents installed after that update normally.kReview review
Verdict: no findings
No findings to address in the reviewed diff.
No findings to address across the reviewed diff.
Reviewed by kReview at
a156789835. This comment is conservative and based only on the PR diff, metadata, and supplied repository context.Est. cost ~$6.34 total (2.7M in / 10.0k out) · this run ~$2.84 (1.0M in / 4.8k out) / gpt-5.6-sol.