Managed extension controls
Managed extension controls give Cloud and local administrators a shared authority for deciding which command-safety extensions and permissions can operate. The system binds signed policy to a known extension catalog, applies it only when the device supports the required contract, and keeps a safe last-known-good state when delivery or storage fails.
Authority model
Managed extension control is the restrictive Cloud layer in a two-layer authority model. A local administrator first establishes the local authority, then signed Cloud policy can add restrictions or delegate protection to another security system.
Authority layers
The local authority and the signed Cloud layer describe control state for extension and permission targets. A target is the stable catalog identity of an extension or one permission owned by that extension. The system composes both layers so that a disable always wins. A global lockdown blocks normal command evaluation, while trusted local recovery and proof surfaces remain available for repair.
The managed-restrictive mode can only narrow access. Shared modes can enable a configurable permission, but they cannot weaken a required extension or an immutable permission floor. This keeps Cloud policy from turning an optional control into an unsafe broad allow.
The daemon mutation boundary preserves this authority split. Local changes keep the signed Cloud layer unchanged, and requests cannot create or alter a required extension or immutable permission control. The effective projection reports local state, managed state, and the final allowed or blocked result from the same authoritative snapshot.
The local authority has a health state that affects whether it can enforce policy. A view that has not yet read the authority grants nothing and is replaced by the next authenticated read.
| Health | Meaning for managed controls |
|---|---|
unenrolled | No local authority exists yet. |
protected | Signed Cloud and local layers can be used. |
degraded-* | Normal evaluation uses a lockdown view until the condition is known and handled. |
tampered | Stored authority or its external anchor failed integrity checks. |
recovery-required | A change stopped between durable stages and needs authenticated recovery. |
References: src/…/extension_control_authority.py• L24-48 src/…/extension_control_runtime.py• L52-142 src/…/extension_control_projection.py• L45-127 src/…/extension_control_api.py• L683-746
Authority enrollment
Enrollment is a one-time trust step for the local authority. It requires an approval-gate grant and direct confirmation from a local interactive terminal. A successful enrollment creates an empty protected authority at revision zero; later changes use a fresh proof bound to the exact proposed mutation.
This boundary prevents a remote session or a replayed approval from silently taking ownership of local extension controls. The persisted authority stores private identifiers as keyed hashes rather than actor names, nonces, or proof identifiers.
References: src/…/extension_control_proof.py• L302-394 src/…/extension_control_proof.py• L397-427 src/…/store_extension_control_authority_commit.py• L44-63 src/…/store_extension_control_authority_support.py• L271-293
Catalog and compatibility
The catalog is the shared description of the extension identities that policy may target. Its digest is the common identity used by local runtime, Cloud policy, delivery records, and the effective control projection.
Extension catalog
The catalog projects only the metadata needed to identify and govern an extension. It includes stable IDs, versions, source class, executable and ecosystem names, risk classes, delegation state, deprecation links, and permission properties. It does not send command text, rules, paths, project markers, environment data, secrets, or command history.
The catalog is canonical and bounded. Ordering does not change its SHA-256 digest, duplicate identities are rejected, replacement targets must exist, and the payload must use the advertised limits. The native catalog producer owns the shared projection, digest, cache, and upload limits. The Python layer requests bounded pages or the legacy view from that producer; it does not construct the Cloud projection itself.
An installed catalog view can be reused when its native observation still matches the installed catalog and discovery context. The native producer rechecks the cached view before reuse and rebuilds it when the cached pages no longer verify. Legacy reads use the native cache lock directly, so they do not consume a transfer lease needed for page upload.
References: src/…/extension_catalog_sync.py• L30-60 src/…/extension_catalog_sync.py• L178-253 src/…/extension_catalog_pages.py• L13-46 src/…/extension_catalog_pages.py• L49-108 src/…/extension_catalog_pages.py• L136-181 src/…/command_builtin_extension_catalog.py• L32-56 src/…/command_ollama_extensions.py• L51-121
Extension contribution intake
Extension contributions enter the catalog through a reviewed source and fixture workflow. Offline discovery produces a contribution kit, while validation and handoff confirm the canonical source paths, external trust class, and generated projections without running the target command or changing active protection.
This boundary keeps extension identity and trust decisions separate from runtime command matching. A contribution must bind its descriptor to a generated native source and must agree with the authored trust binding or packaged trust map before it can become catalog authority.
Trust classes provide a stable policy label for first-party, trusted-library, and external extensions. The runtime loads authored bindings in source environments and packaged trust data in frozen installations, so the same catalog identity remains tied to the same trust class after packaging.
References: src/…/extension_builder_commands.py• L29-69 src/…/extension_builder_commands.py• L111-193 src/…/extension_contribution.py• L55-90 src/…/extension_contribution.py• L163-208 src/…/extension_trust.py• L12-20 src/…/extension_trust.py• L63-134
Capability negotiation
Capability negotiation lets a device state which parts of managed control it can safely support. The runtime advertises catalog sync first. With a protected local authority it can add control layers, policy targets, atomic apply, and device-bound custom-extension continuity in order.
Cloud must use only capabilities that the runtime reports and local feature gates allow. The resident decides whether the session needs a catalog, whether a bounded catalog upload can proceed, and whether an acknowledgement binds the expected digest. A known catalog can reuse a verified prepared view without remarshal, but the digest remains part of the session posture. If the resident is unavailable or cannot serve the requested contract, the session reports a downgrade instead of claiming managed catalog support.
| Capability | System requirement |
|---|---|
extension-catalog.v2 | Native catalog production and sync are available. |
extension-control-layer.v1 | Catalog sync and protected local authority. |
policy-extension-targets.v1 | Managed extension controls are enabled. |
managed-controls-atomic-apply.v1 | Policy target support and atomic activation are enabled. |
custom-extension-continuity.v2 | The full managed-control path and the extension-first UI are enabled. |
References: src/…/feature_flags.py• L42-79 src/…/managed_controls_sync.py• L66-96 src/…/extension_catalog_handshake.py• L22-78 src/…/extension_catalog_handshake.py• L124-146 src/…/extension_catalog_pages.py• L13-46 src/…/extension_catalog_pages.py• L136-164
Resident compatibility
The native resident is the shared runtime service for managed-control requests. Clients prefer a live resident that matches the current runtime, while bounded ownership checks and client leases prevent two installs from serving the same home at once.
Guard can share a home while installs are at different versions. If an older resident reports an unknown store method, the newer client may answer only reads that are safe in isolation. It runs that read in a rollback-only transaction and keeps the digest of the request as sent. Writes and reads with their own commit behavior stay with the resident that owns the store, so compatibility cannot turn an unsafe operation into an unowned update.
A client lease keeps the resident alive while active work uses it. When the owner exits, the lease and process identity checks bound handoff to the right runtime. A request that cannot find a compatible serving resident starts one within the caller's deadline; a health-only query reports that no resident is serving instead of starting one merely to answer the query.
References: rust/…/managed_resident.rs• L113-171 rust/…/managed_resident.rs• L240-325 rust/…/managed_resident_client_request.rs• L84-195 rust/…/managed_resident_client_request.rs• L318-443 rust/…/managed_resident_lease.rs• L152-249 rust/…/managed_resident_lease.rs• L251-400 rust/…/managed_resident_store_fallback.rs• L33-92
Runtime ownership
Generated Pi extensions must keep using the durable Guard runtime that owns their hooks. The runtime resolver prefers the Desktop-managed stable launcher or an official user install over a temporary AppImage path or an unrelated older command, so a Desktop update does not leave the extension attached to a retired process.
On Windows, the generated extension starts a contained Python bridge instead of depending on a shell command path. Both paths provide the same Guard evaluation and recovery contract while preserving the host deadline and fail-safe behavior.
References: src/…/pi_extension_runtime_ownership.py• L1-92 src/…/pi_extension_source.py• L16-24 src/…/pi_extension_source.py• L31-84
Policy authority and enforcement
Signed policy is accepted as extension authority only after envelope verification, workspace checks, version checks, and capability checks. The resulting projection is then bound to the exact local catalog and authority state that will enforce it.
The managed-control path moves from catalog agreement to signed policy validation and then to an authenticated local projection. This diagram shows the main authority path and its safe fallback points.
flowchart LR
Catalog[Local extension catalog] -->|digest and capabilities| Negotiation[Catalog negotiation]
Negotiation --> Bundle[Signed Cloud bundle]
Bundle --> Validation[Envelope and semantic validation]
Validation -->|valid and compatible| Activation[Authenticated activation]
Validation -->|unavailable or invalid| LKG[Last-known-good floor]
Activation --> Runtime[Effective runtime snapshot]
LKG --> Runtime
Runtime --> Decision[Command control decision]
Runtime --> Status[Bounded status and telemetry]
Signed control bundles
The policy bundle is a signed Cloud document with an identity, version, issue and expiry times, workspace binding, and a payload. The payload can define a signed Cloud control layer, rule-to-extension targets, and delegated targets. The parser accepts extension semantics only when the complete negotiated contract is present.
The resolver rejects a revoked, not-yet-valid, expired, or catalog-mismatched managed policy. It also rejects a rollback to an older revision. If Cloud is unavailable and a valid last-known-good policy exists, the device keeps that policy as a restrictive floor and records that it is doing so. If no valid floor exists, the managed layer becomes global lockdown.
An active managed layer is checked again against the trusted catalog contract when the authority is read. A known target with a changed contract is disabled until Cloud supplies a fresh compatible policy. An unknown target stays visible so the resolver can report it as an invalid target instead of silently allowing it.
The activation record carries the bundle identity, workspace, catalog digest, base authority revision, managed revision, projection digest, and acknowledgement. It is authenticated as one complete state so a partial write cannot appear to be an applied policy. The native resident applies the accepted remote decisions, activation state, acknowledgements, and continuity state in one transaction only when the authority snapshot and all observed sync values are unchanged.
References: src/…/managed_extension_controls.py• L25-132 src/…/managed_controls_policy_bundle.py• L148-184 src/…/managed_controls_policy_bundle.py• L229-326 src/…/synced_policy.py• L31-59 src/…/store_extension_control_authority_reads.py• L132-240 rust/…/policy_apply.rs• L68-185 rust/…/policy_apply.rs• L211-275
Control composition
During command evaluation, the native resident expands extension and permission dependencies before it checks control state. This means a disabled dependency can block a request even when the directly observed extension was not itself disabled. Unknown targets, duplicate layers, duplicate targets, catalog mismatches, invalid surfaces, unsupported schema, and input over the shared limits become resolver failures rather than silent allows.
The runtime keeps observations separate from authorization. A command can carry uncertainty evidence without losing that evidence, while a control failure creates a clear block factor. Native matcher evidence is accepted only when it matches the command, catalog, native program, control revisions, and effective projection that produced it. The runtime uses an immutable snapshot and swaps it only after durable authority state is ready. Its revision and effective digest prevent an older or different projection from replacing a newer one. No hook path carries an active extension-control snapshot, so approval bindings use the fixed no-control digest rather than an implicit per-hook snapshot.
The daemon publishes a bounded effective projection for clients. It names local and managed explicit state, final effective state, fixed or required properties, and safe reason codes without exposing private decision evidence.
References: src/…/extension_control_runtime.py• L22-57 src/…/extension_control_runtime.py• L139-253 src/…/extension_control_runtime.py• L250-253 src/…/extension_control_projection.py• L18-127 src/…/native_command_extension_evidence.py• L86-159 src/…/command_extension_interaction.py• L28-80 src/…/extension_control_api.py• L198-223
Native evidence boundary
The native evidence boundary converts validated matcher observations into catalog-owned extension and rule identities. Evidence carries stable extension and rule versions plus canonical Guard actions, so a decision can preserve identity and meaning across the native and legacy surfaces.
The same boundary projects the central decision into older interaction surfaces. A matcher failure remains a block signal without exposing matcher-provided data, and an observation that does not meet the current control snapshot is rejected before it can affect the result.
References: src/…/extension_evidence.py• L20-51 src/…/native_command_extension_evidence.py• L15-70 src/…/native_command_extension_evidence.py• L86-159 src/…/command_extension_interaction.py• L36-80
Review hints
Review hints explain why a paused command needs extension setup or which extension covers each command step. They are advisory projections of resident evidence. They carry catalog identifiers and bounded executable names rather than command text, and they never change authority.
An allow hint answers whether enabling configurable permissions could settle the whole command. A coverage hint answers which extension matched which step when one command has several steps. A connector setup hint points to a local connector review surface. Every actual enable or setup action still uses the normal proof-bound mutation path.
References: src/…/extension_allow_hint.py• L1-9 src/…/extension_allow_hint.py• L38-119 src/…/extension_allow_hint.py• L154-216 src/…/extension_coverage_hint.py• L1-13 src/…/extension_coverage_hint.py• L90-149
Semantic preview
Semantic preview shows the effect of a proposed local control change before it is applied. It uses the same catalog and resident resolver as command enforcement, so an operator can see explicit and effective state, affected permissions and rules, dependencies, conflicts, provenance, and warnings without executing a command or changing detector metadata.
The preview distinguishes a requested allow from an effective allow. A stronger parent, dependency, lockdown, or managed control can still block the target. This makes indirect effects visible before approval and gives the control center a single source for policy meaning.
References: src/…/extension_control_semantic_preview.py• L1-6 src/…/extension_control_semantic_preview.py• L18-75 src/…/extension_control_semantic_preview.py• L178-185 src/…/extension_control_api.py• L461-553
Delegated protection
Some extensions do not own command rules in Guard. They declare delegated protection, which currently means Package Firewall owns the relevant enforcement. The generated catalog still exposes the extension and permission identity so policy can target it, but policy activation requires the delegated enforcement capability.
This split keeps one control target visible across systems without making Guard claim protection that another system must provide. A missing delegated capability rejects the policy semantics instead of treating the target as locally protected.
References: src/…/command_extensions.py• L20-49 src/…/managed_controls_policy_fields.py• L57-77 src/…/managed_controls_policy_fields.py• L98-145
Activation preparation
When a control change also needs a managed command-pack activation, the daemon prepares an immutable candidate before the proof-bound authority commit. The candidate binds the proposed catalog and control layers to the activation authority, security floor, and selected protections.
Prepared candidates use short-lived leases and a bounded cache. An expired or changed candidate cannot be applied. Preparation failures keep one stable public error but add a safe cause and recovery action, while detailed failure data stays in the daemon log.
References: src/…/extension_control_prepared.py• L25-39 src/…/extension_control_prepared.py• L105-227 src/…/extension_control_preparation_failure.py• L1-15 src/…/extension_control_preparation_failure.py• L114-148 src/…/extension_control_errors.py• L26-71
Native authority publication
The resident publishes authenticated authority records that other Guard processes use for command control. Each record has a fixed schema and purpose, and the native boundary checks its canonical form before it accepts its digest and authentication tag. Malformed records or invalid stored row values become tampered or degraded state instead of usable authority.
The publication boundary accepts only the named private state records, applies size limits, writes them atomically, and reads them back before reporting success. The command-control marker uses a schema-specific signature and a strict record shape, so a malformed or incomplete runtime state cannot be treated as active authority.
This publication keeps policy meaning in the signed and verified records while moving the final private-file write into the native authority boundary. A failed write or read-back mismatch leaves the prior state in place and returns an explicit failure rather than claiming that enforcement changed.
References: rust/…/records.rs• L18-128 rust/…/records.rs• L255-323 rust/…/private_state.rs• L1-92 rust/…/command_marker.rs• L1-77 rust/…/command_marker.rs• L80-167 rust/…/private_state_tests.rs• L10-59 rust/…/command_marker_tests.rs• L48-144
Command domain coverage
The catalog groups direct command protections by domain and gives each operation a bounded public description. This lets managed policy target a meaningful permission while the runtime keeps command parsing in the native protection path.
The current direct domains include cloud DNS operations. AWS Route 53, Google Cloud DNS, and Azure DNS changes cover destructive zone and record actions as well as related resolver or policy changes. Unknown options remain fail-secure, and safe help or inspection forms stay distinct from destructive operations.
References: src/…/command_dns_extensions.py• L21-45 src/…/command_dns_extensions.py• L203-351 src/…/command_dns_extensions.py• L353-405 src/…/extension_directory_operations.py• L30-81
State migration and drift
Managed control state must remain meaningful when the catalog or device context changes. The system distinguishes a trusted catalog upgrade from an unexpected digest change, and it keeps only controls whose target meaning remains safe.
Catalog migration
When a trusted built-in catalog changes, the authority records a new revision and rebinds retained controls to the new catalog digest. A catalog manifest fingerprints the control contract behind each extension and permission. The fingerprint covers the behavior that gives a target its meaning, not only its display identity. Disabled controls survive as a restrictive choice. Enabled controls survive only when their prior contract is unchanged or no prior fingerprint exists.
Managed Cloud controls use a stricter rule than local controls. A known enabled target survives only when its prior authenticated fingerprint matches the current one. If the prior manifest is missing, the target is disabled until Cloud refreshes the policy. A target absent from the current catalog remains visible so resolution fails closed and identifies the unknown target.
Removed targets and enabled targets whose rule or permission contract changed are retired. The migration records the old and new digests, revision, retired target IDs, and catalog provenance. Provenance identifies the Guard version that wrote the target catalog when that information is available. If a shared Guard home moves back to an older catalog writer, the system emits a separate regression event with the writer versions and retired targets so protection loss is visible instead of silent. Older migration records without provenance remain valid and do not create a false regression.
The resident prepares and commits a migration through the same anchored revision chain as other authority changes. It records the migration event with the committed revision, and a protected read can backfill one missing event only after it confirms that the stored head still matches. This keeps migration telemetry tied to the state that actually committed.
Digest changes without a trusted registry boundary are treated as tampering and do not migrate the authority. Catalog migration events are recorded once per revision, including events backfilled during an authority read.
References: src/…/store_extension_control_authority_catalog.py• L49-101 src/…/store_extension_control_authority_catalog.py• L181-256 src/…/store_extension_control_authority_catalog.py• L258-491 src/…/store_extension_control_authority_catalog_events.py• L46-197 src/…/store_extension_control_manifest.py• L17-108 src/…/store_extension_control_authority_support.py• L51-85 rust/…/migrate.rs• L69-129 rust/…/migrate.rs• L132-187 rust/…/migration_event.rs• L42-99
Device-bound continuity
Custom extension continuity carries signed Cloud state across local observations without exposing raw extension identity. Version 2 binds each item to one hashed workspace and device context. It applies only when the authority is protected and the continuity capability was negotiated.
The continuity path marks items as applied, stale, changed, removed, locally overridden, or pending observation. An expired observation cannot keep changing local state. A local override wins over a Cloud removal, and a tombstone for an old identity cannot clear a replacement identity. A context change cleans up prior Cloud grants only when the local identity and observation preconditions still match.
References: src/…/custom_extension_continuity_v2.py• L64-88 src/…/custom_extension_continuity_v2.py• L146-207 src/…/custom_extension_continuity_v2.py• L223-289 src/…/custom_extension_continuity_v2.py• L315-379
Durable recovery
Local authority changes use a staged revision chain with an authenticated snapshot and an external anchor. The change moves through prepared, anchored, and committed phases. The anchor records the revision and snapshot identity for each phase, while idempotency keys and nonces let a retry finish one change without creating a second revision.
A prepared change remains available for a short retry window so its single-use proof can finish the same request. An older prepared change is authenticated before it is discarded when the committed anchor still proves that it never took effect. Anchored or committed inconsistencies require explicit recovery instead of automatic deletion. The resident applies the final transition and queues its bounded change event in immediate transactions, so a failed database step cannot leave a half-applied authority.
Authority secrets use Guard's owner-only local vault as the stable copy. On macOS, an older OS keyring copy is migrated only during an explicit account action; passive reads do not open a keyring prompt. This keeps daemon, hook, and terminal processes on one credential source when a session keyring is unavailable.
If the database, anchor, credential store, or transition chain cannot be verified, the authority reports tampering or recovery required and normal evaluation uses a fail-safe view. Authenticated recovery archives the unverifiable rows before it creates a fresh empty protected authority. This avoids importing state that cannot be proved trustworthy.
The authority schema advances only through recognized compatible markers. Control authority records use the normal schema, while command-pack activation uses the higher pack schema only when that feature is active. An unsupported marker blocks trusted reads rather than being treated as a valid empty authority. Native authority publication also keeps the command-control marker and private state records behind fixed schemas and private file limits.
References: src/…/store_extension_control_authority.py• L56-180 src/…/store_extension_control_authority.py• L207-325 src/…/store_extension_control_authority_commit.py• L65-382 src/…/store_extension_control_authority_schema.py• L11-192 src/…/store_extension_control_authority_support.py• L137-220 src/…/store_extension_control_authority_transitions.py• L32-246 src/…/store_extension_control_authority_transitions.py• L248-335 rust/…/records.rs• L89-128 rust/…/records.rs• L325-398 rust/…/commit.rs• L192-255 rust/…/resume.rs• L101-188 rust/…/reset.rs• L81-176 rust/…/schema.rs• L19-210 rust/…/writes.rs• L26-55
Privacy and telemetry
Telemetry explains control posture and change history without becoming a second policy channel. Public status, runtime posture, and change events expose bounded identities and outcomes while private proof material stays in protected local storage or keyed form.
Privacy boundary
Catalog exchange excludes data that could reveal user work or command content. Managed audit metadata reports policy revision, lockdown state, disabled counts, last-known-good use, bounded failure codes, and a small set of block sources. It does not report actor IDs, proof values, nonces, command text, or paths.
Delivery records bind a bundle to workspace, device, runtime session, catalog digest, authority revision, payload hash, and effective projection digest. This supports exact correlation without accepting a delivery for another device, session, workspace, catalog, or projection.
Remote policy apply and review-memory publication accept only their allow-listed state fields and remote decision rows. They preserve local decisions while replacing the remote set, and they reject malformed or out-of-scope data before any write. This keeps Cloud state separate from local authority and prevents a policy payload from becoming an uncontrolled database write.
References: src/…/extension_catalog_sync.py• L205-253 src/…/extension_catalog_pages.py• L111-133 src/…/managed_extension_controls.py• L135-157 src/…/policy_bundle_delivery.py• L15-31 src/…/policy_bundle_delivery.py• L89-147 rust/…/policy_apply.rs• L30-132 rust/…/review_memory.rs• L19-90
Telemetry projections
Authority changes produce a small policy-change event with revision movement, catalog identity, hashed actor and mutation references, and bounded semantic target changes. Each target has a hashed target reference plus before and after explicit and effective states and bounded affected rule IDs. The event does not expose actor identity, proof, nonce, or command data. Public managed status verifies the authenticated activation before it returns bundle, workspace, policy revision, managed revision, expiry, and projection identity.
Catalog migration events add bounded provenance and retired-target information. A separate regression event is emitted only when the migration can be attributed to an older catalog writer. This makes cross-install protection loss visible without turning raw installation or user identity into telemetry. Recovery queues the committed change event from the verified committed row, so a read or retry does not invent a new policy change.
Runtime sessions publish catalog and authority posture only when the related feature gates and local health permit it. A degraded or tampered authority therefore advertises catalog visibility at most, not managed enforcement capability.
References: src/…/extension_control_events.py• L7-35 src/…/store_managed_controls_status.py• L32-83 src/…/managed_controls_sync.py• L149-173 src/…/extension_catalog_handshake.py• L149-196 src/…/store_extension_control_authority_catalog_events.py• L107-197 src/…/store_extension_control_authority_support.py• L284-307 src/…/extension_control_api.py• L639-663 rust/…/resume.rs• L430-501 rust/…/change_event.rs• L22-59 rust/…/migration_event.rs• L42-99
Operator workflow
Operators use the local control authority to enroll the device, inspect the catalog, preview an effective change, test a command without execution, apply an approved mutation, review history, and recover a damaged state. The operator-facing daemon and dashboard surfaces are described in Extension control center.
Control center relationship
The control center is a review surface over the authority model described here. It should show the catalog and effective projection together because a control is meaningful only against the catalog digest that names its target. It should also show semantic preview warnings and test-lab results before an operator commits a change.
The protection-center extension overview presents built-in and custom extension views alongside the current protection status. It derives active state from the effective controls and keeps discovery, filtering, and connector setup as separate user actions. Inspect-only connector and host sources inform the operator but do not change protection.
The extension policy panel presents configurable permissions as Recommended, Allow, or Block. Recommended follows Guard defaults by removing a local override. Allow is disabled when organization policy already blocks the capability, while Block can add a stricter local floor. Required extensions and immutable permissions remain read-only.
The panel keeps edits in a draft until the operator reviews the semantic effect. It disables editing when local authority is not protected, warns when the current revision or catalog makes the draft stale, and offers compatible rebase or current-state choices when protection changed during editing. The review sheet shows explicit and effective changes, affected rules, risks, and warnings before it asks for approval.
The daemon API separates inspection from mutation. Catalog, effective state, history, command inspection, and side-effect-free test evaluation are read or review paths. Preview creates an approval-bound proof when needed, while apply accepts only the matching proof and mutation digest. The API canonicalizes extension IDs, checks the current catalog, and keeps signed Cloud controls outside local mutation. This prevents the UI from inventing policy meaning or applying a stale draft.
The daemon keeps its request budget longer than the resident work that a preview or apply can perform. This prevents a client timeout from reporting failure while the daemon continues a mutation. After apply, the daemon refreshes the runtime snapshot and emits bounded change data. A retry with the same proof and mutation returns the saved result, while a different mutation with that proof is rejected. This makes a completed action safe to repeat without creating a second revision.
For signed bundle integrity and Cloud synchronization, read Policy bundles, integrity, and sync. For ecosystem discovery and runtime adapters, read Ecosystem detection and adapters.
References: src/…/extension_control_api.py• L179-223 src/…/extension_control_api.py• L461-553 src/…/extension_control_api.py• L561-663 src/…/extension_control_projection.py• L45-127 src/…/extension_control_semantic_preview.py• L178-234 src/…/extension_control_timeouts.py• L40-60 dashboard/…/extensions-overview.tsx• L255-292 dashboard/…/extensions-overview.tsx• L338-487
Command-line control surface
The command-line control surface gives an operator a stable path to inspect and change extension controls. It uses the daemon for catalog, status, preview, and apply work, while enrollment and authority recovery use the local store and approval gate because they change the trust boundary itself.
The surface keeps inspection separate from mutation. Operators can list the catalog, inspect one extension, search permission patterns, view effective state, preview a change, and then apply a proof-bound mutation. A recommended permission state removes the local override so the permission follows Guard defaults and organization policy again.
Authority enrollment is allowed only for a new authority and binds the built-in catalog digest to the enrolled state. Recovery and degraded-state acknowledgement require fresh approval as appropriate. Errors preserve the distinction between an unavailable daemon, a blocked approval, an unverifiable native state, and an invalid request so the operator receives a safe recovery path instead of a misleading success.
References: src/…/extension_controls_commands.py• L36-46 src/…/extension_controls_commands.py• L48-100 src/…/extension_controls_commands.py• L108-140 src/…/extension_controls_commands.py• L167-232 src/…/extension_controls_commands.py• L315-416
Change checklist
When these files or sections are changed, remember to consider these:
- Update the catalog digest contract and every policy or delivery validator that compares it when target identity or permission metadata changes.
- Keep runtime capability order aligned with policy parsing requirements so a newly gated field cannot activate before its prerequisite capability is advertised.
- When a control target contract changes, update catalog migration fingerprints and confirm that enabled controls retire while disabled controls remain restrictive.
- Treat missing prior fingerprints differently for local and managed controls: local unknown history can preserve an allow, but a managed allow must wait for Cloud refresh.
- Keep unknown managed targets visible to the runtime projection so catalog removal produces a fail-closed error rather than a silent deletion.
- Keep activation acknowledgement fields aligned with the authenticated activation projection and the delivery-bound acknowledgement contract.
- Preserve the distinction between Guard-owned controls and delegated Package Firewall targets across catalog projection, policy parsing, and enforcement capability checks.
- If authority revision or effective projection data changes, update runtime session posture, delivery correlation, public status, and telemetry projections together.
- If a continuity identity or context rule changes, review device binding, local override preservation, tombstone handling, and cleanup preconditions as one contract.
- Keep passive secret reads prompt-free while preserving explicit migration of legacy authority secrets into the local vault.
- When a direct command extension changes, update its built-in catalog registration and confirm that its catalog contract and migration fingerprint change together.
- When native evidence fields or binding identities change, update the native validator, catalog projection, and legacy interaction adapter together.
- When command-domain rules or safe variants change, review the generated public operation rows and the catalog manifest as one contract.
- When Desktop packaging or runtime launch paths change, keep generated Pi extensions bound to a durable current runtime rather than a versioned or temporary executable.
- When CLI control commands change, keep daemon-backed inspection, proof-bound mutation, enrollment, recovery, approval prompts, and exit semantics aligned with the authority contract.
- When the daemon event payload changes, keep hashed actor and target references bounded and keep semantic before and after states aligned with the preview shown by the control center.
- When policy-panel state rules change, keep organization blocks, immutable controls, protected-health locks, stale-draft rebase choices, and approval review behavior aligned with daemon authority checks.
- When catalog migration telemetry changes, keep writer provenance distinct from read-time backfill and emit regression data only for an attributable move to an older catalog writer.
- When the authority schema changes, preserve forward-only compatibility checks and keep pack activation records behind the pack schema gate.
- When transition recovery changes, preserve the retry grace period, proof idempotency, anchor checks, and the distinction between stale prepared work and an anchored or committed inconsistency.
- When catalog handshake or paging changes, keep resident-owned digest, upload, acknowledgement, and lease behavior aligned across the complete and legacy catalog views. If native view reuse changes, preserve observation binding, page verification, and cache repair behavior.
- When preparation failure classification changes, keep the public recovery action path separate from path-free daemon diagnostics.
- When preview or apply work changes, update the client timeout budget so it still covers the resident calls and commit rounds that can run in sequence.
- When the effective projection or review hints change, keep bounded reason codes and catalog-bound identifiers separate from private matcher evidence.
- When runtime snapshot handling changes, preserve the fixed no-control approval binding and the revision and catalog floors that prevent stale protected projections from replacing newer ones.
- When native policy application changes, keep the allow-listed payload keys, remote-only decision sources, observed-state checks, and one-transaction rollback contract aligned with the Cloud activation caller.
- When private authority files or command markers change, keep their names, schemas, signatures, size limits, private paths, and read-back behavior aligned with every native reader.
- When native authenticated record handling changes, preserve canonical encoding, purpose and schema checks, digest and MAC verification, and the distinction between tampered records and degraded storage.
- When stored authority columns change, keep row type conversion and anchor phase parsing aligned with the Python store contract and every native authority reader.
- When native schema markers change, preserve forward-only upgrades, exact trigger contracts, and refusal of unknown or forged versions.
- When migration or recovery events change, keep event creation tied to the committed revision and prevent read-time backfill from creating duplicate or false regression events.
- When resident request methods change, keep cross-install fallback limited to allow-listed isolated reads. Keep writes and reads with their own commit behavior on the resident that owns the store.
- When resident ownership, lease, or startup handling changes, preserve one home owner, bounded liveness checks, runtime identity validation, and the caller's deadline across handoff and restart.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Signed policy catalog digest differs from the local registry | The policy is rejected or the authority enters fail-safe lockdown. | Require the exact catalog digest in policy layers and runtime posture. |
| Cloud returns an expired, revoked, future, or older policy | The candidate cannot replace the active managed floor. | Validate time bounds, status, and monotonic revision before activation. |
| Cloud delivery names another device, workspace, session, or projection | The delivery is rejected and no exact managed acknowledgement is produced. | Compare all signed bundle, runtime, catalog, authority, and projection identities. |
| A managed activation is partial or has a bad authentication record | Managed state is unavailable instead of partly applied. | Require complete activation state and verify its authenticated projection. |
| Native evidence names another command, catalog, program, control revision, or effective projection | The observation cannot affect command interaction or authorization. | Validate all evidence bindings before projecting native observations. |
| A managed target has no matching prior catalog fingerprint | That known target is disabled until Cloud refreshes the policy. | Require an authenticated prior manifest match for managed allows. |
| A managed target is absent from the current catalog | Resolution reports an unknown target and blocks the request. | Keep the target visible so the runtime can fail closed. |
| Authority snapshot, anchor, or transition chain is changed or missing | Normal evaluation uses lockdown or recovery-required state. | Verify the chain and external anchor; archive and rebuild only through authenticated recovery. |
| An authority record has the wrong schema, purpose, canonical form, digest, or authentication tag | The record is treated as tampered and cannot become active authority. | Authenticate the framed canonical record with its fixed schema and purpose before use. |
| A stored authority column has an invalid type or an unknown anchor phase | The native read degrades or treats the state as invalid instead of guessing its meaning. | Use strict row conversion and accept only prepared, anchored, or committed phases. |
| A catalog upgrade removes a target or changes an enabled target contract | The old enabled control is retired, which can change effective policy. | Record catalog manifests and migration provenance before rebinding controls. |
| A shared Guard home migrates to an older catalog writer | Retired targets can lose protection and the event records a regression. | Compare attributed writer versions and emit a separate regression record with retired targets. |
| A catalog migration event is backfilled during a read | The revision is described without inventing the reader as its catalog writer. | Mark backfills as non-writer events and defer regression comparison until an attributed migration. |
| A reused native catalog view has damaged or mismatched pages | The cached view is not used and the catalog is prepared again. | Bind reuse to the full observation, verify the cached pages, and repair the cache on the next preparation. |
| A legacy catalog read competes with an in-flight page transfer | The read can consume transfer capacity or fail to obtain a transfer lease. | Read the legacy projection under the native cache lock without taking a transfer lease. |
| A delegated target lacks Package Firewall support | Policy semantics fail validation rather than claiming local protection. | Negotiate and check the delegated enforcement capability. |
| Continuity observation expires or binds to another device or identity | The item becomes stale, pending, or changed instead of changing a local grant. | Enforce signed expiry and hashed workspace/device and identity bindings. |
| Credential storage is unavailable | Managed enforcement cannot be trusted and commit is blocked. | Use the degraded authority state and require explicit recovery or acknowledgement. |
| A generated Pi extension points to a temporary Desktop or AppImage runtime | Hooks can outlive the owning process or start a stale second Guard daemon after an update. | Resolve a durable current launcher and reject transient mount paths. |
| An Ollama publication or removal command has unknown options or missing model operands | The action remains a review target instead of being silently treated as unrelated input. | Keep fail-secure option matching and extension-level review for push and rm. |
| A DNS command uses an unknown option or an unrecognized command path | The action is not treated as a safe or unrelated operation. | Keep unknown-option rejection and explicit command-domain matchers. |
| An operator applies a stale or incomplete CLI mutation | The request is rejected without changing authority state. | Rebuild the payload from current effective state and require the matching preview proof and mutation digest. |
| A review draft becomes stale while the operator edits it | Review or apply is blocked until the operator rebases or uses current protection. | Bind the draft to revision, catalog digest, health, and lockdown state, then expose explicit conflict choices. |
| Organization policy blocks a permission that the panel draft tries to allow | The Allow choice is unavailable and the local mutation cannot weaken the managed block. | Derive control choices from managed state and reject signed Cloud layer changes in the daemon. |
| An operator retries a completed apply with the same proof | The saved result is returned without creating another revision. | Key applied mutation results by proof and compare the canonical mutation digest. |
| Enrollment or recovery lacks the required approval or fresh authentication | The authority boundary remains unchanged. | Require the approval gate and use fresh proof for enrollment, recovery, or protected mutations. |
| The authority schema marker is unsupported or invalid | Trusted authority reads stop instead of treating unknown state as valid. | Accept only recognized version and checksum pairs and gate pack records behind the pack schema. |
| A prepared transition is stale while its anchor still names the committed revision | The unfinished request is removed without applying its controls. | Authenticate the prepared row, wait through the retry grace period, and remove only unanchored stale work. |
| A transition is anchored or committed but its chain cannot be verified | Normal authority use enters recovery rather than guessing which state took effect. | Keep the rows for explicit authenticated recovery and archive unverifiable state before reset. |
| A prepared activation candidate expires or its managed layer changes | The proof cannot apply the candidate and no stale pack is activated. | Use short leases and compare the candidate's managed revision and layers at apply time. |
| Catalog resident negotiation or acknowledgement cannot be verified | The session downgrades and does not claim a catalog upload or managed capability. | Require resident-owned handshake and digest-bound acknowledgement. |
| An older resident does not know a store method needed by a newer client | Safe isolated reads can fall back to the newer runtime, but writes and unsafe reads remain unavailable until the resident updates. | Match the exact unknown-method response and allow only the explicit isolated-read set in a rollback-only transaction. |
| A shared home has a live resident from another runtime or an unverified lease state | The client does not start a competing resident and may report a bounded owner or startup failure. | Use the home-wide owner lock, process start identity, private leases, and bounded liveness scans. |
Key files
| File | Why to read it |
|---|---|
| src/…/managed_controls_policy_bundle.py | Defines authenticated managed activation, projection identity, and revision state. |
| src/…/managed_extension_controls.py | Explains signed Cloud validity, last-known-good retention, revocation, rollback, and audit output. |
| src/…/managed_controls_policy_fields.py | Defines policy modes, extension and permission targets, and delegated protection semantics. |
| src/…/extension_catalog_sync.py | Defines the privacy-safe catalog wire contract and digest used across services. |
| src/…/extension_catalog_handshake.py | Defines resident-owned catalog negotiation, upload need, and acknowledgement handling. |
| src/…/extension_catalog_pages.py | Defines the native-backed prepared catalog view, page and lease boundary, cache reuse, and legacy projection. |
| src/…/command_extensions.py | Defines the generated catalog boundary and the source and delegation labels used by controls. |
| src/…/extension_contribution.py | Defines contribution validation and the trust boundary for catalog intake. |
| src/…/extension_trust.py | Defines authored trust bindings, packaged trust projection, and inert external extension handling. |
| src/…/command_builtin_extension_catalog.py | Shows how direct command domains become part of the built-in control catalog. |
| src/…/command_dns_extensions.py | Shows the cloud DNS command domains and their fail-secure review targets. |
| src/…/extension_control_runtime.py | Shows immutable runtime snapshots, revision and catalog floors, recovery replacement, and the fixed no-control binding. |
| src/…/extension_control_projection.py | Defines the effective extension and permission state shown to clients. |
| src/…/extension_evidence.py | Defines stable extension and rule evidence identities used across decision surfaces. |
| src/…/native_command_extension_evidence.py | Defines the binding and privacy boundary for native matcher evidence. |
| src/…/store_extension_control_authority.py | Coordinates durable authority reads, recovery, and the catalog, commit, and managed-state mixins. |
| src/…/store_extension_control_authority_catalog.py | Defines trusted catalog manifests and authenticated migration of retained controls. |
| src/…/store_extension_control_authority_catalog_events.py | Defines catalog migration provenance and regression events for cross-install drift. |
| src/…/store_extension_control_authority_commit.py | Defines enrollment and proof-bound crash-safe authority commits. |
| src/…/store_extension_control_authority_reads.py | Defines authenticated authority reads and composition with managed controls. |
| src/…/store_extension_control_authority_schema.py | Defines compatible authority schema markers and the gated pack-activation schema. |
| src/…/store_extension_control_authority_support.py | Defines control preservation rules, private references, secret-store migration, and validation boundaries. |
| src/…/store_extension_control_authority_transitions.py | Defines transition-chain checks, retry-safe recovery, and privacy-safe authority history. |
| src/…/store_extension_control_manifest.py | Defines the contract fingerprints used to detect catalog drift. |
| src/…/custom_extension_continuity_v2.py | Describes device-bound continuity, drift states, and local override protection. |
| src/…/policy_bundle_delivery.py | Defines exact device and runtime binding for managed policy delivery. |
| src/…/extension_control_events.py | Defines the privacy-safe authority-change telemetry shape. |
| src/…/extension_control_api.py | Entry point for catalog, preview, test, mutation, history, and recovery operations in the operator control center. |
| src/…/extension_control_semantic_preview.py | Defines the effective impact and warning view for proposed local changes. |
| src/…/extension_control_prepared.py | Defines short-lived prepared activation candidates used by proof-bound changes. |
| src/…/extension_control_preparation_failure.py | Defines safe cause and recovery reporting for preparation failures. |
| src/…/extension_control_timeouts.py | Defines client budgets that cover resident and durable apply work. |
| rust/…/managed_resident.rs | Defines resident ownership, supervision, liveness, and clean handoff across Guard clients. |
| rust/…/managed_resident_client_request.rs | Defines resident discovery, foreign-runtime replacement, startup deadlines, and request fallback. |
| rust/…/managed_resident_lease.rs | Defines bounded private client leases and the liveness contract that keeps a resident available. |
| rust/…/managed_resident_store_fallback.rs | Defines safe cross-install answers for store reads that an older resident does not know. |
| rust/…/mod.rs | Routes native authority reads and writes and defines the protected, degraded, tampered, and recovery states. |
| rust/…/records.rs | Defines authenticated authority record forms, stored-row conversion, private references, and transition anchor phases. |
| rust/…/policy_apply.rs | Applies accepted remote policy state only when its authority and sync observations are still current. |
| rust/…/policy_clear.rs | Retires managed policy and advances its publication revision without accepting a stale clear. |
| rust/…/review_memory.rs | Publishes bounded remote review memory while preserving local decisions. |
| rust/…/commit.rs | Creates proof-bound authority transitions and sealed catalog manifests. |
| rust/…/resume.rs | Finishes anchored transitions, writes the external anchor, and queues idempotent change events. |
| rust/…/migrate.rs | Commits catalog migrations and their provenance and regression events. |
| rust/…/migration_event.rs | Backfills one verified migration event from the committed authority head. |
| rust/…/reset.rs | Archives damaged authority state before a fresh protected enrollment. |
| rust/…/schema.rs | Enforces forward-only schema markers and the epoch contract used by authority readers. |
| rust/…/private_state.rs | Publishes bounded native authority records as private files with read-back checks. |
| rust/…/command_marker.rs | Signs and publishes the native command-control authority marker. |
| rust/…/change_event.rs | Queues the change event from a verified committed transition during recovery. |