Skip to content

Require operator confirmation for project approvals file grants - #935

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-7782-a-repo-committed-corbitspermissionsjson-grants-itself
Sep 12, 2026
Merged

Require operator confirmation for project approvals file grants#935
TheGreatAxios merged 3 commits into
mainfrom
cl-7782-a-repo-committed-corbitspermissionsjson-grants-itself

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Implements CL-7782: a repo-committed .corbits/permissions.json previously seeded the permission gate with zero operator involvement, so a planted file could silently auto-allow destructive calls (force-push, file writes).

What changed:

  • loadProjectApprovals (src/permission/store.ts) returns only entries whose fingerprint the operator confirmed; untrusted directories contribute zero approvals. hasLiteralFloor behavior unchanged.
  • Grant confirmations live as trustedGrantFingerprints in the existing project-trust record (src/trust/project-trust.ts) — no second trust surface, keyed by realpath with the repo guard, so symlinked checkouts cannot inherit or confer.
  • First encounter with a non-empty unconfirmed file surfaces what it would grant via loadPendingProjectApprovals/formatPendingProjectApprovals, wired into exec (stderr) and TUI (persist notice); entries stay gated regardless.
  • DECISION (also recorded in code): project trust does NOT imply grant trust. Plugin/MCP trust only permits code to load or a server to connect; a grant auto-allows future tool calls with no further prompt, so each entry requires its own confirmation. No migration auto-confirms on upgrade — existing trusted projects see the first-encounter notice once instead of a silent behavior change.
  • saveProjectApproval confirms what it writes (the only production writer is the interactive grant path); removeProjectApproval drops the confirmation so a replanted file re-surfaces.

Verification: bun run check green (6983 pass, 0 fail, exit 0), including new regression tests in src/permission/project-approvals-trust.test.ts driving the real gate (planted force-push + write_file patterns must ask when untrusted, apply silently when trusted + confirmed; realpath/symlink case; first-encounter surfacing).

Not merging — lands after critique.

A repo-committed .corbits/permissions.json previously seeded the permission gate with zero operator involvement, so a planted file could silently auto-allow destructive calls such as force-pushes and file writes.

Gate loadProjectApprovals behind per-entry grant fingerprints stored in the existing project-trust record: an untrusted directory now contributes zero approvals, trust stays keyed by realpath, and the first encounter with an unconfirmed file surfaces what it would grant instead of dropping it silently. Project trust never implies grant trust — each entry needs its own confirmation, recorded when the operator persists a project-scope grant.

Covers CL-7782.
@linear-code

linear-code Bot commented Sep 12, 2026

Copy link
Copy Markdown

CL-7782

Hand-removing an entry from the project approvals file left its trust fingerprint behind, so a byte-identical replant applied silently. Loaders now reconcile trust against the entries on disk.
@TheGreatAxios
TheGreatAxios merged commit 8fdc917 into main Sep 12, 2026
8 of 9 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-7782-a-repo-committed-corbitspermissionsjson-grants-itself branch September 12, 2026 05:20
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