Skip to content

fix(plugins): let prompt answers from a plugin be allowed until quit - #2505

Closed
eskwisit wants to merge 1 commit into
vastsa:mainfrom
eskwisit:fix/plugin-desktop-consent-session
Closed

eskwisit wants to merge 1 commit into
vastsa:mainfrom
eskwisit:fix/plugin-desktop-consent-session

Conversation

@eskwisit

Copy link
Copy Markdown

Summary / 概要

A plugin that relays the user's own answers to agent prompts (question cards, tool permissions) got the native "wants to run …" warning for every single answer, with only Deny / Allow once.

  • Operations that only answer a prompt the host already shows (agent/askTool/resolve, tool/resolvePermission, plans/resolve, extensions/ui/respond, listed in DESKTOP_CONSENT_SESSION_OPERATIONS) now get a third button, Allow until quit (same wording as the fs consent dialog).
  • The grant is in memory, per plugin and operation id, and dropped when the plugin is stopped (not on a supervisor restart) or the app quits.
  • Every other dangerous operation (session/delete, session/configure, agent/instructions/save, …) keeps Deny / Allow once; a "session" answer for them is treated as a refusal.
  • The consent service returns "once" | "session" | "deny"; a boolean from an older service is still accepted (true = once). Successful dangerous calls audit data.consent.
  • i18n pluginDesktopConsent.allowSession in all 9 locales (reuses the fs-consent translation); security spec §8.2 and plugin guide (en, zh-CN) updated.

Tests: new case in apps/desktop/test/plugin-desktop-control.test.mjs (remembered answer raises no second dialog; destructive op never offers it; Allow once never remembered; unload drops the grant). plugin-desktop-control 10/10, plugin-runtime* + plugin-fs* 49/49, i18n 31/31, apps/desktop tsc --noEmit clean.

Requirement link / 需求关联

  • Linked requirement issue / 已关联对应的需求 Issue:Closes [Bug] Plugin desktop-control consent dialog repeats for every prompt answer #2504
  • Issue explains the background and the expected outcome / Issue 已说明需求背景和期望效果
  • UI changes carry a fitting reference: screenshot, sketch, or demo / 涉及 UI 的改动已提供合适的截图、设计参考或 Demo
  • UI changes include before / after screenshots, uploaded to the PR (not committed to the repo) / UI 变更已附修改前后截图(直接上传到 PR,不要提交进仓库)

The only UI change is one extra button on the existing native dialog.

@vastsa

vastsa commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Thanks for the detailed write-up. I'm not landing this as-is, because remembering consent for tool/resolvePermission (and to a lesser degree agent/askTool/resolve / plans/resolve) changes who makes the decision, not just how often the user is asked.

The per-call native dialog is the only point where the user confirms that this answer is theirs. The answer payload is authored by the plugin, not by the host prompt, so once "Allow until quit" is granted the plugin (or a prompt-injected model behind it) can silently approve every subsequent tool permission request for the rest of the run — including shell/file writes — with no further user involvement. That is a standing privilege elevation, which docs/spec/07-plugins/04-plugin-security.md and AGENTS.md §11 rule out as a way to reduce friction.

This is also a new consent mode rather than a defect fix, so under the current contribution scope it would need maintainer sign-off on the security design first. A direction that could work: let the remembered grant cover only answers that are provably the user's own (e.g. bound to a host-issued, single-use token from a click in the plugin's panel), or exclude tool/resolvePermission entirely. Happy to discuss in #2504.

@vastsa

vastsa commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Thanks for the thorough PR. Before review, two things:

  1. Scope. Although titled fix, this adds a new consent grant level ("Allow until quit") and relaxes the native confirmation for a set of dangerous plugin operations. That is a feature and a permission-boundary change, which needs a maintainer product/security decision first under the current contribution scope (outside PRs are limited to fix / perf). We'll follow up here once that decision is made — please hold off on further work until then.
  2. Conflicts. The branch currently conflicts with main and will need an update regardless.

@eskwisit

eskwisit commented Nov 23, 2026 •

Copy link
Copy Markdown
Author

Thanks for your message. You're absolutely right, I posted this as a fix thinking in terms of permissions but it's a feature from the product perspective. The idea behind the change is to allow plugins to interact directly with the host sessions and agents (similar to Herdr with the greater PI-Desktop as base layer). In this case, it's the session that reports to the plugin and ask to allow running code. It can stay unidirectional to avoid any dangerous plugin operation. Let me know what you think.

@eskwisit

Copy link
Copy Markdown
Author

Superseded by 0bb3186 (fixes #2504), which limits "Allow until quit" to agent/askTool/resolve and keeps approvals and destructive operations at Deny / Allow once. Nothing is left after a rebase onto main, so closing.

@eskwisit eskwisit closed this Nov 25, 2026
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.

[Bug] Plugin desktop-control consent dialog repeats for every prompt answer

2 participants