Skip to content

feat(cli): macOS Keychain signer with optional TTL#42

Merged
knhn1004 merged 1 commit intomainfrom
feat/os-keychain-signer
May 3, 2026
Merged

feat(cli): macOS Keychain signer with optional TTL#42
knhn1004 merged 1 commit intomainfrom
feat/os-keychain-signer

Conversation

@knhn1004
Copy link
Copy Markdown
Collaborator

@knhn1004 knhn1004 commented May 2, 2026

Summary

  • Wires the os-keychain signer tier the daemon already accepts. agentlock signer enroll --tier os-keychain [--ttl 4h] stashes a fresh ed25519 seed in the macOS login keychain via /usr/bin/security and persists pubkey + expires_at in os-keychain.meta.json.
  • session create and session rotate accept --tier os-keychain. Load checks the meta TTL before reading the keychain so expired signers fail fast.
  • TTL is enforced CLI-side (Keychain has no native TTL primitive). Linux/Windows error out with a roadmap message. Docs updated to reflect shipped status on macOS.

Test plan

  • bun run typecheck clean
  • bun test — 108 pass, 0 fail (6 new keychain tests, skipped on non-darwin)
  • Manual: enroll → session create --tier os-keychain against local daemon, daemon accepts signer=os_keychain
  • Manual: --ttl 2s, sleep, retry → CLI rejects with "expired at ..." message
  • Reviewer: confirm the keychain entry name (openagentlock-signer) is acceptable, or rename
  • Reviewer: linux/windows code paths surface the not-implemented error early

🤖 Generated with Claude Code

Wires the OS-keychain signer tier the daemon already accepts. New
`agentlock signer enroll --tier os-keychain [--ttl 4h]` stashes a fresh
ed25519 seed in the macOS login keychain via /usr/bin/security and
persists pubkey + expires_at in os-keychain.meta.json. `session create`
and `session rotate` accept --tier os-keychain; load checks the meta
TTL before reading the keychain so expired signers fail fast.

TTL is enforced CLI-side (Keychain has no native TTL primitive).
Linux/Windows error out with a clear roadmap message. Tests cover
enroll, sign round-trip, expired-TTL rejection, re-enroll rotation,
checksum tamper, and missing-meta paths; skipped on non-darwin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@knhn1004 knhn1004 force-pushed the feat/os-keychain-signer branch from c8976f4 to 6aaa0c2 Compare May 3, 2026 00:56
@knhn1004 knhn1004 merged commit 8881133 into main May 3, 2026
5 checks passed
@knhn1004 knhn1004 deleted the feat/os-keychain-signer branch May 3, 2026 00:58
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