Skip to content

Define trusted local CLI access versus restricted filesystem isolation #181

Description

@manishiitg

Problem

Native AgentWorks workflow shells currently use a macOS sandbox profile with (allow default), deny the AgentWorks project root, and re-allow approved workspace paths. This intentionally leaves the rest of the user's home directory available so locally installed CLIs such as AWS CLI, Google Workspace CLI, gcloud, kubectl, Docker, Node/npm, and future user-installed tools can resolve their normal configuration, credentials, caches, and state.

A review confirmed that this also means a workflow shell can read unrelated home files through paths such as $HOME, ~, or language APIs such as Python Path.home(). The existing FolderGuard E2E tests only validate paths inside the temporary project root and therefore do not cover this boundary.

Product constraint

Normal local automation must continue to support arbitrary CLIs installed by users. A hardcoded list of CLI profiles is not sufficient because every CLI stores configuration differently, including:

  • ~/.config/<tool>
  • ~/.<tool>
  • ~/Library/Application Support/<tool>
  • macOS Keychain
  • custom paths and environment variables

Allowing every installed CLI with its full normal behavior is effectively broad local access: interpreters such as Python, Node, and shell are also CLIs and can read arbitrary user files.

Current decision

Keep the existing trusted local behavior unchanged for now. Do not introduce hardcoded CLI-profile restrictions or change the native default until the product model is decided.

Design questions

  • Should workflows expose explicit Trusted local access and Restricted workspace access modes?
  • Should trusted local access be global, per workflow, or granted at first run?
  • What should be the default for user-created local workflows versus imported/shared workflows?
  • How should the UI clearly communicate laptop-file and local-credential authority?
  • Can scheduled/background workflows have a different default from interactive local workflows?
  • How should explicit selected-folder grants and workflow secrets interact with restricted mode?
  • What migration behavior should existing workflows receive?

Required tests before implementation

  1. Capture the current trusted-local before-state using decoy files and the real workspace HTTP shell endpoint.
  2. Test bypass spellings: absolute paths, $HOME, ~, Python/Node home expansion, and symlink escapes.
  3. Verify arbitrary executables located in user-home PATH directories continue to launch.
  4. Run installed CLI compatibility checks for AWS CLI, gcloud, GWS, kubectl, Docker, GitHub CLI, and NVM Node.
  5. Verify authenticated CLI behavior separately where live accounts are required.
  6. Verify explicit host-folder read-only/read-write grants.
  7. Test both the workspace API boundary and a real workflow step through the MCP bridge.
  8. Ensure the AgentWorks source/config root remains protected in every mode.

Acceptance criteria

A future implementation must make the authority model explicit and testable without silently breaking user-installed CLIs or falsely claiming that FolderGuard confines a trusted-local workflow to workspace files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions