google-gemini/gemini-cli · warning
[Configuration] Untrusted workspace detected. Stripping repo
Error message
[Configuration] Untrusted workspace detected. Stripping repository telemetry definitions to prevent unintended data routing.
What it means
Security warning from loadConfig: when the workspace is not trusted, repository-defined telemetry settings are stripped so a cloned repo cannot redirect where usage data is sent. Loading proceeds; the repo's telemetry configuration is ignored and defaults apply.
Source
Thrown at packages/a2a-server/src/config/config.ts:312
);
}
if (settings.policyPaths) {
logger.warn(
'[Configuration] Untrusted workspace detected. Stripping repository policyPaths definitions to prevent unintended policy override.',
);
}
if (settings.adminPolicyPaths) {
logger.warn(
'[Configuration] Untrusted workspace detected. Stripping repository adminPolicyPaths definitions to prevent unintended admin policy override.',
);
}
if (settings.tools) {
logger.warn(
'[Configuration] Untrusted workspace detected. Stripping repository tools definitions to prevent unintended tool enablement.',
);
}
if (settings.telemetry) {
logger.warn(
'[Configuration] Untrusted workspace detected. Stripping repository telemetry definitions to prevent unintended data routing.',
);
}
settings = {
...settings,
mcpServers: undefined,
policyPaths: undefined,
adminPolicyPaths: undefined,
tools: undefined,
telemetry: undefined,
};
}
const safeMcpServers = settings.mcpServers;
const policySettings: PolicySettings = {
mcpServers: safeMcpServers,
tools: {
core: settings.tools?.core,View on GitHub (pinned to 0bd1d43975)
Solutions
- Enable workspace trust (settings.folderTrust=true or GEMINI_FOLDER_TRUST=true and pass trusted=true to loadConfig)
- Move telemetry settings to user-level/global settings so they are honored
- Remove repo-level telemetry settings if not needed
- Accept the warning: telemetry falls back to defaults
Example fix
// before
// untrusted workspace + project settings: { "telemetry": { "outfile": "./otlp.json" } } -> stripped
// after
export GEMINI_FOLDER_TRUST=true
// or user-level settings:
{ "folderTrust": true, "telemetry": { "outfile": "/abs/path/otlp.json" } } Defensive patterns
Strategy: validation
Validate before calling
export function assertTelemetrySurvive(settings: { telemetry?: unknown; folderTrust?: boolean }): void {
const trusted = settings.folderTrust === true || process.env['GEMINI_FOLDER_TRUST'] === 'true';
if (!trusted && settings.telemetry) {
throw new Error('Workspace is untrusted: repository telemetry configuration will be stripped. Enable folderTrust or move telemetry config to user settings.');
}
} Type guard
function isTrustedWorkspace(s: { folderTrust?: boolean }): boolean {
return s.folderTrust === true || process.env['GEMINI_FOLDER_TRUST'] === 'true';
} Prevention
- Configure telemetry (OTel endpoints) at user level, not repo level
- Set GEMINI_FOLDER_TRUST=true only for owned workspaces
- Confirm telemetry settings took effect after loadConfig
- Review logs for stripping warnings when provisioning environments
When it happens
Trigger: loadConfig called with trusted=false while settings.telemetry is set in project settings; workspace trust not enabled (folderTrust=false, GEMINI_FOLDER_TRUST!=true).
Common situations: Repo ships telemetry (OTel endpoint) configuration that stops applying after cloning; CI/container without the trust env var; version upgrade that added telemetry stripping in untrusted workspaces.
Related errors
- [Configuration] Untrusted workspace detected. Stripping repo
- [Configuration] Untrusted workspace detected. Stripping repo
- [Configuration] Untrusted workspace detected. Stripping repo
- [Configuration] Untrusted workspace detected. Stripping repo
- Could not install extension because the current workspace at
AI-assisted analysis of google-gemini/gemini-cli@0bd1d43975 (2026-09-01).
Data as JSON: /api/errors/e965b5380c831e21.
Report an issue: GitHub.