CLI Release Security: A Supply Chain Checklist

CLI release security is getting a practical blueprint from a developer who builds command-line tools and had put the work off on side projects until it overlapped with a day job. The approach uses Buildkite, Sigstore and GitHub, and it needs no PGP keys or custom infrastructure. It starts by giving every release four things users can check.

What every release should ship

  • Checksums for all artifacts, so anyone can verify integrity with no extra tools.
  • A Software Bill of Materials (SBOM) for each binary, showing what went into the archive without a rebuild.
  • Keyless SLSA v1 provenance signed through Sigstore. It proves which pipeline and commit produced a binary, and there are no long-lived signing keys to store or rotate.
  • Immutable releases, so a published tag and its assets can’t be swapped quietly later.

The reusable pieces are packaged as Buildkite subdirectory plugins in a public GitHub repository. The author first planned a step-by-step YAML tutorial, then dropped the idea. Pasted pipeline instructions go stale as tools change, so the write-up explains why each guardrail exists and what breaks without it.

Two pipelines, not one

Many projects run tests and releases in a single pipeline and gate publishing on a tag check. That stops working once keyless OIDC signing and scoped release credentials enter the picture. The fix is two pipelines.

The CI pipeline runs on branches and pull requests. It lints, runs tests and builds snapshots to check packaging. It holds no release token and never signs provenance.

The release pipeline runs only on tags that start with v. It builds the archives, signs the SLSA provenance, validates package manifests such as a Homebrew formula, creates the immutable GitHub release and, on stable tags, updates downstream package repositories.

Five guardrails the split enforces

Signing identity

Buildkite’s OIDC identity for cosign names the pipeline, not the git ref. If pull request builds and releases share a pipeline, every build shares one signing identity. A tag-only pipeline means that identity vouches for release provenance and nothing else.

Secret scope

The GitHub release token lives as a cluster secret scoped to the release pipeline alone, which keeps it away from pull requests. Buildkite reports tag builds with the tag name as the branch, so a main-only branch rule on a secret doesn’t work for tags. The release job therefore checks that the tag’s commit is an ancestor of origin/main before it ships.

Cache isolation

Build and toolchain caches, such as Go and mise, are restored on every build but saved only from main. That stops a feature branch from poisoning a cache that main or a release later inherits.

One atomic publish

An immutable GitHub release locks as soon as it is published. Every archive, checksum, SBOM, provenance bundle and package manifest must be verified first, then published with a single gh release create call. Package-manager updates run as a follow-up step. That lets -rc.N prereleases validate without reaching live users, and lets a transient tap error retry cleanly.

Pinned tools

Signed artifacts mean little if the tools that built them float on latest. Build, lint, SBOM and signing tools are pinned by version and checksum, for example with mise lockfiles. External CI plugins are pinned by their full 40-character commit SHA.

A prompt for coding agents

The post ends with a ready-made prompt for a coding agent such as Claude Code, Codex or Cursor. It tells the agent to inspect the repository, read the reference plugins and propose a plan before editing anything. That plan must cover how CI and releases split, whether to use the plugins directly on Buildkite Agent v3.108.0 or later, which OIDC issuer users will verify against, and what manual setup is needed.

One detail matters for non-GitHub CI. The gh attestation verify command accepts only GitHub Actions OIDC certificates, so a pipeline on Buildkite must ship .sigstore.json bundles that users check with cosign.

The prompt also lists invariants: validate package manifests before the immutable release is created, enforce semver tags and main ancestry, refuse to overwrite an existing release, and re-check every SHA-256. Installers should verify in layers, always checking SHA-256, then gh release verify-asset and cosign when those tools are present, and fail hard on any miss.

What to do with it

Projects can adopt the plugins directly or hand the prompt to an agent and adapt the pattern to another CI provider. Either way, the core advice is the same: separate CI from releases, pin everything, and verify before locking the release.

Source: wolfe.id.au

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.