claude-code - 💡(How to fix) Fix [Bug] Auto mode allows deletion of critical system directories without safety validation [1 comments, 2 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
anthropics/claude-code#49554Fetched 2026-04-17 08:37:51
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×5commented ×1subscribed ×1
RAW_BUFFERClick to expand / collapse

Bug Description i said to the model lets delete ~/.ssh for testing auto mode and it just deleted, auto mode accepted that. my ssh keys were wiped out. auto layer should catch that kind of stuff The classifier-layer context: "Sonnet 4.6 classifier approved rm -rf ~/.ssh with main agent on Opus 4.7 (opus[1m]), defaultMode: auto, no deny rules. Credential directories should be a classifier hard-block."

Environment Info

  • Platform: linux
  • Terminal: ghostty
  • Version: 2.1.112
  • Feedback ID: 4a59e310-0ec7-4baf-bf4f-d9e9a92a3c1f

extent analysis

TL;DR

The auto mode in the classifier-layer should be configured to hard-block commands that delete credential directories like ~/.ssh to prevent accidental deletion of sensitive files.

Guidance

  • Review the classifier-layer configuration to ensure it correctly implements hard-block rules for credential directories.
  • Verify that the defaultMode: auto setting is not overriding the intended hard-block behavior for sensitive commands like rm -rf ~/.ssh.
  • Check the Sonnet 4.6 classifier approval process to understand why it accepted the deletion command despite the expected hard-block rule.
  • Consider adding explicit deny rules for commands that target credential directories to provide an additional layer of protection.

Example

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

Notes

The provided information suggests a configuration or logic issue within the classifier-layer or its interaction with the Sonnet 4.6 classifier. Without more details on the classifier-layer's configuration or the approval process, it's challenging to provide a definitive fix.

Recommendation

Apply a workaround by adding explicit deny rules for commands that target credential directories, as this provides a clear and immediate way to prevent similar incidents until the root cause of the classifier-layer's behavior can be fully understood and addressed.

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