Skip to content

docs(agents): scope tool OBO claim to plugin-toolkit tools - #581

Merged
MarioCadenas merged 1 commit into
mainfrom
docs/agents-tool-obo-scope
Sep 11, 2026
Merged

MarioCadenas merged 1 commit into
mainfrom
docs/agents-tool-obo-scope

Conversation

@MarioCadenas

Copy link
Copy Markdown
Collaborator

Problem

The Level 1 section of docs/plugins/agents.md (invoke-routes paragraph) claimed:

Every tool call runs through asUser(req) so SQL executes as the requesting user, file access respects Unity Catalog ACLs, and telemetry spans are created automatically.

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, …), and executeTool wraps the call in provider.asUser(req) (plugin-context.ts:231). User identity.
  • case "function" (tool-dispatch.ts:197) → entry.functionTool.execute(args) directly. No req, no asUser, no runInUserContext. Service-principal identity.

The public tool({ execute }) signature is execute: (args) => … (tools/tool.ts:49) — it receives only the validated arguments, never req, 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 (no asUser/runInUserContext references in agents.ts), so getWorkspaceClient() 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:

  • Keep the "every tool call is traced" claim (accurate).
  • Scope the asUser(req) / SQL-as-user / UC-ACL guarantee to plugin-toolkit tool calls.
  • State that hand-rolled tool({ execute }) runs as the service principal and cannot opt into OBO.
  • Point readers to execution-context.md.

Docs-only, one line changed.

Verification

  • Link target ./execution-context.md confirmed 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.
  • Not run: pnpm docs:build / typecheck — this worktree has no node_modules installed and I did not install deps. Docusaurus onBrokenLinks: "throw" will validate the link in CI.

This pull request and its description were written by Isaac.

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>
@MarioCadenas
MarioCadenas requested a review from a team as a code owner September 11, 2026 09:34
@MarioCadenas
MarioCadenas merged commit b2af948 into main Sep 11, 2026
9 checks passed
@MarioCadenas
MarioCadenas deleted the docs/agents-tool-obo-scope branch September 11, 2026 09:54
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.

2 participants