mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
docs: add note about experimental hooks (#16337)
This commit is contained in:
+18
-5
@@ -4,6 +4,19 @@ Hooks are scripts or programs that Gemini CLI executes at specific points in the
|
|||||||
agentic loop, allowing you to intercept and customize behavior without modifying
|
agentic loop, allowing you to intercept and customize behavior without modifying
|
||||||
the CLI's source code.
|
the CLI's source code.
|
||||||
|
|
||||||
|
> **Note: Hooks are currently an experimental feature.**
|
||||||
|
>
|
||||||
|
> To use hooks, you must explicitly enable them in your `settings.json`:
|
||||||
|
>
|
||||||
|
> ```json
|
||||||
|
> {
|
||||||
|
> "tools": { "enableHooks": true },
|
||||||
|
> "hooks": { "enabled": true }
|
||||||
|
> }
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Both of these are needed in this experimental phase.
|
||||||
|
|
||||||
See [writing hooks guide](writing-hooks.md) for a tutorial on creating your
|
See [writing hooks guide](writing-hooks.md) for a tutorial on creating your
|
||||||
first hook and a comprehensive example.
|
first hook and a comprehensive example.
|
||||||
|
|
||||||
@@ -29,10 +42,10 @@ Gemini CLI waits for all matching hooks to complete before continuing.
|
|||||||
|
|
||||||
## Security and Risks
|
## Security and Risks
|
||||||
|
|
||||||
> [!WARNING] **Hooks execute arbitrary code with your user privileges.**
|
> **Warning: Hooks execute arbitrary code with your user privileges.**
|
||||||
|
>
|
||||||
By configuring hooks, you are explicitly allowing Gemini CLI to run shell
|
> By configuring hooks, you are explicitly allowing Gemini CLI to run shell
|
||||||
commands on your machine. Malicious or poorly configured hooks can:
|
> commands on your machine. Malicious or poorly configured hooks can:
|
||||||
|
|
||||||
- **Exfiltrate data**: Read sensitive files (`.env`, ssh keys) and send them to
|
- **Exfiltrate data**: Read sensitive files (`.env`, ssh keys) and send them to
|
||||||
remote servers.
|
remote servers.
|
||||||
@@ -46,7 +59,7 @@ project hook (identified by its name and command), but it is **your
|
|||||||
responsibility** to review these hooks (and any installed extensions) before
|
responsibility** to review these hooks (and any installed extensions) before
|
||||||
trusting them.
|
trusting them.
|
||||||
|
|
||||||
> [!NOTE] Extension hooks are subject to a mandatory security warning and
|
> **Note:** Extension hooks are subject to a mandatory security warning and
|
||||||
> consent flow during extension installation or update if hooks are detected.
|
> consent flow during extension installation or update if hooks are detected.
|
||||||
> You must explicitly approve the installation or update of any extension that
|
> You must explicitly approve the installation or update of any extension that
|
||||||
> contains hooks.
|
> contains hooks.
|
||||||
|
|||||||
Reference in New Issue
Block a user