Skip to content

fix(tools): pin v2 tool execution credentials to the request workspace - #10323

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/v2-tool-execute-credential-workspace
Nov 23, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/v2-tool-execute-credential-workspace

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • POST /api/v2/tools/{toolId}/execute checked allowedIntegrations and deniedTools against the request workspace, but the executor authorized the caller-supplied credentialId with no workflow and no workspace, so the cross-workspace check in authorizeCredentialUseForAuth never ran
  • A member of two workspaces could run workspace A's credential under workspace B's policy
  • executeToolForCaller now authorizes credentialId against the request workspace before billing or dispatch and answers 403 otherwise — the same pattern binding-targets.ts and the selector path use
  • One uniform 403 for unknown, foreign, and other-workspace credentials, so it is not an existence oracle
  • OpenAPI description for the route documents the new 403

Type of Change

  • Bug fix

Testing

  • execute-tool.test.ts: new test runs the real authorizeCredentialUseForAuth with a credential from another workspace and expects a refusal with no dispatch; red with the guard reverted, 32/32 green with it
  • check:openapi, check:test-patterns, check:comment-hygiene, check:boundaries, check:actorless-executor-operations, check:source-conventions, check:explicit-any, biome
  • Affected-workspace type-check and bun run generate via the pre-push hook; full check:audits left to CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

POST /api/v2/tools/{toolId}/execute evaluated allowedIntegrations and
deniedTools against the request workspace, but the executor authorized
the caller-supplied credentialId with no workflow and no workspace, so a
credential from another workspace the caller belongs to ran under the
request workspace's policy. Authorize the credential against the request
workspace before dispatch.
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 22, 2026 11:55pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

The PR checks that a supplied credentialId belongs to the request workspace and is usable by the caller before billing checks or tool dispatch.

  • Tool calls only use credentials from their request workspace.

Reviews (1) · Last reviewed commit: "fix(tools): pin v2 tool execution creden..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 1ad379f into staging Nov 23, 2026
87 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/v2-tool-execute-credential-workspace branch November 23, 2026 00:36

This branch was successfully deployed

1 active deployment
Preview — 3210b98d Deployed Nov 22, 2026 by vercel[bot]
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.

1 participant