CapabilitySet class is the primary way to define what resources your sandboxed process can access. It provides methods for granting filesystem access, blocking network access, and managing command execution.
Constructor
Methods
allowPath
string
required
Absolute path to the directory. Must exist and be a directory.
AccessMode
required
Access level to grant:
Read, Write, or ReadWrite.allowFile
string
required
Absolute path to the file. Must exist and be a regular file.
AccessMode
required
Access level to grant:
Read, Write, or ReadWrite.blockNetwork
allowCommand
string
required
The command name to allow (e.g.,
"git", "npm").blockCommand
string
required
The command name to block (e.g.,
"curl", "wget").platformRule
string
required
On macOS, this is a Seatbelt S-expression. Ignored on Linux.
deduplicate
pathCovered
string
required
The path to check.
boolean
true if the path would be accessible, false otherwise.fsCapabilities
FsCapabilityInfo[]
Array of capability objects with the following properties:
original: The path as originally specifiedresolved: The canonicalized absolute pathaccess: Access mode string ("read","write", or"read+write")isFile:trueif this is a file capability,falsefor directoriessource: How the capability was added
summary
string
Multi-line string describing all filesystem and network capabilities.
Properties
isNetworkBlocked
true if network access has been blocked.