Skip to main content

Module policy

Module policy 

Source
Expand description

Capability policy: what a script may require, read from the environment, and send over HTTP, enforced inside the builtins.

Orthogonal to ExecMode — a policy narrows what is reachable, the mode decides whether a mutating operation runs, suspends, or is refused. With no policy loaded every check passes and behaviour is unchanged.

Modules§

apply
Wraps the HTTP builtins with policy guards after registration, the same shape readonly and approval use. Enforcement lives here rather than inside the builtins so one place decides, and the transport code stays unaware of who is allowed to call it.

Structs§

Policy
PolicyHandle

Enums§

Classification
Classify

Constants§

POLICY_FILE_ENV
Path to a policy file applied to every VM this process creates. Follows the same env-driven pattern as the other sandbox knobs.

Functions§

active
The active policy for this VM, or None when the process runs unpoliced.
env_visible
from_env
guard_http
guard_require
install
is_read
Whether the policy treats this request as a read. Drives the gates, so a declared authentication POST can proceed under read-only mode.
is_redacted_header
redact_json_text
redact_keys
response_limit