The MACP governance policy framework (RFC-MACP-0012 (Policy)) allows you to register, resolve, and apply governance rules that control how coordination sessions reach commitment. Policies define voting algorithms, quorum requirements, objection handling, and commitment authority.
PolicyDescriptor — A registered policy definition containing rules encoded as JSON bytes, targeting a specific mode (or "*" for mode-agnostic).
Default policy (policy.default) — Every runtime ships with this pre-registered. When policy_version is empty, the default policy applies, preserving backward compatibility.
Evaluation semantics — The runtime evaluates policy at commitment time. If the policy denies the commitment (e.g., quorum not met), the runtime rejects the Commitment envelope with POLICY_DENIED.
Read-only registry (MACP_POLICIES_DIR). When the runtime is started with
a policies directory, its registry is read-only: Initialize advertises
capabilities.policyRegistry.registerPolicy: false, and registerPolicy /
unregisterPolicy fail with FAILED_PRECONDITION (inspect via
MacpTransportError.code). Check the capability flag before attempting to
register:
See Policy API Reference for the full input types and defaults. The builders emit rules JSON matching the spec's Rule Schemas by Mode; how the runtime interprets each rule (including commitment authority) is documented in the runtime policy guide.
// List all registered policiesconst allPolicies = await client.listPolicies();// Filter by modeconst decisionPolicies = await client.listPolicies('macp.mode.decision.v1');// Get a specific policyconst policy = await client.getPolicy('policy.fraud.majority-veto');// Unregisterawait client.unregisterPolicy('policy.fraud.majority-veto');
When policy_version is empty or set to policy.default, the runtime applies the default policy — no voting threshold, vetoes disabled, initiator-only commitment authority. This matches the runtime's behavior before the policy framework was introduced. The full default rule set is specified in the spec's Default Policy section.