fix: mitigate antivirus false positive detections on generated JSON f…#20238
fix: mitigate antivirus false positive detections on generated JSON f…#20238theshloksschauhan wants to merge 5 commits intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello @theshloksschauhan, 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 addresses the issue of antivirus software incorrectly flagging legitimate Gemini CLI error report JSON files as malware. It implements a two-pronged approach: enhancing the error reports themselves with a provenance header and relocating them to a less suspicious directory, and providing users with clear troubleshooting documentation to manage false positives. These changes aim to improve the user experience by preventing unnecessary security alerts and offering actionable solutions. Highlights
Changelog
Activity
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 effectively mitigates the issue of antivirus false positives by relocating error report files and adding a _meta provenance header. The changes are well-implemented across the affected files, and the addition of troubleshooting documentation is a great touch. I've identified a couple of opportunities to reduce code duplication that was introduced, which would improve the maintainability of the code.
bd3634d to
45c1014
Compare
…iles - Add _meta provenance header to error report JSON files so AV content scanners can identify them as legitimate Gemini CLI artifacts - Move error reports from os.tmpdir() (%%TEMP%%) into the project's ~/.gemini/tmp/<hash>/error-reports/ directory to avoid the google-gemini#1 AV heuristic trigger (structured JSON written to system temp dir) - Auto-create the error-reports directory before writing - Add troubleshooting documentation with AV exclusion instructions and vendor-specific false positive submission links - Update tests to verify _meta presence, key ordering, and dir creation Fixes google-gemini#15404 Related: google-gemini#1907
a7f399f to
47e1cfc
Compare
2133ca0 to
545e4a1
Compare
|
Hi maintainers, this PR has been rebased onto latest main and merge conflicts were resolved. cla/google is now passing, but docs-pr-check (gemini-cli-extensions) is still queued for this fork PR. Could a maintainer please approve/run the pending fork workflow and, if everything looks good, provide at least one human approval review? |
Summary
This PR resolves the issue of antivirus software flagging Gemini CLI error reports as malicious. It does this by moving the error reports out of the system's temporary directory (
os.tmpdir()) and into a dedicated project directory (~/.gemini/tmp/<hash>/error-reports/), and by adding a_metaprovenance header to the generated JSON files.Details
Writing structured JSON to the system temporary directory is a common heuristic trigger for antivirus software. By relocating these files and adding clear metadata, we significantly reduce the likelihood of false positive detections. Troubleshooting documentation has also been added to assist users.
Reviewer Note: I have consolidated the error report directory path construction as requested by
gemini-code-assist[bot]in the latest commit.Related Issues
Fixes #15404
Related: #1907
How to Validate
~/.gemini/tmp/<hash>/error-reports/instead of the system's temporary directory._metaprovenance header.npm testto ensure directory creation and_metatests pass.npx ./gemini-cli-<version>.tgzor inside a Docker container to verify home directory resolution (~/) works in isolated environments.Pre-Merge Checklist
Note: I manually validated on Windows and Docker/Linux. I am relying on the CI test matrix for native MacOS/Seatbelt validation.