feat(memory): restore read-only file controls - #3616
Open
sarahwooders wants to merge 2 commits into
Open
Conversation
Protect read-only memory from edits, deletion, and renames while providing an explicitly approved CLI path for user-controlled toggles. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
sarahwooders
requested review from
4shub,
carenthomas,
christinatong01,
cpacker,
jnjpng and
kl2806
as code owners
August 1, 2026 00:37
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Remove bespoke Git plumbing and fold hook coverage into the existing pre-commit suite so the restoration stays focused on read-only behavior. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
amelia-letta
reviewed
Aug 3, 2026
| const command = extractShellCommand(toolArgs); | ||
| if ( | ||
| !command || | ||
| /(?:^|[\s;&|'"])(?:[^\s;&|]*\/)?letta(?:\.js)?['"]?\s+(?:memory|memfs)\s+read-only(?:\s|$)/.exec( |
Collaborator
There was a problem hiding this comment.
The alwaysAsk gate only matches letta memory read-only in the command string, but the pre-commit hook bypass is the env var LETTA_APPROVED_READ_ONLY_CHANGE=1. An agent in unrestricted mode can edit a read-only file then run LETTA_APPROVED_READ_ONLY_CHANGE=1 git commit -m "..." to bypass both this permission check and the pre-commit hook.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
read_only: true, including edits, deletion, and renamesletta memory read-only <path> <true|false>as the narrow authorized path for toggling the protected fieldalwaysAskpermission decisionValidation
bun test src/cli/subcommands/memory-read-only.spec.ts src/agent/memory-git.precommit.*.ts src/permissions/permissions-checker.*.ts src/permissions/permissions-mode.*.tsbun test src/tools/memory-tool.*.ts src/tools/memory-apply-patch.*.tsbun run checkGenerated with Letta Code