The Identity Layer is the constitutional backbone of the Governance Layer framework. It encodes an AI agent’s value commitments as formal, immutable structures and enforces a four-tier mutability model that controls how every governable parameter may be changed — from impossible-to-alter core principles all the way down to freely adjustable operational knobs. This page documents every public class and enum exposed byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/xcoder-es/governance-layer/llms.txt
Use this file to discover all available pages before exploring further.
governance.identity.
Enumerations
CommitmentType
Classifies what a CoreCommitment statement represents within the identity vector.
| Member | Value |
|---|---|
VALUE_PRINCIPLE | "value_principle" |
BOUNDARY_CONDITION | "boundary_condition" |
RELATIONSHIP | "relationship" |
CommitmentThreshold
Specifies the voting or approval threshold required to modify a commitment.
| Member | Value |
|---|---|
UNANIMITY_MULTISIG | "unanimity + external_multisig" |
SUPERMAJORITY | "supermajority" |
MAJORITY | "majority" |
EnforcementMode
Defines the external mechanism that backs a commitment’s enforcement.
| Member | Value |
|---|---|
INTEGRITY_VETO | "integrity_committee_veto" |
EXTERNAL_AUDIT | "external_audit" |
CONSTITUTIONAL_CONTRACT | "constitutional_contract" |
INTEGRITY_VETO, any action index listed in affected_action_indices receives a reduced coherence score from IdentityCore.evaluate_coherence.
MutabilityTier
The four tiers used throughout the tiered-mutability system. Each tier is an auto()-valued Enum member.
| Member | Description |
|---|---|
IMMUTABLE | Cannot be modified under any circumstances. |
CONSTITUTIONAL | Requires unanimity plus external 3-of-5 multisig and a 30-day cooling-off period. |
OPERATIONAL | Requires a two-thirds supermajority and a 7-day cooling-off period. |
DYNAMIC | Requires a simple majority; takes effect immediately. |
Data Classes
CoreCommitment
A frozen dataclass that represents a single constitutional commitment. Instances are immutable once created.
Semantic category of the commitment: a value principle, a hard boundary, or a relational obligation.
Human-readable statement of the commitment, e.g.
"Never harm a human being".The approval threshold required before this commitment can be modified.
The external mechanism that enforces this commitment at runtime.
Action indices from the ontology whose coherence score is penalised when this commitment is active. Only applies when
enforcement is INTEGRITY_VETO.AttestationReport (see TEE page)
Classes
IdentityCore
Manages the set of CoreCommitment objects that constitute the agent’s formal identity and exposes a floating-point coherence score for any candidate action.
add_commitment
Appends a new CoreCommitment to the identity and rebuilds the internal identity vector. The vector grows by one component per added commitment.
The commitment to register.
evaluate_coherence
Computes a coherence score in [0.0, 1.0] for a proposed action index. A score close to 1.0 means the action does not conflict with any INTEGRITY_VETO commitments; a score close to 0.0 means the action is broadly restricted.
The integer index of the candidate action from the ontology namespace.
Coherence score between
0.0 (fully restricted) and 1.0 (fully permitted). Returns 1.0 when no commitments have been registered.INTEGRITY_VETO commitment, the score is incremented by +1 if action_index is not in the commitment’s affected_action_indices, and decremented by −1 if it is. The raw sum is divided by the total number of commitments and clamped to [0.0, 1.0].
Property: identity_vector
A copy of the internal identity vector. One float component per registered commitment. In the current implementation each component is
1.0; the vector length acts as a dimensionality signal.Property: commitments
A copy of all registered
CoreCommitment objects, in insertion order.TieredMutability
Implements the four-tier parameter governance model. Each named parameter is assigned to a tier at registration time; all subsequent modification requests are validated against that tier’s rules.
Tier Rules Reference
| Tier | Modification Threshold | Cooling-off | External Multisig | Parliament Unanimity |
|---|---|---|---|---|
IMMUTABLE | impossible | 0 days | No | No |
CONSTITUTIONAL | unanimity + 3-of-5 multisig | 30 days | Yes | Yes |
OPERATIONAL | supermajority (2/3) | 7 days | No | No |
DYNAMIC | majority (1/2 + 1) | 0 days | No | No |
TIER_RULES dict (governance.identity.tiers.TIER_RULES) keyed by MutabilityTier.
register_parameter
Registers a named parameter with an initial value and assigns it to a tier. Calling this method a second time with the same name overwrites the previous registration.
Unique string name for the parameter, e.g.
"majority_threshold".The parameter’s starting value.
The tier that governs future modifications to this parameter.
get_tier
Parameter name to look up.
The tier assigned to
name, or None if the parameter has not been registered.get_value
Parameter name to retrieve.
The current value of the parameter, or
None if not found.propose_modification
Returns a human-readable proposal string that describes what approval process would be required to change the parameter. Does not apply the change.
Parameter name to modify.
The proposed new value (used for description only; not validated or stored).
A string such as
"Proposal accepted. Requires: supermajority (2/3), cooling-off: 7d", or an error string if the parameter is unknown or IMMUTABLE.apply_modification
Applies the new value immediately, bypassing cooling-off (the caller is responsible for enforcing any waiting period at the application layer). Returns False without modifying the value if the parameter is IMMUTABLE or not registered.
Parameter name to update.
The value to write.
True if the value was written; False if the parameter is IMMUTABLE or unknown.get_all_params
A shallow copy of all registered parameter names and their current values.
Full Example
Supporting Classes
BoundedParameter
A dataclass used internally by ParameterEnvelope to represent a single parameter with validated bounds.
Name of the parameter.
Default value restored by
reset_to_defaults().Inclusive
(low, high) bounds. Pass None on either side to skip that bound.Current value; initialised to
default automatically.set(value) -> bool
Writes value if it falls within bounds; returns False otherwise.
ParameterEnvelope
Stores all speaker parameters that the Identity Layer is permitted to modify, along with their valid bounds. The module exports a ready-made DEFAULT_PARAMETER_ENVELOPE instance pre-populated with the four canonical system parameters.
| Parameter name | Default | Bounds |
|---|---|---|
quorum_threshold | 0.5 | (0.3, 0.7) |
max_deliberation_rounds | 3 | (1, 10) |
member_min_budget | 1 | (1, 20) |
deadlock_threshold_cycles | 100 | (10, 1000) |
register(name, default, bounds)
Adds a new bounded parameter. Silently overwrites an existing entry with the same name.
get(name) -> Optional[Any]
Returns the current value, or None if not registered.
set(name, value) -> bool
Sets the value if it satisfies the registered bounds. Returns False on unknown names or out-of-bounds values.
reset_to_defaults()
Restores all parameters to their registered defaults.
snapshot() -> Dict[str, Any]
Returns a shallow copy of all current {name: value} pairs.
Ontology
Maps integer action indices to their operational semantics and SHA-256 runtime integrity hashes. The TEE verifies these hashes at batch-validation time to detect tampered implementations.
register(index, operation, implementation_bytes, properties) -> ActionBinding
Binds an action index to its implementation. Raises ValueError if the index is already bound.
verify_binding(index, runtime_implementation) -> bool
Returns True if the SHA-256 hash of runtime_implementation matches the genesis hash for index.
get_properties(index) -> Optional[Dict[str, float]]
Returns the float property map for the given action, or None if not registered.
has_index(index) -> bool
Returns True if the index is registered in the ontology.
Property: size -> int
Number of registered action bindings.
ExtensionPhase
Ordered lifecycle phases for an ExtensionCandidate. An extension moves forward through the phases and may be rejected at the audit or finalization step.
| Member | Description |
|---|---|
PROPOSAL | Candidate has been submitted; sandbox testing has not started. |
ISOLATION_BUFFER | Sandboxed monitoring rounds are running or have completed. |
EMPIRICAL_AUDIT | Empirical measurements are being compared against declared properties. |
FINALIZED | Candidate passed audit and multisig approval; bound in the ontology. |
REJECTED | Candidate failed the empirical audit or multisig check; cannot be finalized. |
ExtensionCandidate
A dataclass that tracks an ontology extension through its lifecycle. Created and managed by ExtensionSandbox.
The action index reserved for this candidate in the ontology namespace.
Human-readable operation name, e.g.
"speak_financial_advice".Declared property estimates submitted with the proposal (e.g.
{"risk": 0.2, "novelty": 0.8}).Property measurements collected during isolation-buffer monitoring rounds; populated by
run_sandbox().Current lifecycle phase.
Chronological list of per-round monitoring snapshots produced by
run_sandbox().Whether external multisig approval has been obtained (set externally before
finalize()).SHA-256 hex digest of the finalized implementation bytes; populated by
finalize() on success.Property: is_sandboxed
Returns True when phase == ExtensionPhase.ISOLATION_BUFFER.
ExtensionSandbox
Manages the 30-day isolation-buffer protocol for proposing new ontology actions. New action candidates pass through five ordered phases: PROPOSAL → ISOLATION_BUFFER → EMPIRICAL_AUDIT → FINALIZED (or REJECTED).
propose(index, operation, candidate_properties) -> ExtensionCandidate
Creates a new candidate in the PROPOSAL phase. Raises ValueError if the index is already bound in the parent ontology.
run_sandbox(index, rounds=5)
Transitions the candidate into ISOLATION_BUFFER and runs rounds of independent monitoring with small random perturbations to empirically measure properties.
audit(index, tolerance=0.1) -> bool
Compares empirical_properties against candidate_properties; rejects the candidate if any property drifts by more than tolerance.
finalize(index, implementation_bytes) -> Optional[ActionBinding]
Commits the candidate to the parent ontology if multisig is authorized and the audit passes. Returns the new ActionBinding, or None on failure.
get_candidate(index) -> Optional[ExtensionCandidate]
Returns the ExtensionCandidate registered at index, or None if no candidate exists for that index.
Key Hierarchy
GenesisMultisig
Simulates a t-of-n multisig approval scheme used to authorize genesis bootstrapping and constitutional-tier modifications. Default threshold is 3-of-5.
Constructor
Minimum number of holder signatures required for authorization.
Total number of key holders (informational; does not enforce an upper limit on
add_holder calls).add_holder(name) -> str
Registers a new key holder with a randomly generated simulated public key. Returns the 16-hex-character public key string.
sign(holder_name) -> bool
Marks the named holder as having signed. Returns True on success; False if the name is not found or the holder has already signed.
Property: signatures_count -> int
Number of holders that have signed in the current round.
Property: is_authorized -> bool
True when signatures_count >= threshold.
reset()
Clears all signatures, arming the multisig for a new round.
GenesisManifest
A dataclass that acts as the root-of-trust record for an enclave. It commits to the ontology, core commitments, parameter envelope, and member set at genesis time. Passed to SimulatedEnclave.cold_boot() to reset the enclave to a known-good state.
SHA-256 hex digest committing to the serialised ontology at genesis.
SHA-256 hex digest committing to the set of
CoreCommitment objects at genesis.SHA-256 hex digest committing to the
ParameterEnvelope snapshot at genesis.SHA-256 hex digest committing to the initial parliament member set at genesis.
The multisig instance used to authorize constitutional-tier changes.
Whether the manifest has been sealed. Set to
True by seal().seal()
Sets is_sealed = True. A sealed manifest signals that genesis bootstrapping is complete and the enclave may proceed to attestation.