You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
plugins: require an explicit approve fingerprint for RPC plugin grants - #36279
Before this change, any program holding the local Orca CLI connection could turn on a plugin that runs code by copying a value out of the plugin list. Nothing told anyone, and nothing was logged. Now, turning on anything that runs code or acts in Orca over the CLI/RPC connection needs a separate approval code. Orca gives that code out only in an "approval required" answer that spells out exactly what would be granted. Each use is written to the plugin audit log as "approved via CLI".
What Changed
plugins.consent and plugins.setEnabled(enabled: true) over runtime RPC now go through one host function, approvePluginFromCli:
Content-only plugins (themes, icon themes, syntaxes, language packs) are enabled with no extra step. Main decides this from the verified manifest, not from what the caller says.
Anything else fails with approval_required unless the call carries a matching approvalFingerprint. The error's data lists the execution level, each capability with its consent text, the contributions, why approval is needed, and the exact --approve <fingerprint> flag. The error message carries the same thing as readable text.
The fingerprint (ap1-…) binds plugin key + version + consent fingerprint (capabilities, execution level, worker flag, and the content hash for code or instructions) + install content hash / dev-folder identity + the contribution list. A fingerprint shown for a different plugin, version, set of files, or access set is rejected with approval_stale, and that error carries the new grants.
Every grant is audit-logged before and after the write as cli:local / cli:paired-device:<id>, with the summary "approved via CLI --approve …".
Disabling and "keep disabled" never need approval.
The owner-token runtime socket now explicitly stamps callers as local-cli. Before, it relied on "no client kind means CLI". The resolved identity is the same.
New optional RPC fields: approvalFingerprint on plugins.setEnabled and plugins.consent. reviewedFingerprint is now optional over RPC. The desktop review dialog uses IPC and is unchanged.
Why
This is Phase 0 of the plugin CLI for agents. The approval model is the CEO's: an explicit approve flag, and the calling agent decides whether to ask its user. We could not trust caller identity alone. An agent's CLI reaches a remote Orca server as a paired device, so no transport proves that a person is behind a call. Binding the grant to a fingerprint that Orca shows together with the full grant list makes every grant explicit, specific, and auditable. It also means reading plugins.list can never quietly approve anything. Later orca plugin enable/dev load/install/update commands reuse this one function.
Linked Issue
N/A (maintainer).
Visual Proof
N/A: there is no UI change. This only changes RPC behavior; desktop IPC dialogs are untouched.
Testing
Automated tests added/updated
src/main/plugins/plugin-cli-approval.test.ts: content-only passes without a flag; code without the flag gives approval_required with grants; the right fingerprint grants and is audited; a fingerprint from another version, content hash, capability set, or plugin gives approval_stale; access that is already approved needs no flag; the dev-folder warning is shown.
src/main/runtime/rpc/methods/plugins.test.ts: a consent fingerprint read from plugins.list is refused; a paired-device caller is refused too; disabling and keep-disabled always work.
pnpm tc:node, pnpm run check:code-quality:changed, and the plugin and runtime-rpc test folders pass locally (macOS).
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Remote wire compatibility: the new fields are optional. Older hosts strip them, so they behave as before. No in-repo client (desktop, mobile, web) calls these two RPCs, so nothing in Orca regresses. An old CLI-style caller that approved code using only reviewedFingerprint is now refused on purpose.
SSH/remote: the approval is decided and logged on the host that runs the plugin.
Checklist
This PR is small and focused
I explained what changed and why
N/A for visuals with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote impact considered
Typecheck, lint, tests pass locally for changed areas; CI covers the rest
The changes add plugin approval requests and fingerprints, then use them to gate CLI and RPC approval of plugins that require CLI approval. The approval flow records audit attempts and outcomes and reports structured approval errors. RPC consent and enablement handlers pass caller identity and approval fingerprints into the flow. Disabling plugins and choosing keep-disabled remain direct decisions. Tests cover approval outcomes, stale fingerprints, RPC rejection cases, and disabling.
Priority: Normal
Merge Risk: Low · up to 0bf46
The approval flow appears mergeable, but its successful RPC path lacks direct test coverage. Add that coverage to reduce regression risk.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely identifies the main change: requiring an explicit approval fingerprint for RPC plugin grants.
Description check
The description covers the required sections and explains the user-facing behavior, implementation, rationale, testing, compatibility, security, and remote-operation impact. The maintainer-specific Li…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description covers the required sections and explains the user-facing behavior, implementation, rationale, testing, compatibility, security, and remote-operation impact. The maintainer-specific Linked Issue exception is addressed, and the lack of UI changes is documented.
Full details: Docstring Coverage
Explanation
Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 10 functions across 11 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Add a positive RPC test with a matching fingerprint.
The tests cover only refusal and reduce-access paths. No test shows that plugins.setEnabled or plugins.consent succeeds when approvalFingerprint is correct. No test covers the approval_stale path from the handler at lines 96-101 of plugins.ts. A test with a matching fingerprint would also catch the enable-state question above, if it uses a real or more faithful consent writer.
Source: Learnings
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 3717d1d2-1c54-406a-9ebf-cb56d72f04da
Commits
Reviewing files that changed from the base of the PR and between 7358da2 and 0bf46ea.
Files ignored due to path filters: 1
src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
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
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.
ELI5
Before this change, any program holding the local Orca CLI connection could turn on a plugin that runs code by copying a value out of the plugin list. Nothing told anyone, and nothing was logged. Now, turning on anything that runs code or acts in Orca over the CLI/RPC connection needs a separate approval code. Orca gives that code out only in an "approval required" answer that spells out exactly what would be granted. Each use is written to the plugin audit log as "approved via CLI".
What Changed
plugins.consentandplugins.setEnabled(enabled: true)over runtime RPC now go through one host function,approvePluginFromCli:approval_requiredunless the call carries a matchingapprovalFingerprint. The error'sdatalists the execution level, each capability with its consent text, the contributions, why approval is needed, and the exact--approve <fingerprint>flag. The error message carries the same thing as readable text.ap1-…) binds plugin key + version + consent fingerprint (capabilities, execution level, worker flag, and the content hash for code or instructions) + install content hash / dev-folder identity + the contribution list. A fingerprint shown for a different plugin, version, set of files, or access set is rejected withapproval_stale, and that error carries the new grants.cli:local/cli:paired-device:<id>, with the summary "approved via CLI --approve …".local-cli. Before, it relied on "no client kind means CLI". The resolved identity is the same.approvalFingerprintonplugins.setEnabledandplugins.consent.reviewedFingerprintis now optional over RPC. The desktop review dialog uses IPC and is unchanged.Why
This is Phase 0 of the plugin CLI for agents. The approval model is the CEO's: an explicit approve flag, and the calling agent decides whether to ask its user. We could not trust caller identity alone. An agent's CLI reaches a remote Orca server as a paired device, so no transport proves that a person is behind a call. Binding the grant to a fingerprint that Orca shows together with the full grant list makes every grant explicit, specific, and auditable. It also means reading
plugins.listcan never quietly approve anything. Laterorca plugin enable/dev load/install/updatecommands reuse this one function.Linked Issue
N/A (maintainer).
Visual Proof
N/A: there is no UI change. This only changes RPC behavior; desktop IPC dialogs are untouched.
Testing
src/main/plugins/plugin-cli-approval.test.ts: content-only passes without a flag; code without the flag givesapproval_requiredwith grants; the right fingerprint grants and is audited; a fingerprint from another version, content hash, capability set, or plugin givesapproval_stale; access that is already approved needs no flag; the dev-folder warning is shown.src/main/runtime/rpc/methods/plugins.test.ts: a consent fingerprint read fromplugins.listis refused; a paired-device caller is refused too; disabling and keep-disabled always work.pnpm tc:node,pnpm run check:code-quality:changed, and the plugin and runtime-rpc test folders pass locally (macOS).Review
Agent skill upstream boundary
Notes
reviewedFingerprintis now refused on purpose.Checklist
N/Afor visuals with reason