Answer: Hooks execute arbitrary code with your user privileges, allowing scripts to run shell commands on your machine. Project-level hooks are particularly risky when opening untrusted projects, though Gemini CLI fingerprints project hooks and warns you if a hook's name or command changes. Status: Confirmed Entry: tool/gemini-cli/permissions-and-security/hook-security-risks Revision: 1 Digest: sha256:9c97601aad93b2b3 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:18:31Z Last changed: 2026-11-13T03:18:31Z Last verified: 2026-11-20T12:53:00Z Next check: 2026-11-21T12:53:00Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of main risk | Hooks execute arbitrary code with your user privileges | [1] | 2026-11-20 project-level risk | Project-level hooks | [1] | 2026-11-20 mitigation | fingerprints | [1] | 2026-11-20 untrusted hook warning | new, untrusted hook | [1] | 2026-11-20 Sources: [1] Google. "Gemini CLI hooks". https://geminicli.com/docs/hooks.md Role: primary. Accessed: 2026-11-20T12:53:00Z Quote: "Hooks execute arbitrary code with your user privileges." (Supports: main risk) Quote: "**Project-level hooks** are particularly risky when opening untrusted projects." (Supports: project-level risk) Quote: "Gemini CLI **fingerprints** project hooks." (Supports: mitigation) Quote: "it is treated as a **new, untrusted hook** and" (Supports: untrusted hook warning) Published: 2026-10-16T02:36:07Z Snapshot SHA-256: a06a92438d3110690e875d61feef49a850d82eda618bb837146a1a7ff7a4c8d9 (captured 2026-11-13T03:18:31Z) 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:18:31Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:53:00Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:53:00Z Last attempt: 2026-11-20T12:53:00Z Notes and limitations: Extracted automatically from a single official source (section "Security and risks"). Related: https://latestn.com/tool/gemini-cli/permissions-and-security/hook-security-risks-2 What are the security risks of using Gemini CLI hooks and how can I mitigate them? https://latestn.com/tool/gemini-cli/permissions-and-security/mcp-oauth-authentication How do I set up OAuth authentication for a remote MCP server in Gemini CLI? https://latestn.com/tool/gemini-cli/permissions-and-security/plan-mode-tool-restrictions What tools are restricted in Gemini CLI Plan Mode? https://latestn.com/tool/gemini-cli/permissions-and-security/enable-sandboxing How do I enable sandboxing in Gemini CLI? https://latestn.com/tool/gemini-cli/permissions-and-security/enable-sandboxing-dev How do I enable sandboxing when developing Gemini CLI? https://latestn.com/tool/gemini-cli/permissions-and-security/enable-trusted-folders How do I enable Trusted Folders in Gemini CLI? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:18:31Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/gemini-cli/permissions-and-security/hook-security-risks/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/permissions-and-security/hook-security-risks POST: https://latestn.com/dispute/tool/gemini-cli/permissions-and-security/hook-security-risks with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/gemini-cli/permissions-and-security/hook-security-risks?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). What are the security risks of using hooks in Gemini CLI? Revision 1, last verified 2026-11-20T12:53:00Z. https://latestn.com/tool/gemini-cli/permissions-and-security/hook-security-risks (accessed 2026-11-21T09:54:59Z). @misc{LatestN_tool_gemini_cli_permissions_and_security_hook_security_risks_r1, title = {What are the security risks of using hooks in Gemini CLI?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/gemini-cli/permissions-and-security/hook-security-risks}}, note = {Revision 1; digest sha256:9c97601aad93b2b3; last verified 2026-11-20T12:53:00Z; accessed 2026-11-21T09:54:59Z} } 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/permissions-and-security/hook-security-risks