Expand description
Unified Control: the signed effective policy of one engine (Release B,
C0 2.x schemas/policy.schema.json).
GET /v1/policy/bundle with Cloud-Protocol: 2.x keeps every 1.x member
and adds effective_policy (EffectivePolicyBundleV1, or null when
the server has no lease signing key). Cloud merges the policy hierarchy
(org → workspace → vault → engine) itself; the engine never merges, it
verifies and applies the result:
- signature: Ed25519 by a key-set v3 key of purpose
policyoverEFFECTIVE_POLICY_SIGNATURE_DOMAIN‖ canonical_json(bundle withoutsignature), 128 lowercase hex characters; digest="sha256:" + hex(sha256(canonical_json(policy)))(policy_digest), the value the engine acks;- every member carries
x-enforcement:enginemembers map onto the gateway policy pack (ENGINE_MEMBERS),servermembers are enforced by Cloud itself at the point theirx-servernames (403 policy_denied {member, level},SERVER_MEMBERS),advisorymembers are distributed and shown only. The ack’sunenforcedreports what is enforced nowhere: every member it received that this engine does not enforce and Cloud does not enforce either (unenforced_members: advisory members and members this engine does not know yet), never pretending to enforce them. Server members are left out: Cloud enforces them whatever the engine does (server_members, shown apart in status).
The bundle, the effective policy and its sections accept unknown members and unknown sections (they are covered by the signature and reported as unenforced); a known member with a value outside the contract refuses the whole bundle, so the engine keeps its last valid one.
ent2 (rules for agents and models) adds the optional agents section and
the security members allowed_providers, require_proxy,
readable_roots and never_send. This engine enforces readable_roots
and never_send (ent2-3: io_boundary and the native hooks),
agents.allowed (ent2-2: the MCP server refuses a client whose agent is
not listed) and allowed_providers (ent2-4: the proxy refuses a request
whose serving provider is not listed) and require_proxy (N1: the MCP
server refuses a client whose model traffic is not routed through the
LeanCTX proxy).
QN2 adds the optional orchestrator section (OrchestratorPolicyV1).
This engine enforces orchestrator.network (off: no Orchestrator kind is
posted or relayed for the vault). It validates cross_team_review and
max_sessions_per_vault but has no code path that could enforce them
(Orchestrator sessions are started by the app, and a review request is
not a bus kind). The C0 schema marks both x-enforcement: advisory, so
they are ADVISORY_MEMBERS and the ack reports them as unenforced.
Structs§
- Agents
Policy V1 agentsof an effective policy (ent2). Absent when no level sets one of its members, so a policy without them keeps its digest.- Bundle
Policy V1 policyof a bundle: the default for every vault without an entry, and the per-vault entries ascending byvault_id.- Context
Policy V1 contextof an effective policy.- Effective
Policy Bundle V1 effective_policyofGET /v1/policy/bundle(2.x).- Effective
Policy V1 - The merged policy in normal form (schema
$defs/effective). - Orchestrator
Policy V1 orchestratorof an effective policy (QN2, the Orchestrator network; “Queen” in code). Absent when no level sets one of its members, so a policy without them keeps its digest.- Policy
AckRefusal V1 refusedof an ack (C0$defs/ack_refusal): the bundle the engine keeps applying (applied_*bothnullwhen it holds none).- Policy
AckRefused Response V1 - Answer of
POST /v1/policy/ackto a refusal (C0$defs/ack_refused_response). - Policy
AckRequest V1 POST /v1/policy/ack.- Policy
AckResponse V1 - Answer of
POST /v1/policy/ack. - Policy
Source V1 - A document that went into the bundle.
- Security
Policy V1 securityof an effective policy. Absent member = no level sets it.- Sharing
Policy V1 sharingof an effective policy (enforced by Cloud, not the engine).- Vault
Effective Policy V1 - The effective policy of one vault with a vault-level document.
Enums§
- Policy
AckState V1 - State of an ack:
outdatedwhen a newer bundle was issued since. - Policy
Action V1 - Filter action, loosest first (
x-merge: rank). - Policy
Refusal Reason V1 - Why an engine refused a received bundle (C0
$defs/refusal_reason).
Constants§
- ADVISORY_
MEMBERS - Every member the schema marks
x-enforcement: advisory. - EFFECTIVE_
POLICY_ SCHEMA - EFFECTIVE_
POLICY_ SIGNATURE_ DOMAIN - Domain of the effective-policy signature (key-set v3 purpose
policy). - ENGINE_
MEMBERS section.member→ the gateway policy pack field that enforces it, for every member the schema marksx-enforcement: engine(itsx-engine).- MAX_
ORCHESTRATOR_ SESSIONS - Largest
orchestrator.max_sessions_per_vault(QN2). - MAX_
POLICY_ SOURCES - Largest number of
sourcesand per-vault entries of one bundle. - MAX_
POLICY_ VAULTS - MAX_
REFUSAL_ DETAIL - Longest
detailof a refusal. - MAX_
UNENFORCED - Largest
unenforcedlist of an ack. - PERSONAL_
WORKSPACE_ MODES sharing.personal_workspace, loosest first.- PLANNED_
ENGINE_ MEMBERS section.member→ itsx-instancegateway pack field, for every member the schema marksx-enforcement: instancethat this engine validates but does not enforce yet. The ack reports them as unenforced; each one moves intoENGINE_MEMBERSwith its enforcement.- POLICY_
ACK_ SCHEMA - POLICY_
DOCUMENT_ SCHEMA - POLICY_
MISMATCH - Error code of an ack for a version/digest this engine was not issued.
- SERVER_
MEMBERS - Every member the schema marks
x-enforcement: server: Cloud enforces it (itsx-serverpoint), this engine does not.
Functions§
- is_
country - ISO 3166-1 alpha-2: two uppercase ASCII letters (
$defs/country). - is_
engine_ member - Whether the engine enforces
member(section.member). - is_
server_ member - Whether Cloud enforces
memberitself (x-enforcement: server). - policy_
digest "sha256:" + hex(sha256(canonical_json(value))).- refusal_
detail - A diagnostic line as
detailtakes it: control characters become spaces, every place on the machine (a path, a home folder, a file URL) becomes<path>(K2 M2: the data directory names the user), at mostMAX_REFUSAL_DETAILcharacters,Nonewhen empty. - server_
members - The members
policysets that Cloud enforces itself, sorted bytewise. - signing_
input_ raw - The exact bytes the
policykey signs: the raw bundle as received, without itssignature. - unenforced_
members - The members
policysets that neither this engine nor Cloud enforces (advisory and unknown members), sorted bytewise: what an ack reports.