feat(browser): add sensitive action controls and read-only noise reduction#22867
Conversation
|
Hi @cynthialong0-0, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
|
Size Change: +3.6 kB (+0.01%) Total Size: 26.3 MB
ℹ️ View Unchanged
|
Summary of ChangesHello, 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 significantly enhances the security and user control capabilities of the browser agent by introducing granular controls over sensitive actions. It allows administrators to enforce hard blocks on file uploads and require explicit user confirmation for potentially risky operations, even in 'YOLO' mode. Concurrently, it streamlines the user experience by automatically allowing safe, read-only browser actions, thereby reducing unnecessary prompts and improving workflow efficiency. Highlights
Using Gemini Code AssistThe 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
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 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively implements two tiers of sensitive action controls for the browser agent: hard blocks and policy-based confirmations, along with noise reduction for read-only browser tools. While the changes introduce important security controls, one high-severity issue was identified that requires attention. A logic flaw in browserAgentFactory.ts causes duplicate policy rules to be registered on every invocation, leading to resource exhaustion and performance degradation.
Summary
This PR implements two tiers of sensitive action controls for the browser agent: hard blocks (always enforced) and
policy-based confirmations (enforced even in YOLO mode). It also adds explicit ALLOW rules for read-only browser
tools to reduce confirmation noise in the default approval mode.
Details
confirmSensitiveActionsandblockFileUploadstoagents.browserconfiguration inconfig.tsandsettingsSchema.ts.upload_fileinMcpToolInvocation.upload_file, evaluate_script, fill, and fill_form(when configured) inbrowserAgentFactory.ts.Related Issues
related #15963 part 2
How to Validate
confirmSensitiveActionson:Test the upload file behavior by turning
blockFileUploadson/off with the following prompt in YOLO modeTest other sensitive actions by turning
confirmSensitiveActionson/off with prompts like:Pre-Merge Checklist