Skip to main content

Module policy

Module policy 

Source
Expand description

Capability/policy layer per spec §7.4.

Operators specify what effects are allowed before any execution starts. The runtime walks the program’s declared effects and aborts with a structured violation if the program would exceed the policy. During execution, individual effect calls are also gated through the same policy so that scoped effects (fs paths, budget consumption) are caught at call time.

Structs§

Policy
Policy a program is run under. Empty allow_effects = pure-only execution.
PolicyReport
PolicyViolation
Structured policy violation, formatted to match spec §6.7’s JSON shape.

Constants§

KNOWN_EFFECTS
Every effect kind the stdlib can declare, each with a one-line note. THE single source: Policy::permissive grants exactly these, and lex docs --effects renders this table for docs/AGENT.md’s quick reference (kept current by lex doc-sync --check in CI). #399’s “keep this set in sync with builtins.rs” used to be a comment-level rule enforced by nobody; adding an effect now means adding one row here, and the doc regenerates from it.

Functions§

check_program
Walk the program’s declared effects (gathered from fn signatures) and verify them against policy. Run before any execution.
is_effect_allowed
Decide whether e is permitted by grants (#207).