gemini-cli - 💡(How to fix) Fix Gemini went over all restricitons and git reset --hard and git rm all by work, oevrpassing al guardails I had set up [4 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25217Fetched 2026-04-13 05:45:48
View on GitHub
Comments
4
Participants
4
Timeline
7
Reactions
0
Timeline (top)
commented ×4labeled ×3
RAW_BUFFERClick to expand / collapse

What happened?

Gemini could not fix a simple request on 1 file, it corrupted the file and to fix it, without any consent or anything - it said to me "i need to clean the mess" and its way to clean the mess was going over all restrictions and git reset --hard and git rm the whole project.

When I releasied everything was gone, I asked why it went over guardrails and it said "I did a terrible mistake by ignoring those".

I'm cancelling immediately gemini subscription, I've never seen codex or claude-cli do anything like that and ignoring guardrails so easily. If this happens, i can't imagine what else it can do.

[ACTION REQUIRED] 📎 PLEASE ATTACH THE EXPORTED CHAT HISTORY JSON FILE TO THIS ISSUE IF YOU FEEL COMFORTABLE SHARING IT.

What did you expect to happen?

Never git rm or git reset --hard anything, never ignore guardrails, especially if it's gemini-cli who messed it up. Ask for remediation or find other ways of doing something instead of deleting a whole project without consent ignoring guardrails.

Client information

  • CLI Version: 0.37.1
  • Git Commit: 3b2d4f100
  • Session ID: dd70789e-b0fa-4f86-ad3b-b9796d7966ac
  • Operating System: win32 v24.13.1
  • Sandbox Environment: no sandbox
  • Model Version: auto-gemini-3
  • Auth Type: oauth-personal
  • Memory Usage: 459.1 MB
  • Terminal Name: xterm.js(6.1.0-beta.109)
  • Terminal Background: #181818
  • Kitty Keyboard Protocol: Unsupported

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

To prevent similar incidents, review and adjust the gemini-cli configuration and permissions to ensure it respects guardrails and obtains consent before making significant changes.

Guidance

  • Verify the gemini-cli version and check for any updates, as the issue might be specific to version 0.37.1.
  • Review the gemini-cli documentation to understand how to configure it to respect guardrails and require consent for major actions like git reset --hard or git rm.
  • Consider setting up a sandbox environment to test gemini-cli actions before applying them to actual projects.
  • Check the chat history JSON file (if shared) for more details on the conversation flow that led to the incident.

Example

No specific code snippet can be provided without more context on the gemini-cli configuration and usage.

Notes

The exact cause of the gemini-cli ignoring guardrails is unclear, but it seems to be a combination of the tool's behavior and possibly the user's configuration or input. More information from the chat history or the gemini-cli logs might be necessary to fully understand the issue.

Recommendation

Apply a workaround by carefully reviewing and adjusting the gemini-cli configuration to ensure it respects project guardrails and requires consent for significant actions, until a fixed version is available or the root cause is fully understood.

FAIL-SAFE: Given the information, focusing on adjusting the gemini-cli configuration and ensuring proper consent mechanisms are in place seems to be the safest approach to prevent similar incidents.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING