Skip to content

fix(core): align policy redirection gates, path validation, and workflow parsing - #29506

Merged
DavidAPierce merged 12 commits into
mainfrom
fix/policy-workflow-consistency
Sep 25, 2026
Merged

DavidAPierce merged 12 commits into
mainfrom
fix/policy-workflow-consistency

Conversation

@DavidAPierce

Copy link
Copy Markdown
Contributor

Summary

  • CI Workflows: Simplifies gemini-automated-issue-triage.yml, gemini-automated-issue-dedup.yml, gemini-scheduled-issue-triage.yml, and gemini-scheduled-issue-dedup.yml to parse structured summary outputs directly rather than shelling out to echo / gh issue view.
  • Policy & Scheduler Consistency:
    • Ensures allowRedirection on argsPattern rules and nonInteractive ASK_USER fallbacks behave consistently across approval modes.
    • Aligns external MCP resource and web search tool outputs with web-fetch context formatting.
  • Path & File Utilities:
    • Expands path validation helpers for environment configuration variants (while preserving .env.example templates) and workspace configuration directories.
    • Adds file handle stat consistency checks in fileUtils.

Details

  • Enforce consistent allowRedirection handling for restricted rules in PolicyEngine.
  • Convert nonInteractive ASK_USER decisions to DENY across all safety evaluation paths.
  • Align MCP resources and web search output wrapping with untrusted context standards.
  • Add device and inode consistency checks to fileUtils buffer reading.
  • Refactor issue triage and deduplication workflows to ingest structured summary outputs.

…low parsing

- Enforce consistent allowRedirection handling for restricted rules in PolicyEngine.
- Convert nonInteractive ASK_USER decisions to DENY across all safety evaluation paths.
- Align MCP resources and web search output wrapping with untrusted context standards.
- Add device and inode consistency checks to fileUtils buffer reading.
- Refactor issue triage and deduplication workflows to ingest structured summary outputs.
@DavidAPierce
DavidAPierce requested review from a team as code owners September 25, 2026 16:23
@github-actions github-actions Bot added the size/l A large sized PR label Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

📊 PR Size: size/L

  • Lines changed: 968
  • Additions: +873
  • Deletions: -95
  • Files changed: 26

@gemini-code-assist

Copy link
Copy Markdown
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 significantly enhances the security and consistency of the core engine. Key changes include stricter policy enforcement for redirected commands, robust file integrity checks during read operations, and improved path validation to protect sensitive workspace configurations. Additionally, the PR standardizes the handling of untrusted tool outputs and optimizes CI workflow parsing for better reliability.

Highlights

  • Policy Engine Hardening: Enforced strict 'allowRedirection' handling for restricted rules and ensured non-interactive mode correctly downgrades 'ASK_USER' decisions to 'DENY'.
  • Secure File Operations: Implemented 'readSecureFileBuffer' with device and inode consistency checks to prevent file tampering during read operations.
  • Path Validation Improvements: Updated path validation to protect sensitive configuration files while explicitly allowing safe environment templates like .env.example.
  • Untrusted Context Wrapping: Wrapped outputs from MCP resources and web search tools in <untrusted_context> tags to improve security context awareness.
  • CI Workflow Optimization: Refactored automated issue triage and deduplication workflows to parse structured summary outputs directly.
