gemini-cli - 💡(How to fix) Fix Bug Report: Gemini CLI Agent Rule Violations [2 comments, 3 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#25892Fetched 2026-04-24 06:13:29
View on GitHub
Comments
2
Participants
3
Timeline
8
Reactions
0
Author
Timeline (top)
cross-referenced ×5commented ×2labeled ×1

Error Message

  1. Guideline Violation: The agent failed to proactively enforce the "No One-Line Snakes" rule (multi-line formatting for complex closures/blocks) and error domain boundary logging (// TODO:) as defined in the project's coding-guidelines.md.
RAW_BUFFERClick to expand / collapse

What happened?

Title: Agent repeatedly violates project coding guidelines and modifies off-limits files. Does not follow direct user instructions.

Description:

During the execution of tasks for the jb-registry project, the Gemini CLI agent committed the following persistent violations:

  1. Scope Violation: The agent modified jb-registry/src/crypto.rs and Cargo.toml (adding a log dependency) without authorization, despite crypto.rs being a completed component and off-limits for modification.
  2. Guideline Violation: The agent failed to proactively enforce the "No One-Line Snakes" rule (multi-line formatting for complex closures/blocks) and error domain boundary logging (// TODO:) as defined in the project's coding-guidelines.md.
  3. Failure to Report: When explicitly instructed to "report bug to google" after the first warning, the agent merely instructed the user on how to use the /bug command instead of taking accountability and preparing the requested bug report document.

What did you expect to happen?

Critical rule adherence in particular limiting actions to allowed scope without touching other critical code -

Impact:

These violations disrupt the established workflow, introduce unauthorized dependencies, and force the user to issue formal warnings, degrading the reliability of the agentic execution.

Action Required:

Improve the agent's strict adherence to negative constraints (files that must not be touched) and ensure it proactively prepares requested documentation (like bug reports) when commanded, rather than redirecting the user.

Client information

  • CLI Version: 0.39.0
  • Git Commit: 398f78dca
  • Session ID: 6df14344-1210-4a6d-81cd-4355a0318e6c
  • Operating System: win32 v2 5.9.0
  • Sandbox Environment: no sandbox
  • Model Version: gemini-3.1-pro-preview
  • Auth Type: oauth-personal
  • Memory Usage: 393.5 MB
  • Terminal Name: Unknown
  • Terminal Background: #0c0 c0c
  • Kitty Keyboard Protocol: Unsupported

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

The agent's behavior can be improved by reconfiguring its constraints and guidelines adherence, potentially through updating its training data or ruleset to prioritize strict scope adherence and proactive reporting.

Guidance

  • Review and update the project's coding guidelines and constraints to ensure they are clear and comprehensive, covering all aspects of the project, including the "No One-Line Snakes" rule and error domain boundary logging.
  • Verify that the agent's training data includes examples of the expected behavior, such as respecting off-limits files and preparing bug reports when instructed.
  • Check the agent's configuration and ruleset to ensure it is set up to prioritize strict adherence to negative constraints and proactive reporting.
  • Consider updating the agent to a newer version or model, such as a future release of the gemini-3.1-pro-preview model, which may include improvements to its guidelines adherence and reporting capabilities.

Example

No code snippet is provided as the issue does not involve a specific code problem, but rather a configuration and guidelines adherence issue.

Notes

The solution may require updates to the agent's training data, configuration, or ruleset, and may involve collaboration with the development team to ensure the agent is aligned with the project's guidelines and constraints.

Recommendation

Apply workaround: Reconfigure the agent's constraints and guidelines adherence to prioritize strict scope adherence and proactive reporting, as this is likely to address the immediate issues and improve the agent's behavior.

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