gemini-cli - 💡(How to fix) Fix Respect safe boundaries like "you can only update files inside this folder" [1 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#25988Fetched 2026-04-26 05:24:12
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1
RAW_BUFFERClick to expand / collapse

What happened?

The agent clearly doesn't respect boundaries like "you can only update files inside this folder". It keeps prioritizing speed over precision. It's so frustrating that it's unusable.

[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?

Once I'm working on a project and I specify rules to "never update files outside the current project's folder," it should respect security rules. I created a list of files it should never touch in GEMINI.md, and asked it to confirm if it was loaded in the context. The agent acknowledged the rules and the files, but did not follow the instructions, ignoring the safeguards.

Client information

  • CLI Version: 0.39.1
  • Git Commit: 4d73f3413
  • Session ID: 659cc0bf-13b9-4aee-8894-c8d21f92f434
  • Operating System: darwin v20.19.4
  • Sandbox Environment: no sandbox
  • Model Version: gemini-3.1-pro-preview
  • Auth Type: oauth-personal
  • Memory Usage: 495.3 MB
  • Terminal Name: iTerm2 3.4.19
  • Terminal Background: #000000
  • Kitty Keyboard Protocol: Supported

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

The agent's disregard for specified boundaries and security rules may be due to a configuration or implementation issue, and attaching the exported chat history JSON file could help diagnose the problem.

Guidance

  • Review the GEMINI.md file to ensure the list of files to never touch is correctly formatted and loaded into the agent's context.
  • Verify that the agent's confirmation of loading the rules and files was successful and not just an acknowledgement.
  • Check the chat history to see if there were any errors or warnings related to the agent's behavior.
  • Consider re-specifying the rules and boundaries to the agent to ensure they are clear and understood.

Example

No code snippet is provided as the issue does not contain sufficient technical details to create a relevant example.

Notes

The issue lacks specific technical details about the agent's implementation and configuration, making it difficult to provide a definitive solution. The provided information suggests a potential issue with the agent's understanding or respect for the specified boundaries and security rules.

Recommendation

Apply workaround: Re-specify the rules and boundaries to the agent and monitor its behavior to see if the issue persists. This is a safe and minimal approach to try and resolve the issue without making any assumptions about the underlying implementation.

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