Skip to content

plugins: ask "Make sure you trust <publisher>" before installing any non-official plugin - #36271

Merged
nwparker merged 3 commits into
mainfrom
nwparker/plugin-install-trust-dialog
Oct 31, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/plugin-install-trust-dialog

Conversation

@nwparker

@nwparker nwparker commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​450 $\color{#cf222e}{\Huge{\mathbf{−}}}$​24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​426
Prod 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​582 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​582

ELI5

Before this change, you could install a plugin from someone other than Orca with one click, and the only warning was a line on the plugin's page. Now Orca stops and asks "Make sure you trust " every time you install a plugin that isn't one of Orca's own. Themes and other look-only plugins get a lighter warning. Plugins that run code get a stronger one that lists what they can do. Cancel is the default button.

What Changed

Before: installing a non-official catalog plugin from its card, its page, or a page opened by an orca://plugins/... link went straight to download. Installing from a Git URL or adding a development folder asked for nothing.

After: every one of those paths opens one confirmation dialog first. Nothing downloads until you click Install (or Add folder for a development folder). Cancel, Esc and closing the dialog all back out.

  • Title: "Make sure you trust ". The owner is the repository owner that Orca reads from the URL it will download from, so a plugin cannot pick its own name here. Folder installs say "Make sure you trust this folder".
  • Wording by kind:
    • Theme: "This theme is from acme, not Orca. Only install plugins from authors you trust."
    • Other look-only content: the same wording, with "plugin" in place of "theme".
    • Language pack: also says that translations can change any text in Orca.
    • Plugin that runs code: "It runs the publisher's code inside Orca…", plus the same list of what it can access that the review page shows.
    • Git URL: says Orca hasn't checked the repository.
    • Local or development folder: says it is an unverified local folder, and for development folders that later edits run without asking.
  • Details box: the publisher Orca installs the plugin as, the repository Orca parsed (github.com/acme/orca-notes), and the catalog name or folder path. The publisher comes from the catalog listing id, or from the URL owner for a Git URL install (the derived-publisher rule from plugins: derive the publisher from the repository owner, like a Go module path #36281). The manifest's own publisher field is never shown.
  • Official plugins never show it. "Official" means both the listing and the download preview were marked official by the host. The host only marks a plugin official when it comes from the stablyai official catalog and a stablyai repository.

How it works: there is one async gate, confirmPluginInstallTrust(prompt), in a small store (store/plugin-install-trust-request.ts). PluginInstallTrustDialogHost, mounted in the Plugins pane, renders it. The gate is called from:

  • usePluginInstallAction.install, which card, page, and link-opened page installs all go through;
  • PluginsSettingsSection.install for Git URL and folder installs;
  • the Add path step in PluginDevelopmentDialog.

For a Git URL, the two-step flow from #36525 (check the version, then Install) stays as it is. The trust dialog opens on that final Install click, right before anything downloads.

presentation/plugin-install-trust.ts decides which warning to show. It builds on the existing pluginPublisherNotice and access-warning helpers instead of copying their logic. Deep links still only open the plugin's page, so a link cannot skip the dialog. orca plugin dev load (#36288) talks to the main process over runtime RPC without going through the renderer, so this dialog does not cover it. That is a terminal command the user types on purpose, and it is out of scope here.

Why

  • One gate inside the install action, not a check at each button. A future install button can't forget it, and links can't get around it.
  • A blocking dialog instead of the page banner. The card's one-click Install never shows the banner, and the CEO asked for an explicit confirmation.
  • The parsed repository owner instead of the declared publisher in the title. The manifest's publisher field is the plugin's own claim.
  • Cancel gets focus. A held Enter, or Enter pressed right after a link opens a page, can't install anything.

Language packs can't rewrite this copy. Every key is under auto.components.settings.PluginInstallTrustDialog.*. The existing auto.components.settings.Plugin* protected prefix covers that, and a unit test checks every key against isProtectedPluginTranslationPath. The dialog also uses surface="security", so the structural rule from #36219 (now merged) picks it up: all 16 keys are in the regenerated protected-copy-keys.json.

Linked Issue

N/A (maintainer; CEO request following #36218).

Visual Proof

Theme (softer wording), dark and light:

theme dark
theme light

Plugin that runs code (stronger wording plus access list), dark and light:

code dark
code light

Git URL install and development folder, captured through the real Plugins pane forms:

git dark
git light
dev dark
dev light

How these were captured: dev build in the background with ORCA_BACKGROUND_LAUNCH=1, screenshots over CDP. The live catalogs have no community listings yet, so for the theme and code shots I added a temporary hook that was never committed. It called the real gate with prompts built by catalogInstallTrustPrompt from sample community listings. The Git and development folder shots come from the real forms.

Testing

  • pnpm tc, oxlint, pnpm run check:code-quality:changed, verify:localization-catalogs, verify:localization-extraction, verify:localization-coverage, verify:localization-runtime-catalog

  • pnpm test for the plugin, settings, shared plugin and i18n suites (676 tests). New coverage:

    • dialog shown for a community theme (softer wording, Cancel focused), a community code plugin (access list), a Git URL (the real form), a page opened by an install link (still asks, and the install still records that it came from a link), and a development folder;
    • not shown for an official plugin, and still shown when only one of listing and preview says official;
    • Cancel installs nothing, approves nothing, and keeps the Git form and development path input as they were.
  • No e2e change is needed. The e2e fixtures serve their catalogs as the official one, and the existing getByRole('dialog')).toHaveCount(0) checks after install now also show the dialog stays away for official plugins.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

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

  • Security: closes the gap where non-official installs needed no explicit trust step.
  • Cross-platform: paths are shown exactly as typed. The URL parsing comes from the shared provenance parser.
  • SSH and remote: renderer-only. No change to what client and host send each other. Older hosts work unchanged.
  • Mobile: not affected.
  • Performance: one small store, and nothing runs until an install starts.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent 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: 9fe7866c-0caa-44a1-86af-90d18c140a42
Commits

Reviewing files that changed from the base of the PR and between dd49932 and 2076d4e.

Files selected for processing: 13
  • src/renderer/src/components/plugins/list/PluginManager.catalog.test.tsx
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/plugins/languages/protected-copy-keys.json
Files skipped from review as they are similar to previous changes: 11
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Walkthrough

The changes add source-specific trust prompts for plugin installs and development folders. A shared store and dialog present prompt details and return the user’s confirmation. Catalog installs, Git installs from settings, and development-folder additions proceed only after confirmation. The changes also add localized dialog text and tests for prompt content, confirmation, cancellation, and official-plugin cases.

Merge Risk: Low · up to 2076d

The trust flow is broadly gated correctly, but custom-port provenance and dialog accessibility need bounded follow-up.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 53.33% 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 Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main behavior change: a trust confirmation ("Make sure you trust ") before installing non-official plugins. It is specific and matches the changeset, which adds a trust …
Description check Passed The description follows the repository template closely. It has the ELI5, What Changed (before and after, mechanism), Why, Visual Proof with images, Testing with checked items, Notes covering security…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main behavior change: a trust confirmation ("Make sure you trust <publisher>") before installing non-official plugins. It is specific and matches the changeset, which adds a trust dialog gate for non-official installs, Git URLs, and development folders. It is a single sentence, but it is long at 12 words and 88 characters, and it uses a quoted dialog string that is slightly noisy. These are minor issues and do not affect the assessment.

Full details: Description check

Explanation

The description follows the repository template closely. It has the ELI5, What Changed (before and after, mechanism), Why, Visual Proof with images, Testing with checked items, Notes covering security, cross-platform, SSH, mobile, and performance, and a completed checklist. The Linked Issue section says N/A (maintainer), which the template allows for maintainers. The AI Disclosure and Review sections are empty headings, but the template says to leave AI Disclosure blank for StablyAI team members, so that is acceptable. The LoC block is extra but harmless.

Full details: Docstring Coverage

Explanation

Docstring coverage is 53.33% 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 15 functions across 10 files. (12 skipped: 12 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
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.

Share

@coderabbitai coderabbitai 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.

Actionable comments posted: 3


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: 37b5892c-7645-41a4-a080-f99abd1d309a
Commits

Reviewing files that changed from the base of the PR and between 7358da2 and 75cabc0.

Files selected for processing: 21
  • src/renderer/src/components/plugins/dialogs/PluginDevelopmentDialog.tsx
  • src/renderer/src/components/plugins/dialogs/PluginInstallTrustDialog.tsx
  • src/renderer/src/components/plugins/list/PluginManager.catalog.test.tsx
  • src/renderer/src/components/plugins/presentation/plugin-install-trust.test.ts
  • src/renderer/src/components/plugins/presentation/plugin-install-trust.ts
  • src/renderer/src/components/plugins/state/use-plugin-install-action.test.tsx
  • src/renderer/src/components/plugins/state/use-plugin-install-action.ts
  • src/renderer/src/components/settings/PluginsSettingsSection.lifecycle.test.tsx
  • src/renderer/src/components/settings/PluginsSettingsSection.tsx
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/store/plugin-install-trust-request.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

const folder = current?.kind === 'local-folder' || current?.kind === 'dev-folder'
return (
<Dialog open={prompt !== null} onOpenChange={(open) => !open && onCancel()}>
<DialogContent

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.

Minor · Functional Correctness · Quick win

Make the trust dialog scrollable for long source details.

If a folder path or Git URL wraps beyond the viewport, this fixed, vertically centered dialog has no height limit or scrolling. The Cancel and Install buttons can move off-screen. Enable scrollable on DialogContent so users can reach the decision controls. The shared primitive already provides the bounded scrolling behavior. (raw.githubusercontent.com)

Comment on lines +45 to +46
const repository = `${identity.host}/${identity.path}`
return { owner: identity.owner, repository: path ? `${repository} (${path})` : repository }

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.

Minor · Security & Privacy · Quick win

Preserve custom ports in the repository shown for confirmation.

If a Git URL uses a custom port, parseGitRepositoryIdentity drops that port before this code builds repository. For example, https://git.example.com:8443/acme/plugin.git appears as git.example.com/acme/plugin, although installation uses port 8443. Git URL validation permits that input. Show the actual authority, including its port, so the user confirms the endpoint that will supply the plugin. (raw.githubusercontent.com)

Comment on lines +125 to +133
// Why here: the card, the page and every link-opened page install through this one gate.
const trustPrompt = catalogInstallTrustPrompt(listing, preview)
if (trustPrompt) {
setPhase(pluginKey, null)
if (!(await confirmPluginInstallTrust(trustPrompt))) {
return
}
setPhase(pluginKey, { kind: 'installing' })
}

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.

Minor · Stability & Availability · Quick win

Supported by static analysis

Script executed:

set -u
rg -n -F --glob '*.{ts,tsx}' -e 'isSectionMounted' -e 'mountedSections' -- src/renderer/src || test "$?" -eq 1
echo '--- PluginsSettingsSection.tsx 190-240'
sed -n '190,240p' src/renderer/src/components/settings/PluginsSettingsSection.tsx
echo '--- PluginsSettingsSection.tsx 380-420'
sed -n '380,420p' src/renderer/src/components/settings/PluginsSettingsSection.tsx
echo '--- PluginManager render references'
rg -n -F --glob '*.tsx' -e 'PluginManager' -- src/renderer/src || test "$?" -eq 1
echo '--- use-plugin-install-action.ts 95-150'
sed -n '95,150p' src/renderer/src/components/plugins/state/use-plugin-install-action.ts
echo '--- plugin-install-trust-request.ts'
sed -n '1,40p' src/renderer/src/store/plugin-install-trust-request.ts

Repository: stablyai/orca

Length of output: 22853


Script executed:

set -u
echo '--- settings-view-model.ts 60-130'
sed -n '60,130p' src/renderer/src/components/settings/settings-view-model.ts
echo '--- use-plugin-install-action.ts 1-95'
sed -n '1,95p' src/renderer/src/components/plugins/state/use-plugin-install-action.ts
echo '--- PluginsSettingsSection.tsx 195-205'
sed -n '195,205p' src/renderer/src/components/settings/PluginsSettingsSection.tsx

Repository: stablyai/orca

Length of output: 6824


Script executed:

set -u
rg -n -F --glob '*.{ts,tsx}' -e 'neededSectionIds' -- src/renderer/src || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 1618


Script executed:

set -u
sed -n '160,205p' src/renderer/src/components/settings/use-settings-navigation-model.ts

Repository: stablyai/orca

Length of output: 1592


Script executed:

set -u
rg -n -F --glob '*.{ts,tsx}' -e 'setMountedSectionIds' -e 'deriveNeededSectionIds' -- src/renderer/src || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 1185


Script executed:

set -u
echo '--- use-settings-page-effects.ts 200-240'
sed -n '200,240p' src/renderer/src/components/settings/use-settings-page-effects.ts
echo '--- settings-load-performance.ts 1-60'
sed -n '1,60p' src/renderer/src/components/settings/settings-load-performance.ts
echo '--- use-settings-store-model.ts 144-152'
sed -n '144,152p' src/renderer/src/components/settings/use-settings-store-model.ts

Repository: stablyai/orca

Length of output: 3148


Skip the trust prompt when the install hook has already unmounted.

A catalog install can store a trust request after its Plugins host has unmounted. Searching in Settings can unmount the Plugins section while fetchPreview is pending. The request then stays in the global store and reappears when the user returns to Plugins. Its Install button continues the old install.

Suggested fix
       if (trustPrompt) {
         setPhase(pluginKey, null)
+        // Why: an unmounted host cannot answer; a stored prompt would reappear on remount.
+        if (!mountedRef.current) {
+          return
+        }
         if (!(await confirmPluginInstallTrust(trustPrompt))) {
Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Why here: the card, the page and every link-opened page install through this one gate.
const trustPrompt = catalogInstallTrustPrompt(listing, preview)
if (trustPrompt) {
setPhase(pluginKey, null)
if (!(await confirmPluginInstallTrust(trustPrompt))) {
return
}
setPhase(pluginKey, { kind: 'installing' })
}
// Why here: the card, the page and every link-opened page install through this one gate.
const trustPrompt = catalogInstallTrustPrompt(listing, preview)
if (trustPrompt) {
setPhase(pluginKey, null)
// Why: an unmounted host cannot answer; a stored prompt would reappear on remount.
if (!mountedRef.current) {
return
}
if (!(await confirmPluginInstallTrust(trustPrompt))) {
return
}
setPhase(pluginKey, { kind: 'installing' })
}

@nwparker
nwparker force-pushed the nwparker/plugin-install-trust-dialog branch from 75cabc0 to dd49932 Compare October 30, 2026 10:26
@nwparker
nwparker force-pushed the nwparker/plugin-install-trust-dialog branch from dd49932 to 2076d4e Compare October 31, 2026 02:24
@nwparker
nwparker merged commit b45d71b into main Oct 31, 2026
62 of 63 checks passed
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