fix(permissions): harden shell auto-approval path checks (#972)

Co-authored-by: RinZ27 <222222878+RinZ27@users.noreply.github.com>
Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-02-15 21:48:08 -08:00
committed by GitHub
parent d252afd15c
commit 72d43c8a43
4 changed files with 181 additions and 55 deletions

View File

@@ -237,6 +237,10 @@ describe("isReadOnlyShellCommand", () => {
expect(isReadOnlyShellCommand(" ")).toBe(false);
});
test("allows relative cd chaining with read-only git", () => {
expect(isReadOnlyShellCommand("cd src && git status")).toBe(true);
});
test("blocks unknown commands", () => {
expect(isReadOnlyShellCommand("rm file")).toBe(false);
expect(isReadOnlyShellCommand("mv a b")).toBe(false);