fix(sandbox): keep agent workspace off gateway state files - #79
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(sandbox): keep agent workspace off gateway state files#79cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Default workspace_path was ~/.shellclaw, the same tree as pairing tokens, memory.db, and config.toml. With workspace_only on, inbound Discord/webchat/cron file tools could read or overwrite those files. Point the default at ~/.shellclaw/workspace and deny runtime state paths even when an operator keeps the old workspace root. Co-authored-by: esadrianno <esadrianno@gmail.com>
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
Default
workspace_pathwas~/.shellclaw, the same directory as gateway pairing tokens,memory.db, andconfig.toml. With defaultworkspace_only=1, inbound Discord / WebChat / cronfiletools treated those files as in-bounds.Bug
src/core/config.c(config_loaddefault),src/tools/file.c(path_within_workspace),src/sandbox/allowlist.cworkspace_path). Send a Discord/WebChat/cron prompt that causes the agent toread_file/write_fileauth_tokens.json, orcat ~/.shellclaw/auth_tokens.jsonvia shell.memory.dborconfig.toml. After PR fix(gateway): wire provider and tools into POST /asap handler聽#53 lands, the same path applies to inboundPOST /asap.workspace_onlyboundary includes secrets.Root cause
workspace_onlyis a prefix check againstworkspace_path. The default path was the process state dir, so the security control that is on by default authorized tool access to pairing tokens.Fix
workspace_pathto~/.shellclaw/workspaceand create that directory at tool init.auth_tokens.json,shellclaw.pid,shellclaw.log, and.shellclaw/config.toml/.shellclaw/memory.dbeven if they sit inside a custom workspace.Validation
CI=true GATEWAY=1 make test(full suite, including new file/allowlist/config/shell cases)