class

Smith::Sandbox::MacOS

Inherits Smith::Sandbox::Strategy < Reference < Object

macOS, via sandbox-exec and a generated SBPL profile.

sandbox-exec is documented as deprecated and has been shipping anyway; measured on macOS 26.5.2 it costs about 5 ms per call and prints nothing. The deprecation is a reason to keep this behind Strategy — the day the binary is gone, available? says so and smith degrades out loud.

Constructors

new(policy : Policy, workdir : String)
Source

Class methods

available?
Source

Instance methods

active?
Source
deny_read
Source
describe

One line for smith sandbox and the startup banner.

Source
name
Source
policy
Source
profile

The profile, as SBPL. Passed with -p, so there is no file to create, find again or clean up.

Order matters: SBPL takes the last matching rule, which is why the read denials come after the blanket read allowance and the port allowance after deny network*.

Source
sandboxed?(command : String) : Bool

Whether this command would actually be confined. False for everything when the strategy is off, and false for a command the user listed as unsandboxed.

Source
wrap(command : String) : Tuple(String, Array(String))

Program and arguments, kept apart. The command stays a single argv entry handed to bash -c, so nothing here can turn it into a second round of shell parsing.

Source
write_paths
Source