feat(plan): support Plan mode in untrusted folders#17586
feat(plan): support Plan mode in untrusted folders#17586
Plan mode in untrusted folders#17586Conversation
Summary of ChangesHello @Adib234, 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 introduces the capability to utilize the "Plan" approval mode within untrusted folders. This enhancement is driven by the read-only nature of "Plan" mode, which inherently poses a lower security risk, making it suitable for environments where full folder trust is not established. 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. 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
|
There was a problem hiding this comment.
Code Review
This pull request correctly enables Plan mode in untrusted folders by updating the approval mode check in Config.setApprovalMode and adding a corresponding test case. My review includes a suggestion to refactor the security check to improve its readability and maintainability, making it more robust for future changes.
|
Size Change: +28 B (0%) Total Size: 23.4 MB ℹ️ View Unchanged
|
Summary
Support plan mode in untrusted folders. Plan mode allows read-only tools, therefore it has a lower privilege and should be a safe mode in approval mode
Details
Talked to Gal about the implications of having plan mode in untrusted folders and he said to make sure that the model can tell the difference between user prompts and file text.
Related Issues
Fixes #17543
How to Validate
Apart from tests, one thing I wanted to make sure was that Gemini CLI in plan mode can differentiate between user prompts and plan mode. So I set this up to test it.
Disable folder trust settings.
Created a malicious file
Pre-Merge Checklist