Repository navigation
feat(profile): signed scope/RoE + verifiedScope for Pillar 3 (Pillar 4 step 5) - #298
Merged
Merged
Conversation
…4 step 5) Makes the profile's [scope]/RoE a cryptographically attributable, offline-verifiable artifact by reusing kit's existing signing floor verbatim (design: pillar4-traveling-profile-5.0.md §4.4). Adds src/profile/sign.ts: - signProfile: signs canonicalProfileBytes (generated excluded) through the resolved keystore — same path as 'kit policy sign', so a hardware-rooted backend can sign and a hardware mandate (KIT_REQUIRE_HARDWARE_IDENTITY / require_hardware_identity) is enforced. Writes .kit-profile.sig (PolicySignature shape). - verifyProfileSignature: same trust order and revocation semantics as verifyPolicy — --key pin → local identity → org anchor (.kit-policy.signers); fail-closed once anchored. - verifiedScope: the fail-closed hook for Pillar 3's exec-broker — returns the [scope] ONLY when the signature is valid. Unsigned / changed / forged / revoked-signer / no-scope → null. Wires 'kit profile sign' + 'kit profile verify' (--key, --json). No new crypto — a second consumer of the verified floor. 9 tests (sign→verify, tamper-detection, re-sign restores, verifiedScope fail-closed across unsigned/tampered/no-scope). public-surface.json regenerated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
|
✅ Docker image built successfully
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The marquee step of the traveling project profile (Pillar 4): make the profile's
[scope]/RoE a cryptographically attributable, offline-verifiable artifact, and expose it fail-closed for Pillar 3's exec-broker. Reuses kit's existing signing floor verbatim — zero new crypto.Type of Change
Related Issues
kit-research/docs/research/pillar4-traveling-profile-5.0.md§4.4Changes Made
src/profile/sign.ts:signProfile— signscanonicalProfileBytes(generatedexcluded) through the resolved keystore, exactly likekit policy sign: a hardware-rooted backend can sign, and a hardware mandate (KIT_REQUIRE_HARDWARE_IDENTITY/ policyrequire_hardware_identity) is enforced viaassertHardwareIdentity. Writes.kit-profile.sig(reusing thePolicySignaturerecord shape).verifyProfileSignature— identical trust order and revocation semantics toverifyPolicy:--keypin → local identity → org anchor (.kit-policy.signers); fail-closed once an anchor is present.verifiedScope— the fail-closed hook for Pillar 3's exec-broker: returns the[scope]only when the signature is valid. Unsigned / changed / forged / revoked-signer / no-scope all returnnull(grant nothing).src/commands/profile.ts—kit profile sign+kit profile verify(--key,--json), mirroringkit policy verify's fail-open-on-trust-absence exit semantics.src/cli.ts— updatedprofilehelp +SUBCOMMAND_HELPfor sign/verify.contracts/public-surface.json— regenerated for the new help keys.src/profile/sign.test.ts— 9 tests via a throwawayKIT_IDENTITY_DIR: sign→verify (local), refuse-no-profile, unsigned, tamper-detection, re-sign restores validity, andverifiedScopefail-closed across unsigned / tampered / no-scope.Testing
Test Coverage
public-surface.json)npm test) — full suite 2649 pass / 0 fail (2640 baseline + 9)Manual Testing
npx tsc --noEmit→ clean.npx eslint src→ 0 errors.npm run build && node scripts/gen-public-surface.mjs && node scripts/test.mjs→ 2649 pass, 0 fail.npx prettier --check→ formatted.Breaking Changes
None / N/A — new subcommands + module.
Checklist
npm test)Performance Impact
Reviewer Notes
The security-critical property is
verifiedScope's fail-closed contract: an autonomous agent's permissions (egress allowlist, fs-scope, secret-scope) must come only from a valid, attributable signature — an unsigned or hand-edited[scope]grants nothing. This is the seam Pillar 3's exec-broker will consume. Signing is deliberately routed through the keystore (not the file key directly) so the same hardware mandate that protects the org policy protects the RoE. What remains in the profile track is step 4 (plugin/workflow discovery so those kinds stop being "unaudited", pluskit triage pluginand vault-config triage) — orthogonal to signing.🤖 Generated with Claude Code
https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
Generated by Claude Code