Skip to documentation
SLOP

tiny.sandbox.Policy

Reference tiny.sandbox Policy

Defined in policy.

States what isolation a run has to have before the run starts: the policy records what the caller asks of the filesystem, process, and network dimensions, each judged on its own.

API (7)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callspolicyPolicy
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/sandbox/src/policy.zig:21

zig
/// States what isolation a run has to have before the run starts: the policy/// records what the caller asks of the filesystem, process, and network/// dimensions, each judged on its own. A required dimension rejects an audit/// weaker than isolated, returning `error.UnmetFilesystemIsolation` ,/// `error.UnmetProcessIsolation` , or `error.UnmetNetworkIsolation` before the/// child runs. By contrast, a preferred dimension records what the caller wants/// and admits every audit, which backend selection reads to pick a runner. Both/// filesystem values count as isolated, so requiring the filesystem dimension/// admits every audit the package can produce. The environment dimension/// appears in the audit and has no entry here, so a policy constrains it in no/// way.pub const Policy = struct {    filesystem: Preference = .require_isolated,    process: Preference = .allow_inherited,    network: Preference = .allow_inherited,    pub fn validate(self: Policy, audit: audit_data.Audit) !void {        if (self.filesystem == .require_isolated and !filesystemIsolated(audit.filesystem)) return error.UnmetFilesystemIsolation;        if (self.process == .require_isolated and !processIsolated(audit.process)) return error.UnmetProcessIsolation;        if (self.network == .require_isolated and !networkIsolated(audit.network)) return error.UnmetNetworkIsolation;    }    pub fn prefersFilesystemIsolation(self: Policy) bool {        return self.filesystem != .allow_inherited;    }    pub fn prefersProcessIsolation(self: Policy) bool {        return self.process != .allow_inherited;    }    pub fn prefersNetworkIsolation(self: Policy) bool {        return self.network != .allow_inherited;    }};

Source: lib/sandbox/src/root.zig:58

zig
pub const Policy = policy.Policy;
Called byCallsNo direct callerspolicyfilesystemIsolatedpolicynetworkIsolatedpolicyprocessIsolatedPolicyvalidate
Static calls · unresolved targets: 0 · external targets: 0.

Audit

Definitions5
Public names10
Members3
Version26.7.0
Revisiondaab053ee433