Repository navigation
docs(agents): scope tool OBO claim to plugin-toolkit tools - #581
Merged
Merged
Conversation
The Level 1 invoke-routes paragraph claimed "every tool call runs through
asUser(req)". That holds only for plugin-toolkit tools, which dispatch via
PluginContext.executeTool -> provider.asUser(req) (plugin-context.ts). A
hand-rolled tool({ execute }) is called directly with only its validated args
(no req), so it runs as the app's service principal and cannot opt into OBO.
Scope the OBO/UC guarantee to plugin-toolkit tools, keep the telemetry note
(traceTool wraps every dispatch), and point at execution-context.md.
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
ditadi
approved these changes
Sep 11, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The Level 1 section of
docs/plugins/agents.md(invoke-routes paragraph) claimed:That OBO guarantee is only true for plugin-toolkit tools. It is false for hand-rolled
tool({ execute })tools, which run as the app's service principal — a security-relevant claim for anyone wiring an ambient tool that touches user data.Evidence (code)
Tool dispatch splits by source in
packages/appkit/src/plugins/agents/tool-dispatch.ts→runToolEntry:case "toolkit"(tool-dispatch.ts:179) →deps.context.executeTool(runState.req, …), andexecuteToolwraps the call inprovider.asUser(req)(plugin-context.ts:231). User identity.case "function"(tool-dispatch.ts:197) →entry.functionTool.execute(args)directly. Noreq, noasUser, norunInUserContext. Service-principal identity.The public
tool({ execute })signature isexecute: (args) => …(tools/tool.ts:49) — it receives only the validated arguments, neverreq, so a hand-rolled tool cannot opt into OBO even if it wanted to. The agents plugin sets up no ambient user-context ALS around the run (noasUser/runInUserContextreferences inagents.ts), sogetWorkspaceClient()inside such a tool resolves to the SP client.The telemetry half of the original sentence is true for all tools —
traceTool(tool-dispatch.ts:142) wraps every dispatch — so that part is preserved.Change
Rewords the one sentence to:
asUser(req)/ SQL-as-user / UC-ACL guarantee to plugin-toolkit tool calls.tool({ execute })runs as the service principal and cannot opt into OBO.execution-context.md.Docs-only, one line changed.
Verification
./execution-context.mdconfirmed to exist as a sibling; matches the doc's existing relative-link idiom (./stability.md). Both<name>occurrences are inside inline-code spans, so MDX will not parse them as JSX.pnpm docs:build/ typecheck — this worktree has nonode_modulesinstalled and I did not install deps. DocusaurusonBrokenLinks: "throw"will validate the link in CI.This pull request and its description were written by Isaac.