{"record":{"id":"9c71be8046ae88ea","repo":"google-gemini/gemini-cli","slug":"yolo-mode-is-disabled-by-your-administrator-to-en","errorCode":null,"errorMessage":"YOLO mode is disabled by your administrator. To enable it, please request an update to the settings at: https://goo.gle/manage-gemini-cli","messagePattern":"YOLO mode is disabled by your administrator\\. To enable it, please request an update to the settings at: https://goo\\.gle/manage-gemini-cli","errorType":"exception","errorClass":"FatalConfigError","httpStatus":null,"severity":"critical","filePath":"packages/cli/src/config/config.ts","lineNumber":747,"sourceCode":"        );\n    }\n  } else {\n    approvalMode = ApprovalMode.DEFAULT;\n  }\n\n  // Override approval mode if disableYoloMode is set.\n  if (settings.security?.disableYoloMode || settings.admin?.secureModeEnabled) {\n    if (approvalMode === ApprovalMode.YOLO) {\n      if (settings.admin?.secureModeEnabled) {\n        debugLogger.error(\n          'YOLO mode is disabled by \"secureModeEnabled\" setting.',\n        );\n      } else {\n        debugLogger.error(\n          'YOLO mode is disabled by the \"disableYolo\" setting.',\n        );\n      }\n      throw new FatalConfigError(\n        getAdminErrorMessage('YOLO mode', undefined /* config */),\n      );\n    }\n  } else if (approvalMode === ApprovalMode.YOLO) {\n    debugLogger.warn(\n      'YOLO mode is enabled. All tool calls will be automatically approved.',\n    );\n  }\n\n  // Force approval mode to default if the folder is not trusted.\n  if (!trustedFolder && approvalMode !== ApprovalMode.DEFAULT) {\n    debugLogger.warn(\n      `Approval mode overridden to \"default\" because the current folder is not trusted.`,\n    );\n    approvalMode = ApprovalMode.DEFAULT;\n  }\n\n  let telemetrySettings;","sourceCodeStart":729,"sourceCodeEnd":765,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/cli/src/config/config.ts#L729-L765","documentation":"Thrown as a `FatalConfigError` when the resolved approval mode is `YOLO` but an administrator has locked it down via either `settings.security.disableYoloMode` or `settings.admin.secureModeEnabled`. The error message is built by `getAdminErrorMessage` and points users at the admin manage URL. Because YOLO auto-approves every tool call, admin policy treats it as a security boundary and refuses to start the session.","triggerScenarios":"User passes `--yolo` or sets `defaultApprovalMode: yolo` while the org/admin config sets `disableYoloMode: true` or `secureModeEnabled: true`; a managed enterprise install with secure mode enforced; CI scripts that hard-code `--yolo` against a locked-down deployment.","commonSituations":"Enterprise / managed Gemini CLI installations; shared machines with secure mode; users unaware their settings file was centrally provisioned; scripts ported from a personal machine where YOLO was allowed.","solutions":["Drop the `--yolo` flag and the `yolo` setting; use `default` or `auto_edit` instead.","Request an administrator update the managed settings (URL in the error message).","In scripts, detect `disableYoloMode`/`secureModeEnabled` before passing `--yolo`."],"exampleFix":"// before\ngemini --yolo -p \"refactor this\"\n// after\ngemini --approval-mode default -p \"refactor this\"","handlingStrategy":"validation","validationCode":"function canUseYolo(settings: MergedSettings): boolean {\n  return !settings.security?.disableYoloMode && !settings.admin?.secureModeEnabled;\n}\nif (!canUseYolo(settings) && approvalMode === 'yolo') {\n  throw new Error('YOLO disabled by admin policy; use default or auto_edit.');\n}","typeGuard":"function yoloAllowed(settings: unknown): boolean {\n  const s = (settings ?? {}) as { security?: { disableYoloMode?: boolean }, admin?: { secureModeEnabled?: boolean } };\n  return !s.security?.disableYoloMode && !s.admin?.secureModeEnabled;\n}","tryCatchPattern":null,"preventionTips":["Detect admin lockdown before passing `--yolo` in scripts.","Treat `secureModeEnabled` as authoritative; it can't be overridden by a flag.","Document the admin URL so end users know where to request changes."],"tags":["cli","security","admin","yolo","policy"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}