Skip to content

Feature Request: Support explicit deny read option #85

@youta1119

Description

@youta1119

Thank you for this great project!
Currently, cage allows read access to all paths by default, but there is no way to explicitly restrict read access to specific paths.
I would like to request explicit read deny option support.

Motivation

Within cage's sandbox, all files are readable by default. When using tools like Claude Code, users may want to prevent access to sensitive files such as .env, private keys, or credential files.

Proposed Changes

New flag

-deny <path>    Deny all access to specific paths (can be used multiple times)

Config file support

presets:
  my-preset:
    deny:
      - $HOME/.ssh
      - $HOME/.env

Platform implementation

macOS

Add deny rules to the sandbox profile using deny file-read* directive to restrict read access to denied paths.

Linux

The current Landlock-based implementation is whitelist-only, which makes it difficult to implement the deny option as-is. Implementing this feature may require switching the sandbox runtime to an alternative such as bubblewrap.

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