diff --git a/plugins/AI-Core/README.md b/plugins/AI-Core/README.md index adb01699e..11640aa8b 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 if the tool stops +declaring itself read-only, 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..591077eb8 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.
  • diff --git a/plugins/AI-Core/src/main/assets/docs/index.html b/plugins/AI-Core/src/main/assets/docs/index.html index 9b7d780cb..02528f628 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: