Expand description
Runtime view of the active context policy pack (GL #673 / #489 enforcement).
active loads and resolves the project policy pack
(.lean-ctx/policy.toml) once, folds in a trusted central org policy as a
floor when one is installed (GL #674), then caches the ResolvedPolicy
together with its precompiled redaction regexes so the MCP hot path
(crate::server::policy_guard and the call_tool redaction step) can
consult it cheaply.
Opt-in & backward-compatible: with no project pack present, active
returns None and nothing is gated — existing behavior is preserved
exactly. An invalid local pack activates a deny-all policy so enforcement
never fails open.
Local-Free Invariant: enforcement derived from this view only ever constrains the agent pipeline; it never gates a human’s own local reads.
Structs§
- Active
Policy - A resolved policy plus its precompiled redaction regexes — the cached, hot-path-ready form.