Answer: In headless or automated environments where interactive prompts are not possible, the trust dialog cannot be displayed; if the folder is untrusted and Folder Trust is enabled, the CLI throws a `FatalUntrustedWorkspaceError` and exits. To proceed, you can bypass the trust check with the `--skip-trust` flag or by setting the `GEMINI_CLI_TRUST_WORKSPACE=true` environment variable, which trust the current workspace for the duration of the session without prompting. Status: Confirmed Entry: tool/gemini-cli/agents-and-automation/trusted-folders-headless Revision: 1 Digest: sha256:20c6b16dbe1b6c63 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:17:54Z Last changed: 2026-11-13T03:17:54Z Last verified: 2026-11-20T12:51:45Z Next check: 2026-11-21T12:51:45Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Error thrown | FatalUntrustedWorkspaceError | [1] | 2026-11-20 Command-line flag | --skip-trust | [1] | 2026-11-20 Environment variable | GEMINI_CLI_TRUST_WORKSPACE=true | [1] | 2026-11-20 Session scope | for the duration of the session | [1] | 2026-11-20 Sources: [1] Google. "Trusted Folders". https://geminicli.com/docs/cli/trusted-folders.md Role: primary. Accessed: 2026-11-20T12:51:45Z Quote: "the CLI will throw a `FatalUntrustedWorkspaceError` and exit." (Supports: Error thrown) Quote: "Run the CLI with the `--skip-trust` flag." (Supports: Command-line flag) Quote: "Set the `GEMINI_CLI_TRUST_WORKSPACE=true` environment variable." (Supports: Environment variable) Quote: "These methods will trust the current workspace for the duration of the session without prompting." (Supports: Session scope) Published: 2026-10-16T02:36:07Z Snapshot SHA-256: f994664cdbb7f206bca5ea61cea0004d9e8f039454c0204d068d8f42e1cb0c48 (captured 2026-11-13T03:17:53Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:17:54Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:51:45Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:51:45Z Last attempt: 2026-11-20T12:51:45Z Notes and limitations: Extracted automatically from a single official source (section "Headless and automated environments"). Related: https://latestn.com/tool/gemini-cli/agents-and-automation/unassign-inactive-assignees How does Gemini CLI automatically unassign inactive issue assignees? https://latestn.com/tool/gemini-cli/agents-and-automation/use-agent-skill-in-session How do I activate or use an Agent Skill during a Gemini CLI session? https://latestn.com/tool/gemini-cli/agents-and-automation/write-skill-description How do I write a good description for a Gemini CLI Agent Skill? https://latestn.com/tool/gemini-cli/agents-and-automation/streaming-json-event-types What event types does Gemini CLI streaming JSON output emit? https://latestn.com/tool/gemini-cli/agents-and-automation/tool-hook-matchers How do I use a matcher to filter which tools a Gemini CLI hook runs for? https://latestn.com/tool/gemini-cli/agents-and-automation/trigger-headless-mode How do I trigger headless mode in Gemini CLI? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:17:54Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/gemini-cli/agents-and-automation/trusted-folders-headless/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/gemini-cli/agents-and-automation/trusted-folders-headless POST: https://latestn.com/dispute/tool/gemini-cli/agents-and-automation/trusted-folders-headless with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/gemini-cli/agents-and-automation/trusted-folders-headless?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How does Gemini CLI handle trusted folders in headless or automated environments? Revision 1, last verified 2026-11-20T12:51:45Z. https://latestn.com/tool/gemini-cli/agents-and-automation/trusted-folders-headless (accessed 2026-11-21T10:06:22Z). @misc{LatestN_tool_gemini_cli_agents_and_automation_trusted_folders_headless_r1, title = {How does Gemini CLI handle trusted folders in headless or automated environments?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/gemini-cli/agents-and-automation/trusted-folders-headless}}, note = {Revision 1; digest sha256:20c6b16dbe1b6c63; last verified 2026-11-20T12:51:45Z; accessed 2026-11-21T10:06:22Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/gemini-cli/agents-and-automation/trusted-folders-headless