google-gemini/gemini-cli · warning
Installation aborted: Folder "${absolutePath}" is not truste
Error message
Installation aborted: Folder "${absolutePath}" is not trusted. What it means
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.
Source
Thrown at packages/cli/src/commands/extensions/install.ts:139
}
promptLines.push('');
}
promptLines.push(
chalk.yellow(
'Do you want to trust this folder and continue with the installation? [y/N]: ',
),
);
const confirmed = await promptForConsentNonInteractive(
promptLines.join('\n'),
false,
);
if (confirmed) {
const trustedFolders = loadTrustedFolders();
await trustedFolders.setValue(realPath, TrustLevel.TRUST_FOLDER);
} else {
throw new Error(
`Installation aborted: Folder "${absolutePath}" is not trusted.`,
);
}
}
}
const requestConsent = args.consent
? () => Promise.resolve(true)
: requestConsentNonInteractive;
if (args.consent) {
debugLogger.log('You have consented to the following:');
debugLogger.log(INSTALL_WARNING_MESSAGE);
}
const extensionManager = new ExtensionManager({
workspaceDir,
requestConsent,
requestSetting: args.skipSettings ? null : promptForSetting,View on GitHub (pinned to 5024443c72)
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.
Defensive patterns
Strategy: validation
Validate before calling
import { loadTrustedFolders, TrustLevel } from '../../config/trustedFolders.js';
import { getRealPath } from '@google/gemini-cli-core';
async function preTrustFolder(absolutePath: string): Promise<void> {
const realPath = getRealPath(absolutePath);
const trustedFolders = loadTrustedFolders();
await trustedFolders.setValue(realPath, TrustLevel.TRUST_FOLDER);
}
// Before installing from a known-safe local path:
await preTrustFolder(path.resolve(source)); Try / catch
try {
await handleInstall(args);
} catch (e) {
if (e instanceof Error && e.message.includes('is not trusted')) {
console.error('Trust the folder first or run in an interactive terminal.');
} else {
throw e;
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Could not install extension because the current workspace at
- The source argument must be provided.
- Invalid regex pattern in allowedExtensions setting: "${patte
- Installing extension from source "${installMetadata.source}"
- Installing extensions from remote sources is disallowed by y
AI-assisted analysis of google-gemini/gemini-cli@5024443c72 (2026-08-12).
Data as JSON: /api/errors/3a596bb7b6c51291.
Report an issue: GitHub.