Repository navigation
feat(pal)!: declarative typed verify checks, no shell execution (1.4.0) - #3
Merged
Merged
Conversation
palAutoVerify no longer runs a stored shell string via execSync. A verify is now a typed check (http-status via fetch, file-exists via fs) executed natively, never through a shell and never by interpolating a stored value into a command. A defensive parser rejects any unknown/injected shape, so a planted or imported verify is inert. Why: kit is agent-native. The old verify_cmd was a persistence/deferred-exec primitive: a prompt-injected low-trust session could store a command that later detonated when a more-trusted session ran `kit memory pal verify`. The typed model removes the sink at the root while staying autonomy-friendly (auto-verify needs no human gate, so autonomous agent jobs do not break). CLI: --verify-http <url> [--expect <code>] / --verify-file <path> replace --verify "<shell>". DB: new pending_actions.verify_check (JSON); legacy verify_cmd kept for kit memory scan but never auto-executed. Tests: declarative pass/fail/regress + two SECURITY regressions (imported and injected shapes never execute). 2219 green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
✅ Docker image built successfully
|
Merged
sandstream
pushed a commit
that referenced
this pull request
Jun 29, 2026
Pull recall can't guarantee you see a settled decision — a bad query misses it. The guardrail must be PUSH: touch files under an area and kit deterministically surfaces that area's ACTIVE decisions. - src/memory/clusters.ts: committed `.kit/shared/clusters.json` maps area→globs; zero-dep globToRegExp (** spans segments, * within one), clustersForPaths, decisionsForPaths (active only — superseded/reversed never resurface), changedPaths (git diff vs HEAD). - `kit memory context [paths…|--changed]`: prints active decisions for the touched areas (--json for tools). - UserPromptSubmit reminder appends a bounded (≤2 areas × ≤2 decisions) notice for the area(s) your working-tree changes fall into — deterministic "touch area X ⇒ see X's decisions", not a query lottery. Fail-open. - Seeded .kit/shared/clusters.json for kit (dogfood: memory/identity/ install-gate/ci-audit/secrets areas). Public surface regenerated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
5 tasks done
sandstream
added a commit
that referenced
this pull request
Jun 29, 2026
…r push-surfacing (#168) Three additive, backward-compatible changes: 1. fix(check): degraded (no-trufflehog) secrets-scan fallback no longer cries high-severity on test fixtures / env-var names; unverified ⇒ medium, skips those FP classes. Authoritative trufflehog + CI gitleaks unchanged. 2. feat(panic): kit panic — rotate identity + signed append-only revocation (asymmetric) + identity.panic audit event + platform-revocation checklist; audit verify surfaces revoked-key signatures. recordRevocation/loadRevocations/ isRevoked/revocationStatement. 3. feat(memory): path→cluster push-surfacing (gap #3) — .kit/shared/clusters.json area→globs, kit memory context, UserPromptSubmit push of touched areas' active decisions. 1900 tests pass; security-check PASS (19 ok).
3 tasks done
sandstream
pushed a commit
that referenced
this pull request
Jul 5, 2026
…found false green) Adversarial verify found the mandate was a false green: KIT_REQUIRE_HARDWARE_IDENTITY was enforced ONLY in `kit policy sign`, while audit-chain entries, shared-memory notes, and revocations kept signing with the same-UID-readable file key — and `init` still minted a file key that coexists. So a mandate operator got a green light over a key an attacker could still read and use. Fixed so NO file-key signature escapes under the mandate. - Universal backstop: signWithIdentity() (the file-key primitive) now FAILS CLOSED under KIT_REQUIRE_HARDWARE_IDENTITY — every caller that reaches it (revocations, elevation, any un-routed signer) refuses the file key. mandate.js is a zero-import module so identity.ts can guard without an import cycle. - loadOrCreateIdentity refuses to MINT a file key under the mandate (Finding #4: no coexisting same-UID key to steal). - Routed the audit-chain signer (audit.ts) and shared-memory signer (memory/shared.ts) through the keystore: a `command` backend now signs them via hardware, and under a mandate with only a file key they fall back to KEYLESS (chain still protects them) rather than emitting a forbidden file-key signature. Also unifies the signing kid. - Command signer no longer receives kit's env wholesale (Finding #3): minimal allowlist (PATH/HOME/KIT_SIGN_ALGO), so KIT_* secrets/vault tokens aren't exposed to the signer subprocess — the comment now matches the code. - Honesty (Findings #2/#6): the command backend and `kit identity keystore` no longer claim "hardware-rooted" (kit can't attest the operator's command fronts a secure element) — labeled "external key — operator-fronted" with an explicit caveat. Regression tests: comprehensive-mandate suite (signWithIdentity / loadOrCreate / recordRevocation fail closed; audit falls back to keyless) + signer env-isolation. Full suite green (2261 tests). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
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.
Why
kit is agent-native. The old PAL
verify_cmdstored a raw shell command and ran it viaexecSyncinpalAutoVerify. That is a persistence / deferred-execution primitive: a prompt-injected low-trust agent session couldpal adda command that detonated later when a more-trusted session (or a human) rankit memory pal verify. Socket's AI flagged exactly this onmemory/pal.js.A human-in-the-loop gate (confirm / elevate) would close it but break autonomous agent jobs (no human in an L6 stack). So the fix is structural, not a gate.
What
http-status(kit makes the request viafetch, compares status)file-exists(kit checks the path viafs)Surface changes
--verify-http <url> [--expect <code>]/--verify-file <path>replace--verify "<shell>".pending_actions.verify_check(JSON), migrated viaensureColumn. Legacyverify_cmdis kept (sokit memory scanstill finds secrets in old rows) but is never auto-executed (verify_check IS NULLrows are skipped).Tests
Declarative pass / fail / regress, plus two SECURITY regressions: a verify imported from a legacy ledger, and a directly-injected
{type:"shell",...}row, both never execute. Full suite 2219 green, tsc + build clean.Note
Conventional-commit
!marks the CLI flag change. Shipped as minor 1.4.0 (security-driven behavior change) with this CHANGELOG note; bump to 2.0.0 at merge if you prefer strict SemVer.🤖 Generated with Claude Code