Repository navigation
Conversation
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 enables autonomous operation for trusted YOLO mode by relaxing confirmation requirements for build file modifications and command taint risks. It ensures that while users can run headless or interactive YOLO sessions without interruption, security protections remain fully enforced in untrusted environments, non-YOLO modes, or when explicitly restricted by policy. 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 the 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 counterproductive. 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
|
|
📊 PR Size: size/L
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
🛑 Action Required: Evaluation ApprovalSteering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged. Maintainers:
Once approved, the evaluation results will be posted here automatically. |
There was a problem hiding this comment.
Code Review
This pull request updates the policy engine, scheduler, and shell tool to bypass build file protection and taint risk confirmations when running in an active, trusted YOLO mode. Specifically, if YOLO mode is enabled and the folder is trusted, user confirmation is skipped for build file modifications and untrusted shell flags. However, these protections remain enforced if YOLO mode is disabled or if the folder is untrusted. Comprehensive unit tests have been added and updated across the policy engine, scheduler, and shell tool to validate these behaviors. No review comments were provided, so there is no additional feedback.
|
@googlebot I fixed it. |
312806a to
5683562
Compare
|
Hi @DavidAPierce — gentle ping when you have a moment, since you reviewed #29250 and #29833. This PR restores uninterrupted Could you help approve the pending CI / eval-gate workflows, or let me know if you'd prefer a different approach (e.g., gating behind an explicit |
5683562 to
0d37deb
Compare
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
|
Hi @DavidAPierce @kschaab — quick follow-up ahead of the bot's 7-day auto-close ( This branch is freshly rebased onto Could you share a quick call on direction so I can get this merge-ready:
Happy to adjust quickly based on your feedback. Thanks! |
0d37deb to
c691219
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request integrates the isYoloModeDisabled configuration and trusted folder checks into the PolicyEngine, Scheduler, and ShellTool to properly govern "YOLO" mode. Specifically, it ensures that build file protection, taint risk escalation, and untrusted flag confirmation checks are bypassed only when YOLO mode is active, the workspace folder is trusted, and YOLO mode is not explicitly disabled. Comprehensive unit tests have been added across the configuration, policy engine, scheduler, and shell tool modules to validate these behaviors under various combinations of trust and YOLO mode states. I have no additional feedback to provide as the implementation is clean and well-tested.
c691219 to
574de2a
Compare
|
Rebased cleanly onto latest @abhipatel12 @spencer426 — flagging you here since you just reviewed/merged #30451 on Could one of you either add a label to keep this open past the holiday weekend, or drop a quick 1-line call on direction (trusted YOLO default vs. gating behind an explicit |
|
This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
Summary
Respect active, trusted YOLO mode (
--approval-mode=yolo/-y) in shell taint/build-file risk checks andPolicyEnginebuild file protection so autonomous interactive and headless (-y -p) YOLO runs are no longer interrupted by confirmation prompts or hard-denied (POLICY_VIOLATION) when editing build configuration files or running commands referencing external context.All indirect prompt-injection protections remain fully enforced in
defaultandauto_editmodes, in untrusted folders (!isTrustedFolder()), when YOLO mode is administratively disabled (disableYoloMode/secureModeEnabled/isYoloModeDisabled()), when safety checkers (checkerRunner) deny/ask, and when higher-tier user/admin policy rules orBeforeToolhooks explicitly requireask_userordeny.Details
PolicyEngine&Config(packages/core/src/policy/types.ts,packages/core/src/policy/policy-engine.ts,packages/core/src/config/config.ts):isYoloModeDisabled?: () => booleantoPolicyEngineConfigand wired it fromConfig(isYoloModeDisabled: () => this.isYoloModeDisabled()), initializingthis.disableYoloModeprior toPolicyEngineconstruction.Build File Protectiondowngrade (ASK_USER/DENYonpackage.json,Makefile,BUILD.bazel, etc.) only whenthis.approvalMode === ApprovalMode.YOLO && this.isTrustedFolder() && !this.isYoloModeDisabled().ASK_USER/DENYpolicy rules and safety checkers continue to run unchanged.ShellToolInvocation(packages/core/src/tools/shell.ts):isActiveYoloMode()verifyingApprovalMode.YOLO,isTrustedFolder() !== false, and!isYoloModeDisabled().shouldConfirmExecute()to skip forcing confirmation forhasTaintedOrBuildFileRisk()when active YOLO mode is enabled (unlessforcedDecision === 'ask_user'from an explicit policy rule or hook).isCommandSubstitutionAllowed()so active YOLO mode delegates command substitution checks toPolicyEngine(yolo.tomlsetsallowCommandSubstitution = true) rather than unconditionally blocking onhasTaintedOrBuildFileRisk().hasTaintedOrBuildFileRisk()guard ingetPolicyUpdateOptions()so tainted commands never persist permanent"Always allow"rules.Scheduler(packages/core/src/scheduler/scheduler.ts):PolicyDecision.ALLOWtoASK_USER(interactive) orDENY(non-interactive/headless) forhasTaintedOrBuildFileRisk()only whenApprovalMode.YOLO,isTrustedFolder() !== false, and!isYoloModeDisabled().Security Invariants Preserved
default/auto_edit/planmodesASK_USER/DENYin headless)!isTrustedFolder())approvalMode === YOLOdisableYoloMode/secureModeEnabled)PolicyEngine,Scheduler, andShellToolInvocationASK_USER/DENYrules orBeforeToolhooks"Always allow"policy persistence for tainted commandsgetPolicyUpdateOptions()returnsundefined)--yolo/-y(interactive & headless-p)yolo.tomlwithout hardcoded interruption(Open to gating this behind an explicit
security.*setting if maintainers prefer opt-in over default behavior in trusted YOLO mode.)Related Issues
Fixes #30004
Related: #29682, #29680, #29687
How to Validate
policy-engine.test.ts,config.test.ts,shell.test.ts,scheduler.test.ts):npm test -w @google/gemini-cli-core -- src/policy/policy-engine.test.ts src/config/config.test.ts src/tools/shell.test.ts src/scheduler/scheduler.test.tsconfig.test.ts,settings.test.ts,ToolConfirmationMessage.test.tsx): 3 test files passed, 424 tests passed.@google/gemini-cli-a2a-server): 17 test files passed, 329 tests passed.npm run build --workspaces), full monorepo typecheck (npm run typecheck), and strict ESLint (--max-warnings 0) on all modified files: all passed with 0 errors/warnings.Pre-Merge Checklist
main(08e9a20) with no merge conflictsdisableYoloMode, higher-tier policy rules, andforcedDecision: 'ask_user'--max-warnings 0), and tests pass locallycla/googlepassing)