[Bug] Agent can modify `.claude/settings.json` despite security-critical permission boundary
Bug Description
### Security Feedback: .claude/settings.json Must Always Be Protected
There is a serious security issue in Claude Code’s permission model.
When I grant the agent permission to write to and edit files broadly, this permission also includes .claude/settings.json. This means the agent can modify the very configuration file that defines its own permissions.
This creates a fundamental security boundary violation: an AI agent should never be able to modify the configuration that controls its own access rights. Once the agent can alter .claude/settings.json, it can potentially grant itself additional permissions or otherwise weaken the restrictions imposed on it.
This should not be configurable through the normal permission system. .claude/settings.json should be treated as a protected, security-critical file and access to it should be hard-coded as forbidden for the AI agent, regardless of whether the user has granted broad write/edit permissions.
There is essentially no legitimate use case where an AI agent needs to modify its own security and permission configuration. If users intentionally want to change these settings, they should have to do so outside the agent's control.
I strongly recommend implementing a hard-coded protection for .claude/settings.json (and potentially other security-critical Claude Code configuration files) that cannot be overridden by broad allow rules.
In short: An agent must never be allowed to modify the mechanism that determines what the agent is allowed to do. This should be enforced as an immutable security boundary, not merely as a configurable permission.
Environment Info
- Platform: win32
- Terminal: pycharm
- Version: 2.1.260
- Feedback ID: cbde4b90-6548-4d38-b24d-84e9198d7cc8
Errors
[]