Skip to content

feat(cli): pin a backup trusted root and fetch roots by id - #244

Merged
harlan-zw merged 7 commits into
mainfrom
feat/trusted-roots-by-id
Nov 19, 2026
Merged

harlan-zw merged 7 commits into
mainfrom
feat/trusted-roots-by-id

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

No linked issue.

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

The private key of the pinned root skilld-root-2026 is lost. The next release must pin a new primary root and a backup root, and must not depend on /api/v1/trusted-root, which released CLIs keep reading.

  • A build pins a primary root from SKILLD_ROOT_KEY_ID and SKILLD_ROOT_PUBLIC_KEY. It can also pin a backup root from SKILLD_BACKUP_ROOT_KEY_ID and SKILLD_BACKUP_ROOT_PUBLIC_KEY.
  • TrustedRootPins holds a required primary pin and an optional backup pin, so a backup without a primary cannot exist. An empty or half-set pair leaves the build unconfigured, and it fails with TRUSTED_ROOT_UNCONFIGURED.
  • The CLI fetches GET /api/v1/trusted-roots/{rootKeyId} for each pin in order, with the id percent-encoded. Only a 404 moves to the next pin. Any other failure keeps its current error, and a served root that fails verification never falls through to the backup.
  • If every pin answers 404, the CLI fails with TRUSTED_ROOT_MISMATCH.
  • The TRUSTED_ROOT_* next step named skilld upgrade, which is not a command. It now names npx skilld@latest and npm i -g skilld@latest, for install, run, and update checks.
  • release.yml checks the format of each root id and public key, and rejects the lost skilld-root-2026 and a backup that reuses the primary id or key. Before any build, it requires skilld.dev to serve both roots, with no redirect, each with version 1, at least one key, and its pinned id and public key.
  • The OpenAPI contract describes the new path.

Architecture after this change: release variables feed TrustedRootPins, and verified_root fetches each pinned root from /api/v1/trusted-roots/{rootKeyId} instead of /api/v1/trusted-root

Data flow: the primary root answers 404, so the CLI fetches the backup root and verifies it against the backup pin

📝 Migration

  1. Deploy the skilld.dev route /api/v1/trusted-roots/{rootKeyId} with the new primary and backup roots. Until it serves both, the release stops at "Require skilld.dev to serve both pinned roots".
  2. Before you tag, set SKILLD_ROOT_KEY_ID and SKILLD_ROOT_PUBLIC_KEY to the new primary root. Set SKILLD_BACKUP_ROOT_KEY_ID and SKILLD_BACKUP_ROOT_PUBLIC_KEY to the backup root.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

The root private key for skilld-root-2026 is lost, so the next release must pin a new primary root and a backup root. Each pinned root is fetched from /api/v1/trusted-roots/{rootKeyId}; only a 404 moves to the next pin, so a served root that fails verification never falls through. The release refuses to build unless skilld.dev serves the pinned primary root.
Only a 404 may move verification to the backup pin. These cases cover a served root for the wrong pin, invalid JSON, a transport failure, and a rejected redirect at the primary path.
Update checks verify the trusted root too, but only skilld run and install added the upgrade step to a TRUSTED_ROOT_* failure.
The guard checked only the primary root, so a wrong backup value could ship unnoticed. It now checks each id and key format, rejects the lost skilld-root-2026, and requires skilld.dev to serve both roots without a redirect.
@harlan-zw
harlan-zw marked this pull request as ready for review November 18, 2026 13:30
@harlan-github-agent

harlan-github-agent Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-11-19 01:05 UTC.

GitHub merged this pull request.

  • Both roots can pass preflight while dropping support for existing Artifacts. View code Next: Check both roots against a trusted baseline of signer IDs, public keys, and validity windows required by still-served Artifacts. Keep the live probe and the comparison between roots.
  • Logged (63/100): The release probe polls before the service asks it to. View code Optional follow-up: Validate and honor pollAfterMs within the preflight deadline.
    • Ask an agent to verify and fix this finding
  • Logged (54/100): Preflight accepts root responses that the released CLI cannot read. View code Optional follow-up: Apply the CLI's root response limit in preflight before parsing.
    • Ask an agent to verify and fix this finding
  • Logged (49/100): The npx recovery instructions can lead users back to the stale CLI. View code Optional follow-up: Tell users to rerun the failed command as npx skilld@latest <command and arguments>, or upgrade the installation they already invoke.
    • Ask an agent to verify and fix this finding
  • Logged (40/100): Two advertised root IDs cannot be addressed by the CLI. View code Optional follow-up: Reject dot-segment IDs when constructing pins and document the restriction in the route schema.
    • Ask an agent to verify and fix this finding
  • Logged (38/100): A release integration test adds Unix tooling requirements to loader tests and packaging. View code Optional follow-up: Run the release workflow fixture in a dedicated Ubuntu CI step outside the loader prepack suite.
    • Ask an agent to verify and fix this finding
  • Logged (25/100): The architecture diagram understates the release gate and omits request retries. View code Optional follow-up: Update the diagram to show both required roots and the attestation check, and describe fallback after a final 404.
    • Ask an agent to verify and fix this finding

7f1d4c0f-5e6b-43f1-895b-d03924ba553d

Selected findings run after merge and open separate pull requests.

@harlan-github-agent harlan-github-agent Bot added the harlan-agent-blocked The automated Review found a material defect in this head commit. label Nov 18, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: BLOCKED.

Read the Review results

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: BLOCKED.

Read the Review results

@harlan-github-agent harlan-github-agent Bot added harlan-agent-blocked The automated Review found a material defect in this head commit. and removed harlan-agent-blocked The automated Review found a material defect in this head commit. labels Nov 18, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: BLOCKED.

Read the Review results

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: BLOCKED.

Read the Review results

verify_attestation(&attestation, &primary)?;
let backup = read_root(&mut args)?;
verify_attestation(&attestation, &backup)?;
if supported_signers(&primary)? != supported_signers(&backup)? {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open (85/100): Both roots can pass preflight while dropping support for existing Artifacts.

Proof: The gate verifies one attestation and compares the two candidate signer maps. If both roots omit the same still-supported signer, the maps match and the probe passes. The CLI then rejects any still-served Artifact signed by the omitted key .

Next: Check both roots against a trusted baseline of signer IDs, public keys, and validity windows required by still-served Artifacts. Keep the live probe and the comparison between roots.

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy.

@harlan-zw
harlan-zw merged commit efbbe88 into main Nov 19, 2026
4 checks passed
@harlan-zw harlan-zw mentioned this pull request Nov 19, 2026
1 of 6 tasks
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-blocked The automated Review found a material defect in this head commit. label Nov 19, 2026
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