Skip to content

feat(core): a paired machine needs no approval - #65356

Merged
kitlangton merged 1 commit into
devfrom
machine-consent
Nov 21, 2026
Merged

kitlangton merged 1 commit into
devfrom
machine-consent

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Pairing a machine is the consent to use it: a path on a paired machine is judged like a local path.
Until now every first use of a machine asked for approval, once per machine per project, for computers the owner paired on purpose and could already reach with ssh from the local shell without a prompt.

🚦 Flag: machines. Paths that are not on a machine behave as before.

🐛 Before → after

// permission.ts, evaluate()
before   for a machine resource, broad allows (the default `*`) were ignored  →  unmatched  →  ask
after    a machine resource goes through the same rules, in the same order, as a local one
Case, with a paired machine gpu Before After
Read, write, or a command with a machine working directory; default rules Asks Runs
A configured ask or deny naming the machine (gpu:*) Asks / refuses Asks / refuses
A global edit ask or shell deny Applies Applies
*.env.* on a machine Asks Asks; and *.env.example is allowed, as locally (it was not before)
A machine that is not paired, or was removed Fails Fails

The change is a removal (+2 −11 in packages/core/src). There was no built-in external-directory ask: the prompt came only from the special case, which filtered the default allow and fell back to ask.

⚠️ What this means: a machine gets the same trust as this computer. A saved broad allow, such as the * an "always" answer to a local edit saves, now covers machines too, exactly as it covers local paths. A rule naming a machine is the way to keep one guarded. Whether pairing should take a scope is an open question for the team; this is the default for now.

📊 Proof

Check Result
Real read, write and shell on a machine with default rules raise no approval request ✅
Machine-named ask and deny, global edit and shell restrictions, .env exceptions, saved-rule precedence ✅
machine-path.test.ts and permission.test.ts ×5, bun typecheck in packages/core ✅ 990 pass · clean
Independent review on another model family No findings; gpu:* does not match gpu2:/x

👀 Read: packages/core/src/permission.ts, the removed block in evaluate.

Follows #65349

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend merging this. The change is sound, and I found nothing that should block it.

How I checked it: I ran the PR's updated machine-path.test.ts against the base. The new end-to-end test (read, write and a shell command on a paired gpu with default rules) stalls on an approval request until it times out, and allow("*") still evaluates to ask for gpu:/work/a.txt. With the PR, machine-path.test.ts and permission.test.ts pass (198 tests) and tsc -b in packages/core is clean. I didn't drive the TUI, because that would need a real paired machine.

Code: Dropping the special case in evaluate means machine resources go through the normal last-match rules. Rules naming the machine (gpu:* for ask or deny), global denies (e.g. plan mode's edit: deny) and the .env asks still apply. Local path globs like /work/* still don't match gpu:/work/..., because the gpu: prefix stays on the resource. Unknown and removed machines still fail before any permission check.

Tradeoff, as the description says: an "always" answer saved on this computer before this change (for example the * saved for edits) now covers paired machines without asking. That's a product decision for the team, not a bug.

Public API: unchanged. No config, schema, SDK, HTTP or plugin surface changes; only how existing rules are evaluated, behind the machines flag.

@kitlangton
kitlangton merged commit 44593c5 into dev Nov 21, 2026
30 of 31 checks passed
@kitlangton
kitlangton deleted the machine-consent branch November 21, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant