diff --git a/apps/sim/lib/mothership/generated/tool-catalog-v1.ts b/apps/sim/lib/mothership/generated/tool-catalog-v1.ts index 2ece49b3f3c..fce64c58f62 100644 --- a/apps/sim/lib/mothership/generated/tool-catalog-v1.ts +++ b/apps/sim/lib/mothership/generated/tool-catalog-v1.ts @@ -5440,6 +5440,7 @@ export const RunBlock: ToolCatalogEntry = { required: ['workflowId', 'blockId'], }, clientExecutable: true, + requiresApproval: true, } export const RunCode: ToolCatalogEntry = { @@ -5618,6 +5619,7 @@ export const RunFromBlock: ToolCatalogEntry = { required: ['workflowId', 'startBlockId'], }, clientExecutable: true, + requiresApproval: true, } export const RunFunction: ToolCatalogEntry = { diff --git a/apps/sim/lib/mothership/request/tools/permission.test.ts b/apps/sim/lib/mothership/request/tools/permission.test.ts index e5d74997645..9f13511ee10 100644 --- a/apps/sim/lib/mothership/request/tools/permission.test.ts +++ b/apps/sim/lib/mothership/request/tools/permission.test.ts @@ -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', () => {