diff --git a/plugins/AI-Core/README.md b/plugins/AI-Core/README.md index adb01699e..d070edaaf 100644 --- a/plugins/AI-Core/README.md +++ b/plugins/AI-Core/README.md @@ -115,18 +115,32 @@ Four rules the store applies, each of which was a bug before it was a rule: Contributed tools run inside the contributing plugin, under *its* permissions, and outside the `PathGuard` containment that covers this plugin's own handlers — so the approval dialog names the source plugin, and `allowsSessionApproval` is false for -every contributed tool: "Always Allow" is downgraded to a single approval. +every contributed tool that may change something: "Always Allow" is downgraded to a +single approval. A tool its provider declares read-only (`ToolSpec.isReadOnly`) may +be allowed for the session (ADFA-7147): still one explicit approval per tool, and the +grant is keyed by provider, the tool's own name and a SHA-256 of its description and +input schema rather than by the registered name, which can pass to another plugin's tool +when the sources change. A tool its provider republishes under the same name with +another description or schema therefore asks again. The grant lapses as soon as the tool list changes and the tool is changed, dropped +or no longer declares itself read-only (`ToolApprovalManager.retainSessionApprovals`), and every grant, built-in or contributed, ends with the chat: +`ChatViewModel` clears them whenever the current chat changes (new, opened, imported, or +deleted and replaced) or is cleared, since its `ToolApprovalManager` lives as long as the +plugin. The declaration is the provider's own and nothing checks it, +so a dialog offering "Always Allow" for a contributed tool says exactly that +(`ApprovalRequest.readOnlyOnProvidersWord`). For the same reason a source's own `requiresApproval = false` is ignored: `ensureApproved` returns early on it, before `allowsSessionApproval` is ever consulted, so honouring it would let a provider decline the only control there is -by asking. The dialog's title is the *registered* name, and all three -provider-supplied strings on it — the tool's own name, its description and the -source's label — are flattened and capped first, at the `ContributedToolHandler` -boundary rather than in each provider. A remote `displayName` carrying a newline -and a copy of the dialog's own header could otherwise forge structure the user -then trusts. Contributing plugins therefore ship no sanitising of their own and -depend on the installed `ai-core` for it; the two version independently. +by asking. The dialog's message opens with the *registered* name, whole, under a +short generic title (the stock title is one line, two at most, and cut a long name +off at font scale 2.0). All three provider-supplied strings on it — the tool's own +name, its description and the source's label — are flattened and capped first, at +the `ContributedToolHandler` boundary rather than in each provider. A remote +`displayName` carrying a newline and a copy of the dialog's own lines could +otherwise forge structure the user then trusts. Contributing plugins therefore +ship no sanitising of their own and depend on the installed `ai-core` for it; the +two version independently. ## System prompt config diff --git a/plugins/AI-Core/ai-core.html b/plugins/AI-Core/ai-core.html index a0eda0e4f..83c6789a6 100644 --- a/plugins/AI-Core/ai-core.html +++ b/plugins/AI-Core/ai-core.html @@ -89,9 +89,10 @@

Core functionality

edit_file; one that arrives with a name already in use is offered under a provider-prefixed name instead of being dropped.
  • Approval with provenance — the approval dialog names the plugin a - tool came from, and a contributed tool can never be blanket-approved for the - session: it asks every time, because it runs outside the path containment - that covers the agent's own tools.
  • + tool came from, and a contributed tool asks on every call, because it runs + outside the path containment that covers the agent's own tools. The one + exception is a tool its plugin says only reads: it may be allowed for the + rest of the chat, and the dialog says Code on the Go cannot check that claim.
  • Text completion, chat with history, and streaming responses, plus a single cancellation path so Stop reaches whichever backend is running.
  • @@ -185,9 +186,9 @@

    Key benefits

    backend plugin, and a new agent capability is a new tool source. Neither requires a change to AI Core or to any consumer plugin.
  • Informed consent for third-party tools — a contributed tool names - its plugin in the approval dialog and asks every single time, so approving - something that leaves the device stays a deliberate decision rather than a - side effect of one earlier tap.
  • + its plugin in the approval dialog and asks on every call, unless the plugin + says it only reads and you choose Always Allow for the rest of the chat, so + approving something that leaves the device stays a deliberate decision. diff --git a/plugins/AI-Core/build.gradle.kts b/plugins/AI-Core/build.gradle.kts index a213e96d2..e577c8345 100644 --- a/plugins/AI-Core/build.gradle.kts +++ b/plugins/AI-Core/build.gradle.kts @@ -15,8 +15,8 @@ android { applicationId = "com.itsaky.androidide.plugins.aicore" minSdk = 33 targetSdk = 36 - versionCode = 9 - versionName = "3.5.0" + versionCode = 10 + versionName = "3.6.0" } buildFeatures { diff --git a/plugins/AI-Core/src/main/assets/docs/index.html b/plugins/AI-Core/src/main/assets/docs/index.html index 9b7d780cb..19832f69b 100644 --- a/plugins/AI-Core/src/main/assets/docs/index.html +++ b/plugins/AI-Core/src/main/assets/docs/index.html @@ -177,12 +177,17 @@

    Tools from other plugins

    These tools are treated more cautiously than the agent's own, because only the plugin that supplied one knows what it does: