{"record":{"id":"3a596bb7b6c51291","repo":"google-gemini/gemini-cli","slug":"installation-aborted-folder-absolutepath-is","errorCode":null,"errorMessage":"Installation aborted: Folder \"${absolutePath}\" is not trusted.","messagePattern":"Installation aborted: Folder \"(.+?)\" is not trusted\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cli/src/commands/extensions/install.ts","lineNumber":139,"sourceCode":"          }\n          promptLines.push('');\n        }\n\n        promptLines.push(\n          chalk.yellow(\n            'Do you want to trust this folder and continue with the installation? [y/N]: ',\n          ),\n        );\n\n        const confirmed = await promptForConsentNonInteractive(\n          promptLines.join('\\n'),\n          false,\n        );\n        if (confirmed) {\n          const trustedFolders = loadTrustedFolders();\n          await trustedFolders.setValue(realPath, TrustLevel.TRUST_FOLDER);\n        } else {\n          throw new Error(\n            `Installation aborted: Folder \"${absolutePath}\" is not trusted.`,\n          );\n        }\n      }\n    }\n\n    const requestConsent = args.consent\n      ? () => Promise.resolve(true)\n      : requestConsentNonInteractive;\n    if (args.consent) {\n      debugLogger.log('You have consented to the following:');\n      debugLogger.log(INSTALL_WARNING_MESSAGE);\n    }\n\n    const extensionManager = new ExtensionManager({\n      workspaceDir,\n      requestConsent,\n      requestSetting: args.skipSettings ? null : promptForSetting,","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/cli/src/commands/extensions/install.ts#L121-L157","documentation":"When installing a local or linked extension, if the source folder is not already trusted (isWorkspaceTrusted() returns false) and the consent prompt is declined, installation aborts. Trusting a folder is a security gate: it allows the CLI to load the folder's commands, hooks, MCP servers, agent skills, and settings — any of which could execute code on the user's behalf.","triggerScenarios":"Installing from a local path where isWorkspaceTrusted() returns false, and promptForConsentNonInteractive() returns false. In non-interactive environments (CI, pipes), the prompt defaults to declining unless consent mechanisms are configured.","commonSituations":"Installing from an untrusted directory in CI/non-interactive mode where the consent prompt cannot be answered; user deliberately declines the trust prompt for security; first-time install from a new local source.","solutions":["Pre-trust the folder using the trusted folders configuration before running install.","Run in an interactive terminal and answer 'y' to the trust prompt.","Only install extensions from reviewed and trusted sources.","Use the FolderTrustDiscoveryService output in the prompt to review what the folder contains before trusting."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { loadTrustedFolders, TrustLevel } from '../../config/trustedFolders.js';\nimport { getRealPath } from '@google/gemini-cli-core';\n\nasync function preTrustFolder(absolutePath: string): Promise<void> {\n  const realPath = getRealPath(absolutePath);\n  const trustedFolders = loadTrustedFolders();\n  await trustedFolders.setValue(realPath, TrustLevel.TRUST_FOLDER);\n}\n\n// Before installing from a known-safe local path:\nawait preTrustFolder(path.resolve(source));","typeGuard":null,"tryCatchPattern":"try {\n  await handleInstall(args);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('is not trusted')) {\n    console.error('Trust the folder first or run in an interactive terminal.');\n  } else {\n    throw e;\n  }\n}","preventionTips":["Pre-trust known-safe extension source folders using the trusted folders config.","Run installs from local sources in an interactive terminal so the trust prompt can be answered.","Review the FolderTrustDiscoveryService output carefully before trusting — it lists commands, hooks, and MCP servers that will execute."],"tags":["extensions","install","security","trust","consent"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}