Ignored Files
  • Ignored by pattern: .github/workflows/** (4)
    • .github/workflows/gemini-automated-issue-dedup.yml
    • .github/workflows/gemini-automated-issue-triage.yml
    • .github/workflows/gemini-scheduled-issue-dedup.yml
    • .github/workflows/gemini-scheduled-issue-triage.yml
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 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 .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 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

  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. ↩

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

Copy link
Copy Markdown
Contributor

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 introduces several security and policy enforcement enhancements, including wrapping untrusted tool outputs (MCP resources and web search results) in <untrusted_context> tags, protecting .gemini configuration files, allowing safe .env templates while blocking other variants, and escalating allowed actions to user confirmation when taint or build file risks are detected. Additionally, it hardens path resolution, PowerShell path validation, and file reading consistency checks via device and inode verification. The review feedback highlights two important improvements: resolving a strict TypeScript compilation error in the taint risk check by casting the object, and addressing a critical Time-of-Check to Time-of-Use (TOCTOU) race condition in the secure file reader by reading directly from the verified file handle.

Note: Security Review did not run due to the size of the PR.

Comment thread packages/core/src/utils/fileUtils.ts Resolved
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Size Change: +3.45 kB (+0.01%)

Total Size: 35.4 MB

Filename Size Change
./bundle/chunk-35QMCY5I.js 0 B -16.7 MB (removed) 🏆
./bundle/chunk-LAYYFVUS.js 0 B -13 kB (removed) 🏆
./bundle/chunk-LUOYJYJJ.js 0 B -663 kB (removed) 🏆
./bundle/chunk-MTSQQ6CX.js 0 B -19.5 kB (removed) 🏆
./bundle/chunk-RRG7IJZI.js 0 B -3.43 kB (removed) 🏆
./bundle/chunk-S4B5CMGI.js 0 B -49.2 kB (removed) 🏆
./bundle/chunk-U6SHXC2C.js 0 B -3.77 kB (removed) 🏆
./bundle/chunk-UWHPBMBO.js 0 B -3.67 MB (removed) 🏆
./bundle/core-YIEPWRPU.js 0 B -52.5 kB (removed) 🏆
./bundle/devtoolsService-YWUJU5LJ.js 0 B -147 kB (removed) 🏆
./bundle/gemini-7KBLWMKA.js 0 B -646 kB (removed) 🏆
./bundle/interactiveCli-VTUNAU7A.js 0 B -1.31 MB (removed) 🏆
./bundle/liteRtServerManager-E7GN2JYO.js 0 B -2.08 kB (removed) 🏆
./bundle/oauth2-provider-ZSU5JJII.js 0 B -9.12 kB (removed) 🏆
./bundle/chunk-2EYER2YR.js 3.77 kB +3.77 kB (new file) 🆕
./bundle/chunk-3BFFOVOQ.js 3.67 MB +3.67 MB (new file) 🆕
./bundle/chunk-6IK7W6IW.js 16.7 MB +16.7 MB (new file) 🆕
./bundle/chunk-GPRLDBE6.js 663 kB +663 kB (new file) 🆕
./bundle/chunk-SS4KDQ2Y.js 19.5 kB +19.5 kB (new file) 🆕
./bundle/chunk-TQXBXUJG.js 13 kB +13 kB (new file) 🆕
./bundle/chunk-UTOB44YL.js 49.2 kB +49.2 kB (new file) 🆕
./bundle/chunk-ZYDZWGT3.js 3.43 kB +3.43 kB (new file) 🆕
./bundle/core-W5IQME5H.js 52.6 kB +52.6 kB (new file) 🆕
./bundle/devtoolsService-UF4T5YQD.js 147 kB +147 kB (new file) 🆕
./bundle/gemini-ROGE3OTB.js 646 kB +646 kB (new file) 🆕
./bundle/interactiveCli-DGZ7NJ3R.js 1.31 MB +1.31 MB (new file) 🆕
./bundle/liteRtServerManager-QOMYNXQF.js 2.08 kB +2.08 kB (new file) 🆕
./bundle/oauth2-provider-6GYZCWR5.js 9.12 kB +9.12 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./bundle/bundled/third_party/index.js 8 MB 0 B
./bundle/chunk-34MYV7JD.js 2.45 kB 0 B
./bundle/chunk-5AUYMPVF.js 858 B 0 B
./bundle/chunk-5PS3AYFU.js 1.18 kB 0 B
./bundle/chunk-664ZODQF.js 124 kB 0 B
./bundle/chunk-DAHVX5MI.js 206 kB 0 B
./bundle/chunk-IUUIT4SU.js 56.5 kB 0 B
./bundle/chunk-L5V3KIDT.js 1.62 kB 0 B
./bundle/chunk-L6PII3GR.js 41.5 kB 0 B
./bundle/cleanup-XJCMLEZO.js 0 B -902 B (removed) 🏆
./bundle/devtools-TYCPOPV3.js 683 kB 0 B
./bundle/events-XB7DADIJ.js 418 B 0 B
./bundle/examples/hooks/scripts/on-start.js 188 B 0 B
./bundle/examples/mcp-server/example.js 1.43 kB 0 B
./bundle/gemini.js 4.75 kB 0 B
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB 0 B
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB 0 B
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB 0 B
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB 0 B
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB 0 B
./bundle/https-proxy-agent-JWL7GO47.js 479 B 0 B
./bundle/multipart-parser-E7RMVJWU.js 11.7 kB 0 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 8.69 kB 0 B
./bundle/sandbox-macos-permissive-proxied.sb 8.97 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 6.86 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 7.06 kB 0 B
./bundle/sandbox-macos-strict-open.sb 8.23 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 8.44 kB 0 B
./bundle/src-65GKNWUJ.js 45.4 kB 0 B
./bundle/src-U45KTUYT.js 45.7 kB 0 B
./bundle/src-XZYPU6PJ.js 352 kB 0 B
./bundle/start-6NAVGKYM.js 0 B -622 B (removed) 🏆
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/worker/worker-entry.js 363 kB 0 B
./bundle/cleanup-SDO4IXI4.js 902 B +902 B (new file) 🆕
./bundle/start-MXRGGSBD.js 622 B +622 B (new file) 🆕

compressed-size-action

@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

✅ 73 tests passed successfully on gemini-3-flash-preview.

🧠 Model Steering Guidance

This PR modifies files that affect the model's behavior (prompts, tools, or instructions).

  • ⚠️ Consider adding Evals: No behavioral evaluations (evals/*.eval.ts) were added or updated in this PR. Consider adding a test case to verify the new behavior and prevent regressions.
  • 🚀 Maintainer Reminder: Please ensure that these changes do not regress results on benchmark evals before merging.

This is an automated guidance message triggered by steering logic signatures.

Comment thread packages/core/src/tools/read-file.ts Resolved
Comment thread packages/core/src/utils/fileUtils.ts Resolved
Comment thread packages/core/src/utils/fileUtils.ts Resolved
@DavidAPierce
DavidAPierce added this pull request to the merge queue Sep 25, 2026
@DavidAPierce
DavidAPierce removed this pull request from the merge queue due to a manual request Sep 25, 2026
@DavidAPierce
DavidAPierce added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit 2fe7c2d Sep 25, 2026
35 checks passed
@DavidAPierce
DavidAPierce deleted the fix/policy-workflow-consistency branch September 25, 2026 22:57
@j0xh-dev

Copy link
Copy Markdown

/patch stable

@github-actions

Copy link
Copy Markdown

🚀 [Step 1/4] Patch workflow(s) waiting for approval!

📋 Details:

  • Channels: stable
  • Commit: 2fe7c2d3f065dc40ad573d50b2091116f8a4aa18
  • Workflows Created: 1

⏳ Status: The patch creation workflow has been triggered and is waiting for deployment approval. Please visit the specific workflow links below and approve the runs.

🔗 Track Progress:

This branch was previously deployed

1 inactive deployment
eval-gate — dc72be05 Deployed Sep 25, 2026 by DavidAPierce via Evaluate Steering & Regressions #2091
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l A large sized PR status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants