Skip to content

docs: document tool exclusion from memory via deny policy#21428

Merged
g-samroberts merged 3 commits intomainfrom
abhijit-2592/policy-docs-exclude-tools
Mar 9, 2026
Merged

docs: document tool exclusion from memory via deny policy#21428
g-samroberts merged 3 commits intomainfrom
abhijit-2592/policy-docs-exclude-tools

Conversation

@Abhijit-2592
Copy link
Contributor

Summary

This PR updates the policy engine documentation to explain that global deny rules exclude tools from the model's memory (function declarations). It also notes the deprecation of the legacy excludeTools setting.

Details

  • Added clarification to docs/reference/policy-engine.md about how deny decisions impact tool visibility for the model.
  • Documented that excludeTools in settings.json is deprecated in favor of the Policy Engine's deny rules.
  • Verified in packages/core/src/tools/tool-registry.ts that getActiveTools correctly filters these tools.

Related Issues

Closes #21427

How to Validate

  1. View the changes in docs/reference/policy-engine.md.
  2. Verify that the explanation for deny decisions correctly describes the memory exclusion behavior.
  3. Confirm the deprecation note for excludeTools is clear.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run

@Abhijit-2592 Abhijit-2592 requested review from a team as code owners March 6, 2026 18:00
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the documentation for the policy engine, providing crucial clarity on how deny rules operate. It specifically details that global deny policies not only block tool execution but also remove those tools entirely from the model's memory, improving security and optimizing context usage. Furthermore, it officially deprecates the older excludeTools setting, consolidating tool exclusion practices under the more robust policy engine framework.

Highlights

  • Policy Engine deny rule clarification: Clarified that global deny rules in the policy engine completely exclude tools from the model's memory, enhancing security and saving context window space.
  • excludeTools deprecation: Documented the deprecation of the legacy excludeTools setting in settings.json, recommending the use of policy engine deny rules instead.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Size Change: -4 B (0%)

Total Size: 26 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 25.5 MB -4 B (0%)
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation for the policy engine. It clarifies that global deny rules also remove tools from the model's memory, and it adds a note deprecating the legacy excludeTools setting. While the added details are helpful, the deprecation note is ambiguous as there are multiple settings for excluding tools (tools.exclude, mcpServers.<serverName>.excludeTools). The high-severity comment addressing this ambiguity has been kept as it aligns with the rule for maintaining consistency in documentation, preventing potential user confusion and security misconfigurations.

Note: Security Review has been skipped due to the limited scope of the PR.

@gemini-cli gemini-cli bot added area/documentation Gemini CLI documentation tasks and issues 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Mar 6, 2026
@g-samroberts g-samroberts self-assigned this Mar 9, 2026
@g-samroberts g-samroberts enabled auto-merge March 9, 2026 16:27
@g-samroberts g-samroberts added this pull request to the merge queue Mar 9, 2026
Merged via the queue into main with commit 09e9982 Mar 9, 2026
27 checks passed
@g-samroberts g-samroberts deleted the abhijit-2592/policy-docs-exclude-tools branch March 9, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Gemini CLI documentation tasks and issues 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: document tool exclusion from memory via deny policy and deprecate excludeTools

3 participants