google-gemini / google-gemini/gemini-cli

Docs: env var redaction section uses setting keys that do not exist

Open Beginner friendly
#29,007 0 comments 0 reactions 0 assignees View on GitHub
area/documentation kind/bug priority/p2 status/bot-triaged
Dominant language
TypeScript
Stars
107k
Forks
14.6k
Avg merge
2d 3h
Merged PRs (30d)
45

Description

### What happened?

The "Environment variable redaction" section of `docs/reference/configuration.md` tells you to configure redaction with these keys:

```json
{
"security": {
"allowedEnvironmentVariables": ["MY_PUBLIC_KEY", "NOT_A_SECRET_TOKEN"],
"blockedEnvironmentVariables": ["INTERNAL_IP_ADDRESS"]
}
}
```

Neither key exists. `schemas/settings.schema.json` contains no `allowedEnvironmentVariables` or `blockedEnvironmentVariables` anywhere, and `security` is declared `"additionalProperties": false`, so that example is actually schema-invalid — an editor using the published schema flags it.

The real settings are nested one level deeper, under `security.environmentVariableRedaction`:

- `security.environmentVariableRedaction.allowed`
- `security.environmentVariableRedaction.blocked`
- `security.environmentVariableRedaction.enabled`

That's what `packages/cli/src/config/config.ts` actually reads:

```ts
blockedEnvironmentVariables:
settings.security?.environmentVariableRedaction?.blocked,
allowedEnvironmentVariables:
settings.security?.environmentVariableRedaction?.allowed,
enableEnvironmentVariableRedaction:
settings.security?.environmentVariableRedaction?.enabled,
```

The same document already documents the correct keys at the settings list further up (the `security.environmentVariableRedaction.*` entries), so the page contradicts itself.

There's a second problem in the same section: it never mentions `enabled`, which defaults to `false` (`packages/core/src/config/config.ts`: `params.enableEnvironmentVariableRedaction ?? false`). The section describes redaction behavior in detail as though it's active, but redaction is off unless you explicitly turn it on.

This matters more than a typical docs typo because it's a security feature. Someone follows the docs, adds the documented keys, and reasonably believes secrets are being redacted — when nothing reads those keys and the feature is off by default.

### What did you expect to happen?

The configuration section should use the key names the CLI actually reads (`security.environmentVariableRedaction.allowed` / `.blocked`), and should say that `enabled` defaults to `false` so readers know the described behavior requires opting in.

### Client information

Found by reading the source rather than at runtime, so this isn't version-specific behavior — it's a mismatch between `docs/reference/configuration.md`, `schemas/settings.schema.json`, and `packages/cli/src/config/config.ts` on current `main` (package version `0.56.0-nightly.20260806.g761f604c1`).

Reproducible without running the CLI: search the schema for `allowedEnvironmentVariables` (0 hits), then compare with the `security.environmentVariableRedaction` block.

Contributor guide

Open the contributing guide

Research direction

Update the environment variable redaction section in docs/reference/configuration.md, using the security.environmentVariableRedaction entries already listed above. Compare the example with schemas/settings.schema.json and the reads in packages/cli/src/config/config.ts; document allowed, blocked, and enabled, including that enabled defaults to false. Done when the example is schema-valid and no longer contradicts the source or settings list.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation, security
Issue type
Documentation
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
90/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.