Code change:
return { tasks, taskNames, locations }; } <del> public static async promptForPermission(taskService: ITaskService, storageService: IStorageService, notificationService: INotificationService, workspaceTrustManagementService: IWorkspaceTrustManagementService, </del> <ins> public static async runWithPermission(taskService: ITaskService, storageService: IStorageService, notificationService: INotificationService, workspaceTrustManagementService: IWorkspaceTrustManagementService, </ins> openerService: IOpenerService, configurationService: IConfigurationService, workspaceTaskResult: Map<string, IWorkspaceFolderTaskResult>) { const isWorkspaceTrusted = workspaceTrustManagementService.isWorkspaceTrusted; <del> if (!isWorkspaceTrusted) { </del> <ins> if (!isWorkspaceTrusted || configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'off') { </ins> return; } <del> if (configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'off') { </del> <ins> const hasShownPromptForAutomaticTasks = storageService.getBoolean(HAS_PROMPTED_FOR_AUTOMATIC_TASKS, StorageScope.WORKSPACE, false); const { tasks, taskNames, locations } = RunAutomaticTasks._findAutoTasks(taskService, workspaceTaskResult); if (taskNames.length === 0) { </ins> return; } <del> const hasShownPromptForAutomaticTasks = storageService.getBoolean(HAS_PROMPTED_FOR_AUTOMATIC_TASKS, StorageScope.WORKSPACE, undefined); const { tasks, taskNames, locations } = RunAutomaticTasks._findAutoTasks(taskService, workspaceTaskResult); if (taskNames.length > 0) { if (configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'on') { RunAutomaticTasks._runTasks(taskService, tasks); } else if (!hasShownPromptForAutomaticTasks) { // We have automatic tasks, prompt to allow. this._showPrompt(notificationService, storageService, openerService, configurationService, taskNames, locations).then(allow => { if (allow) { RunAutomaticTasks._runTasks(taskService, tasks); } }); } </del> <ins> if (configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'on') { RunAutomaticTasks._runTasks(taskService, tasks); } else if (configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'auto' && !hasShownPromptForAutomaticTasks) { // by default, only prompt once per folder // otherwise, this can be configured via the setting this._showPrompt(notificationService, storageService, openerService, configurationService, taskNames, locations).then(allow => { if (allow) { storageService.store(HAS_PROMPTED_FOR_AUTOMATIC_TASKS, true, StorageScope.WORKSPACE, StorageTarget.USER); RunAutomaticTasks._runTasks(taskService, tasks); } }); </ins> } }

Related discussion:
text: Type: <bBug</bVSCode, create a folder named, for instance, "XXXX". that folder create another called .vscode .vscode create a file named with this content: VSCode sure the setting "task.allowAutomaticTasks" is not set or is set to its defautl value "auto". "XXXX" with VSCode. VSCode will run "echo Hello" without asking you whether you want to run tasks configured with "runOn": "folderOpen" or not. VS Code version: Code 1.70.2 (, 2022-08-16T05:35:13.448Z) OS version: WindowsNT x64 10.0. Modes: <details<summarySystem Info</summary </details<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --
This happens because you have presumably opened a trusted workspace - which is now when we allow these to be run if the setting is "auto" for allow automatic task
The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our . Happy Coding!
! If I understood it correctly, the popup that supposedly asks you whether you want to run these tasks is not actually meant to appear ever because if the workspace is trusted it will be executed without asking you and if it is not trusted then it will just not exeute them instead of asking you. Doesn't it look kinda pointless to have in the description of the option of the configuration "Prompt for permission for each folder"? You are never prompted anyways.
I this configuration and I am still not prompted anyways:
No I did not. Please next time ask the user if he did X before assuming it and closing the issue. I tried reproducing the problem with and without a trusted workspace and the problem persists anyways.
i'll investigate this that shouldn't happen
Tasks will only run in trusted workspaces, so I will update the setting description to indicate that. Also need to fix the prompt not happening per folder.