Skip to content

feat(enclaves): Add key rotation and descope client scope - #383

Merged
harshsinghmp merged 1 commit into
devfrom
feat/enclave-key-rotation
Nov 9, 2026
Merged

harshsinghmp merged 1 commit into
devfrom
feat/enclave-key-rotation

Conversation

@harshsinghmp

Copy link
Copy Markdown
Owner

Adds versioned enclave keyring + rotate with lazy re-encryption, and descopes per ADR-007. Gate 1525/0.

Why: W27-2 required a rotation path; W27-4 claimed a `scope: client`
that was never wired. Rotating the single key previously made every
vault undecryptable.

What:
- Versioned keyring (`.memory/enclave.keys/<key_id>.key`) + active key
  id; legacy `enclave.key` still readable; envelopes select by key_id.
- `rotateEnclaveKey`: new active key, optional re-encryption, old keys
  retained for rollback, `enclave_rotate` audit.
- CLI `memory enclave rotate [--no-reencrypt]`.
- ADR-007 descopes `scope: client`; ticket, roadmap, research and debt
  corrected; enclaves stay explicit CLI vaults.
- Tests: rotation with/without re-encryption, key-file perms, missing-key
  failure, audit.

Verification: bun test 1525 pass / 0 fail; tsc clean; build 434 modules;
secret scan clean.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
@harshsinghmp
harshsinghmp merged commit 1182d65 into dev Nov 9, 2026
@harshsinghmp
harshsinghmp deleted the feat/enclave-key-rotation branch November 9, 2026 13:16
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