Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/sim/lib/mothership/generated/tool-catalog-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5440,6 +5440,7 @@ export const RunBlock: ToolCatalogEntry = {
required: ['workflowId', 'blockId'],
},
clientExecutable: true,
requiresApproval: true,
}

export const RunCode: ToolCatalogEntry = {
Expand Down Expand Up @@ -5618,6 +5619,7 @@ export const RunFromBlock: ToolCatalogEntry = {
required: ['workflowId', 'startBlockId'],
},
clientExecutable: true,
requiresApproval: true,
}

export const RunFunction: ToolCatalogEntry = {
Expand Down
16 changes: 16 additions & 0 deletions apps/sim/lib/mothership/request/tools/permission.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,22 @@ describe('gated tools are askable', () => {

expect(ungatable).toEqual([])
})

it('gates every tool that runs a workflow', async () => {
// They all reach the same executor: run_from_block runs everything
// downstream of its start block, so an ungated sibling would run what
// run_workflow asks about without asking.
const { TOOL_CATALOG } = await vi.importActual<
typeof import('@/lib/mothership/generated/tool-catalog-v1')
>('@/lib/mothership/generated/tool-catalog-v1')
const { WORKFLOW_TOOL_NAMES } = await vi.importActual<
typeof import('@/lib/mothership/tools/client-executed-tools')
>('@/lib/mothership/tools/client-executed-tools')

const ungated = WORKFLOW_TOOL_NAMES.filter((name) => !TOOL_CATALOG[name]?.requiresApproval)

expect(ungated).toEqual([])
})
})

describe('runGatedToolExecution', () => {
Expand Down
Loading