Expand description
The Cloud effective policy as a floor of the gateway policy engine (Release B 3.1.4).
A verified bundle (the Cloud connector’s effective-policy pull) is installed as two files
in <data_dir>/cloud/policy/effective/, both 0600 and written atomically:
floor.json(Floor): the verifiedpolicy(default + per vault), its version, digest andnot_after;required.json: the highest version ever installed. It only grows, and it is what makes a missing policy never mean “no rules”: while it exists, a missing, damaged or older floor fails every policy refresh closed instead of dropping the Cloud rules.
The policy snapshot (crate::core::policy::runtime) reads both files
and folds the floor underneath whatever the engine would enforce
otherwise (local pack, org policy), with crate::core::policy::floor::merge_floor:
every field merges toward the stricter side, so a local setting can only
tighten the Cloud policy, never loosen it. loosened_by_floor names the
local settings the floor overrides, for cloud status.
Only the members the schema marks x-enforcement: engine are mapped
(their x-engine field; security.readable_roots and never_send are
applied to reads by crate::core::policy::cloud_io instead);
everything else is reported as unenforced on
the ack. Expiry (not_after) does not lift the floor: the last valid
rules keep restricting local work offline; only sensitive operations
fail closed (the connector’s sensitive-operation gate).
Structs§
- Floor
- What
floor.jsonholds: the verified effective policy, nothing else. - Required
required.json: the highest installed version.
Constants§
- DIR
- FLOOR_
FILE - FLOOR_
NAME - Name of the resolved Cloud floor (shows in
policydiagnostics). - FLOOR_
SCHEMA - REQUIRED_
FILE
Functions§
- apply
- Fold the Cloud floor under
effective(what the engine enforces without it). Tighten-only: seecrate::core::policy::floor::merge_floor. - check
- The installed floor and requirement, checked against each other:
Ok(None)only when neither exists (no Cloud policy was ever installed here). - floor_
dir <data_dir>/cloud/policy/effectiveof this installation.- floor_
dir_ in floor_dirbelow a Cloud store’s data directory (<data_dir>/cloud).- is_
policy_ path - Whether
target(canonical) lies in<data_dir>/cloud/policy, the files only the engine’s own policy pull writes: agent file tools are refused there (crate::core::pathjail::enforce_writable). - local_
overrides - The local settings of the project at
project_root(its.lean-ctx/policy.toml) that the installed Cloud floor overrides. - loosened_
by_ floor - The settings of
localthat are looser than the Cloudfloorand are therefore ignored, one line each, in a fixed order. - read
- Read both files of
dir(absent =None). - resolve
- The floor for
vault(or the default) as a resolved policy, orNonewhen no Cloud policy is installed or the verified policy sets no members. Enrollment metadata alone must not activate protected source/egress mode. An inconsistent pair is still an error, and the caller fails closed. - to_
resolved - The
x-enginemapping of everyenginemember onto the gateway pack. - vault_
for - The vault whose effective policy applies to
project_root, when the floor has per-vault entries: the vault this checkout is linked to.