Introducing a new way to review your PRs.

Read the announcement

hashgraph-online / hol-guard

Open-source antivirus and firewall for AI agents: block risky tools, secret access, prompt injection, malicious packages, MCP servers, plugins, and skills at runtime.

View on GitHub

44 documents · Updated Nov 23, 2026

docs / guard-decision-and-enforcement

Guard decision and enforcement

HOL Guard evaluates an agent action against its capabilities, risk evidence, policy, approval state, and available execution assurance. It produces one authoritative outcome that enforcement boundaries can apply as an allow, advisory warning, approval request, sandbox requirement, or block.

Decision model

Action authority

The canonical Guard action is the single source for launch permission, user-facing text, stored receipts, and compatibility fields. Native decision authority validates this action before the runtime projects it into product and enforcement views. Actions form a least-to-most restrictive order: allow, warn, review, require-reapproval, sandbox-required, and block; a stronger requirement cannot be hidden by a weaker projection.

require-reapproval means that an earlier grant no longer covers the changed action. sandbox-required needs an enforceable isolation boundary. It is not the same as an ordinary approval pause. Product clients project approval-gated actions as ask, while warn remains advisory.

References: src/…/action_lattice.py• L1-15 src/…/action_lattice.py• L32-39 src/…/decisions.py• L16-40 rust/…/native_command_controls_floor.rs• L27-60

Evaluation evidence

Guard builds a decision from evidence about the action and its history. A typed action envelope gives each supported harness the same view of the event while keeping private command, path, prompt, and payload data redacted before it enters approvals, receipts, or later checks. The resident runtime creates this envelope, and the native layer projects validated fields without reinterpreting the event.

The envelope gives the action a stable identity. It records the harness and event context with the action type, redacted targets, network hosts, provider identity, and package intent when Guard can establish them. Native command evaluation adds bounded observations and redacted matcher evidence. It records evaluation errors and uncertainty instead of treating an empty observation set as proof of safety.

The main evidence classes are:

  • Capabilities: Network hosts and schemes, file paths, secret classes, interpreters, shell use, subprocess use, publisher, and transport.
  • Capability changes: New hosts, expanded secret or file scope, publisher or transport changes, added subprocess use, and changed approval surfaces.
  • Risk signals: Network, secret, execution, policy, prompt, provenance, and inspection signals with severity, confidence, explanation, and remediation.
  • Policy context: Configured action, default action, remembered approval, trusted request override, and runtime detector result.
  • Execution assurance: Enforced guarantees and the isolation boundary available for the action.
  • Runtime identity: A stable action identity, harness attribution, workspace context, normalized command details, target paths, and network hosts.

For cloud actions, a reviewed provider pack derives bounded facts from checked arguments. An action that no pack describes receives only a class proposal from its name or input schema. That proposal can tighten the result but cannot admit the call. Unknown facts stay unknown so missing context cannot lower policy.

The scanner recommendation is evidence in the composition trace. It is not, by itself, launch authority. Guard-owned verified reads add a separate proof of the workspace, target, parser, expected effect, and bounded output before a read can receive a silent verified result.

References: src/…/actions.py• L55-119 src/…/actions.py• L121-197 src/…/actions.py• L311-374 rust/…/cloud_action_classifier.rs• L1-23 rust/…/cloud_action_v2_unclassified.rs• L17-50 rust/…/cloud_pack_facts.rs• L1-9 rust/…/native_command_program_observations.rs• L11-32 src/…/capabilities.py• L63-86 src/…/risk.py• L79-248 src/…/verified_read_execution.py• L64-88

Policy composition

Policy inputs

Policy composition starts with the action selected by configuration or the applicable default. Guard then considers risk evidence, saved approval, and the protection capability of the target harness. This separates a recommendation about risk from the policy choice that controls whether the action may run.

For command actions, the resident uses a packaged command program and the authenticated control snapshot that is active for the request. The program matches bounded command shapes and reports the owning extension, permission, safe variant, or uncertainty. A control disable or global lockdown is a floor that a user approval cannot clear.

Command policy can use one portable expression shape over normalized command text. The same runtime dialect applies when a command rule is authored and when it is enforced, so a supported match form does not change meaning between those stages. Cloud rules can also target a named command risk group, but such rules only ask or block; they cannot create an allow.

Policy rules can come from local decisions or a validated policy bundle. A bundle becomes local authority only when its scope can be represented without broadening the grant. For the newer canonical bundle path, Guard compares canonical decisions with the legacy shadow before activation. Unsupported or ambiguous constraints do not become wider authority.

Guard Cloud can also provide a workspace-bound network protection bundle. Guard verifies its signature, workspace, freshness, version, and trusted key before saving it; an unverified bundle never becomes network enforcement input.

Package requests add a supply-chain policy path. Guard identifies package intent, compares local and cached intelligence with the applicable policy, and uses trusted Cloud evaluation when needed. Cloud failure does not silently become allow. A Cloudflare challenge or block is reported as a network failure rather than an expired sign-in. The configured fail-closed posture decides whether another Cloud failure blocks or routes the request to review. See Evaluation and assurance workflows for policy and assurance evidence.

Supply-chain evaluation can request bounded egress from the caller. The caller applies the active managed network policy to each destination and redirect hop, then returns bounded response or refusal evidence for the resident to parse. The caller does not make the action decision.

References: rust/…/native_command_controls.rs• L43-181 rust/…/native_command_controls_floor.rs• L27-110 rust/…/policy_document_risk_groups.rs• L10-53 src/…/policy_bundle_decisions.py• L374-432 src/…/network_protection_bundle.py• L129-209 src/…/supply_chain_package_eval.py• L526-724 rust/…/egress_caller.rs• L224-347

Cloud action packs

A cloud action pack is reviewed data that describes a provider action without giving the pack authority to decide policy. It bounds the provider hosts, sign-in scope, connection identity, arguments, request shape, derived facts, response fields, and safety limits. The host renders and sends the request; the pack engine only validates, renders, extracts, and projects bounded data.

Version 2 policy combines the declared effect with the effect implied by the action class. It then joins ordinary rules with fact rules. A rule that depends on an unknown fact can only preserve or raise the result. Required obligations such as a count readback, a preview, result redaction, or untrusted-result labeling become a block when the caller cannot perform them. Saved consent can answer a review, but it cannot lower a block or a stronger execution requirement.

Calls without an admitted pack use a class-only fact set. The name and schema classifier always tightens toward the strictest class it sees, and destructive-looking names use the pack's stricter unclassified action. Richer facts supplied for an unclassified call are refused because they could create authority that the classifier did not prove.

Pack changes are compared as widening or narrowing changes. New hosts, scopes, actions, tenant bindings, capabilities, response data, or weaker safety limits require review. Generated packs are drafts until validation and fixtures prove both safe and risky behavior. Simulation uses stored facts rather than private call payloads, so operators can preview policy changes without replaying provider actions.

References: rust/…/cloud_pack.rs• L1-13 rust/…/cloud_pack.rs• L34-58 rust/…/cloud_action_v2.rs• L262-338 rust/…/cloud_action_v2.rs• L340-485 rust/…/cloud_action_v2_unclassified.rs• L25-50 rust/…/cloud_policy_pack.rs• L71-76 rust/…/cloud_pack_validate.rs• L1-9 rust/…/cloud_pack_diff.rs• L1-9 rust/…/cloud_pack_simulate.rs• L1-13

Cloud request and response boundaries

Cloud pack request handling keeps caller input inside the provider action that policy reviewed. Arguments must pass declared bounds. Connection values come from the verified connection rather than the caller, so a caller cannot select another tenant. Declared broker transport can route a request, but it grants no permission and changes no decision.

Response handling is also narrow. Guard accepts only bounded response data and copies only allowlisted fields. It labels untrusted and sensitive fields so the host can wrap or redact them before the result reaches the agent.

References: rust/…/cloud_pack_connection.rs• L1-13 rust/…/cloud_pack_connection.rs• L137-185 rust/…/cloud_pack_request.rs• L1-8 rust/…/cloud_pack_request.rs• L154-187 rust/…/cloud_pack_transport.rs• L1-7 rust/…/cloud_pack_response.rs• L1-9 rust/…/cloud_pack_response.rs• L31-45

Cloud policy authority

Cloud action evaluation is exposed through a local request stream. The stream loads a bounded binding set and optional activation key before it answers requests, then returns one result for each valid input line. Bad startup input stops the service before it can answer with untrusted authority.

Cloud catalog completion is a separate readiness proof. A pending challenge is short-lived, authenticated, single-use, and bound to the current observation, catalog digest, credential binding, and device or workspace identity. Only a matching server receipt becomes durable completion evidence. Metadata or a cache path alone cannot create that authority.

References: rust/…/cloud_action_serve.rs• L11-81 rust/…/cloud_action_serve.rs• L84-107 rust/…/cloud_catalog_completion.rs• L13-57 rust/…/cloud_catalog_completion.rs• L155-214

Signal composition

The resident runtime composes risk signals and effect factors into the action floor. High-confidence bypass or critical signals can force a block. High or critical persistence signals can require review. Strong false-positive evidence can lower a block to review or a review to a warning only when the remaining risk is low and no protected category prevents the change.

Native command review and host policy resolution remain separate stages. An authenticated permission or workflow proof can authorize a review-class command, but it cannot relax a native hard block. The resident owns the effect lattice, uncertainty rules, extension-control resolution, and local read, write, Git, and workflow floors. Python sends one bound request and projects the result; it does not recompute or fall back to weaker local semantics when the resident cannot answer.

Ordinary shell structures that remain bounded may reach review. Loops, conditionals, heredocs, and bounded redirects are now treated as uncertain evidence when Guard can identify their possible effects. Wrappers, hidden program execution, unsupported expansion, path steering, and unknown owners remain evaluation failures or blocks. A deadline is distinct from an unmodelled command: a transient timeout can require review, while an authority or control failure remains blocked.

Guard also treats instruction-bearing output as risk evidence. Remote pages, MCP results, and subagent reports can carry prompt injection or endpoint-lure signals. Local writes that contain live-looking credentials, planted instructions, or install scripts can move an otherwise allowed write to review. These signals do not grant authority and cannot hide a stronger action floor.

Explicit require-reapproval and sandbox-required requirements are not lowered by this calibration. The final action and its reason remain bound to the signal set so later boundaries can check that the outcome still derives from its evidence.

References: rust/…/native_command_controls.rs• L223-279 rust/…/native_command_controls_floor.rs• L63-110 rust/…/native_command_unmodeled.rs• L1-33 rust/…/native_command_source_evaluation_batch.rs• L50-149 rust/…/output_injection.rs• L1-18 rust/…/output_endpoint_lure.rs• L1-9 rust/…/generic_content_reviews.rs• L61-130 rust/…/literal_secrets.rs• L1-13

Package request identity

Package policy binds reuse to the package request and the execution context that can affect what the package manager runs. The context covers the repository identity, workspace placement, manager executable, manifest and lockfile inputs, registry and workspace settings, lifecycle hooks, and relevant environment values.

The context can be portable across checkouts of the same repository when those inputs match. A changed lockfile, install hook, manager binary, active configuration, or executable behavior makes the request non-portable and requires a new decision. A script-free install can omit lifecycle execution from the bound context only when the manager arguments prove that scripts are disabled.

References: rust/…/package_context_build.rs• L122-127 rust/…/package_context_build.rs• L151-316 rust/…/package_execution_context.rs• L18-70 rust/…/lifecycle_scripts_flag.rs• L1-35

Assurance composition

Execution assurance defines what must be true at the point of action. An assurance requirement names needed guarantees such as filesystem, secret, network, process, privilege, identity, output, cleanup, or tenant control. A guarantee satisfies a requirement only when it is enforced at the required boundary or a stronger one.

When the plan lacks a required guarantee, assurance raises the action floor to warn, review, or sandbox-required according to the required boundary. When the plan satisfies the requirement, Guard records a proof bound to the plan. Assurance never lowers an existing block or review requirement and does not create a second approval system. See Contained execution and runtime boundaries.

References: src/…/assurance_planning.py• L36-122 src/…/execution_assurance_contract.py• L138-192 src/…/execution_assurance_contract.py• L364-395

Approval authority

An approval affects the final action only when it matches the current action context. Guard binds reuse to the action, artifact or family, workspace, harness, publisher, or global scope that the request can safely support. A changed capability set or changed action identity can therefore move an action back to require-reapproval.

Saved approval is evidence for an exact, previously reviewed request. It is not a policy input that can lower a newly computed sandbox-required or block action. A fresh local approval or a separately verified durable exact-action approval can satisfy the require-reapproval request that it covers.

Approval reuse is decided by resident authority. An unavailable resident preserves the current evaluation and claims no saved approval. A malformed resident answer is an authority failure, not a no-decision result, so it cannot grant reuse. Package approvals also re-read and retry a claim when a sibling approval moves the authority revision. A moving revision has a bounded retry budget; a failed lookup or claim leaves the current review in place. See Approval gates and scope resolution.

Agents cannot approve or weaken Guard approval state from a protected shell. Guard identifies direct CLI mutations, wrapped invocations, and local approval routes as a separate protected action that must be resolved in the local approval center or native harness prompt.

References: src/…/approval_reuse.py• L1-21 src/…/approval_reuse.py• L141-215 src/…/approval_scope_support.py• L113-169 rust/…/sfrs_self_approval.rs• L18-71 rust/…/sfrs_self_approval_route.rs• L33-62

Provider action policy

Provider action policy controls opaque actions exposed through an MCP provider. Guard first classifies the provider schema as bounded advisory evidence. It then applies a separate identity-bound choice for the observed provider action, so a broad wrapper approval cannot silently authorize an unknown operation.

Unknown or incomplete schemas remain uncertain. Provider annotations can add warnings but cannot create an allow decision. Unresolved actions require review. A denied member blocks an opaque batch, so Guard does not execute only the permitted subset of an unclear call.

Observed MCP names create connector suggestions without executing tools or inventing a server endpoint. Their catalog is incomplete, so unseen tools keep their normal review. Contributed external servers use opt-in activation, and remote contributions cannot declare allow defaults.

References: src/…/mcp_classification.py• L1-79 src/…/mcp_provider_permissions.py• L1-83 src/…/mcp_protection.py• L13-97 src/…/mcp_tool_calls.py• L599-659

Managed extension authority

Managed extension authority controls which command and provider capabilities are active on a device. Guard keeps the catalog, trust class, local control layers, and Cloud continuity state separate from the action decision. Their effective result becomes policy input at the matching identity.

Trust classes distinguish first-party, trusted-library, and external extensions. External MCP contributions remain opt-in. The resident owns catalog projection, negotiation, page production, digest calculation, and acknowledgement checks; a catalog upload or public host summary never becomes permission, account, or schema authority by itself.

The runtime carries an immutable snapshot of effective controls. Protected revisions move forward, a digest cannot be replaced at the same revision, and an unread or unanswered authority cannot grant controls. Recovery installs a newly authenticated protected view instead of retaining a poisoned revision floor. Queue-time allow hints and coverage hints are advisory: they explain which permissions might settle a review or which extension matched each command step, but they do not change controls or authorize unseen steps.

References: rust/…/native_command_controls.rs• L43-181 src/…/extension_control_runtime.py• L95-142 src/…/extension_control_runtime.py• L175-227 src/…/custom_extension_continuity.py• L56-85 src/…/extension_allow_hint.py• L1-9

Authoritative decision

Decision projection

The authoritative decision is the result from which display, storage, receipts, and launch fields derive. It contains the final action, source, reason, composition trace, typed signals, enforcement state, and product-facing DecisionV2 view. Native authority validates these projections as one decision. The runtime keeps the object immutable and separate from the launch permit.

The stable enforcement effects are:

Action classUser resultLaunch effect
allowSilent approvalLaunch is permitted only when authority is finalized.
warnAdvisory warningLaunch can continue when authority is finalized.
review or require-reapprovalApproval promptLaunch pauses until the needed approval is present.
sandbox-requiredSandboxed reviewThe normal launch path is not permitted.
blockPolicy blockLaunch is forbidden.

For Cloud action evaluation, dispatch_permitted is true only for allow or warn. The result also carries review eligibility, missing capabilities or obligations, consent scope, action identity, input digests, and evaluation provenance so a later boundary can reject a stale or incomplete result.

The same finalized launch condition controls whether Guard may create a trusted snapshot. A decision that blocks or lacks finalized authority cannot silently create one.

References: src/…/decisions.py• L29-62 src/…/decisions.py• L69-120 src/…/decisions.py• L142-163 rust/…/cloud_action_v2.rs• L456-496 src/…/models.py• L9-20

Boundary consistency

Guard checks action-bearing projections before they cross a persistence, API, or launch boundary. The policy action, product decision, action envelope, composition trace, and authoritative decision must agree. Unknown action fields and conflicting aliases are treated as possible hidden authority rather than ignored.

Approval-surface projections use bounded batches. If a request is too large, Guard splits it; if one row remains too large or cannot be read, it replaces the stored decision with an unreadable value so the native projection fails closed rather than hiding the rest of the batch.

If a projection is malformed or contradictory, Guard records an authoritative-decision inconsistency and fails closed. At a launch boundary, a legacy payload without an authoritative decision is not enough to create launch authority. Runtime detector results and extension policy are part of this same check.

References: src/…/decision_boundaries.py• L13-24 src/…/decision_boundaries.py• L37-102 src/…/decisions.py• L64-148 src/…/actions.py• L121-173

Outcome evidence

Guard records evidence that connects a runtime evaluation to its artifact, policy action, capability summary, changed capabilities, provenance, and approval or scanner evidence. A smaller privacy-safe outcome record supports verified local results without carrying sensitive content.

Command activity links a pre-hook intent to a post-hook proof only when the request correlation matches. An unpaired post-hook remains explicitly unpaired and cannot invent facts about an earlier decision. Receipt amendments project native authority evidence onto only the artifacts from the matching evaluation.

Best-effort evidence writes are handed to a bounded durable queue so security decisions do not wait on storage. The queue journals accepted records before store persistence, recovers pending records after restart, deduplicates decision receipts, and marks the writer degraded when records are dropped or permanently refused. Evidence failure does not become action authority.

References: src/…/models.py• L168-195 src/…/outcome_receipt.py• L1-13 src/…/command_activity_contract.py• L24-43 src/…/command_activity_lifecycle.py• L183-258 rust/…/hook_evidence_writer.rs• L39-59 rust/…/hook_evidence_writer.rs• L1027-1175

Enforcement boundaries

Runtime interception

Runtime detectors evaluate the action at the point where the agent is about to act. Guard first normalizes each harness event into a shared, typed action envelope. This gives the detector and the approval path the same action identity, command meaning, target scope, and harness context while keeping display data private.

Guard composes detector evidence separately from the earlier artifact result. A runtime block therefore becomes run authority instead of being hidden by an already reviewable artifact. A detector warning or review is carried into the final artifact decision. Harness attribution supports display and routing; it never selects policy authority.

Before saved approval is claimed, Guard previews the command, environment, working directory, detector context, policy context, and launch identity. It claims approval only when that identity is stable. It then refreshes policy and detection, recomputes the authority signature, and finalizes the launch plan. A changed command, environment, path, detector result, configuration, or identity returns the action to require-reapproval.

The resident models shell directory changes and path identity. Unresolved shell syntax, a changed directory identity, or a workspace or symlink escape cannot produce a stable path-pinned launch. Only the finalized launch plan can reach the harness. For hook, proxy, and shim coverage, see Runtime hooks, proxies, and shims. For command classification, see Native command evaluation and classification.

References: src/…/actions.py• L311-374 rust/…/command_parse_surface.rs• L95-130 rust/…/native_command_controls.rs• L184-260 src/…/runner.py• L902-1055 src/…/guard_run_launch.py• L61-143

Contained execution

Some actions cannot be made safe by approval alone. Guard maps these actions to a required execution profile and then rechecks the original request, the resolved command, and each capability used by the contained process before it starts.

The classifier and execution sink use the same bounded command reading. Transparent prefixes can be removed only when their settings are carried into the run or are proven to be plain data that the selected profile would drop. An inline shell is projected only when it contains one exact command. Unsupported wrappers, hidden program selection, and changed command shape are refused rather than run through an uncontained fallback.

Read-only test, lint, type-check, build, and inline-evaluation paths run only when the required OS boundary is available. Workspace containment withholds network, home credentials, and selected agent or editor paths. It does not contain effects that the sandbox cannot undo, such as losing work, remote changes, or disabling a hook; those remain reviewable.

Worktree creation is a two-stage boundary. Guard proves the checkout creation first, then judges the command again against the new checkout before it runs. If the checks need containment, the sink runs them in the approved checkout with bounded output and no uncontained fallback. See Contained execution and runtime boundaries.

References: rust/…/workspace_contained.rs• L1-6 rust/…/workspace_contained.rs• L86-140 rust/…/contained_wrapper_plan.rs• L13-21 rust/…/contained_wrapper_plan.rs• L79-153 rust/…/contained_inline.rs• L4-43 rust/…/mod.rs• L75-89

Verified local reads

Guard-owned verified reads provide a narrow enforcement path for bounded workspace files. The resident selects the read operation and target, while Guard opens only a canonical repository-relative target and checks its identity before and after the read.

The read returns silently only when its proof binds the workspace, repository, working directory, configuration, shell data flow, parser confidence, expected effect, target, request, and bounded output. Secret paths, symlink traversal, workspace escape, changed files, and an unsatisfied resident decision return no verified result. See Secret-read risk controls.

References: src/…/verified_read_execution.py• L64-88 src/…/verified_read_execution.py• L158-229 src/…/verified_read_execution.py• L232-389

Content and output protection

Guard treats content that can steer a later agent as part of the action's risk. Remote output is checked for instruction overrides, claimed authority, prompt leaks, destructive commands, and requests to send data to another site. A local file write is reviewed when it carries a live-looking credential, a hidden instruction, or an install script that will affect later package installs.

The purpose is to stop data from becoming unreviewed instructions or durable secret exposure. These checks are advisory or review signals unless a stronger policy floor applies. They do not make remote content trusted, and they do not permit a result to bypass the normal action and capability checks.

References: rust/…/output_injection.rs• L55-79 rust/…/output_injection.rs• L163-207 rust/…/output_endpoint_lure.rs• L175-194 rust/…/generic_content_reviews.rs• L61-130 rust/…/literal_secrets.rs• L119-180

Install-time protection

Install-time protection evaluates package installs and harness registrations before they change the local environment. It checks the requested target, cached advisories, remote endpoints, executable harness code, shell wrappers, sensitive local files, environment secrets, and non-registry sources.

An advisory block stops the install. A review verdict returns a non-executing result for user resolution. In observe mode, Guard records the blocking result as observed evidence while allowing the command to continue. Local package execution remains bound to the exact manager, executable, version, manifest, lockfile, and working context when those facts are proven.

References: src/…/protect.py• L115-271 src/…/protect.py• L360-481 rust/…/local_supply_chain.rs• L42-58 rust/…/package_intent_common.rs• L631-807 rust/…/workspace_contained_package.rs• L1-14

Protection health

Protection health reports whether the enforcement system has current proof at the boundary where it must act. It combines hook verification, daemon freshness, policy and containment health, rule-pack state, decision-stream health, and tamper checks into global and per-harness states.

The states distinguish fully protected, partially protected, and degraded operation. Missing proof stays unknown rather than becoming a pass. A stale heartbeat, inactive hook, failed decision stream, or failed tamper check can reduce protection even when policy data still exists.

References: src/…/protection_health_runtime.py• L39-180 src/…/protection_health.py• L29-169

Local approval gate

The local approval gate protects sensitive decision and policy mutations with short-lived proof. It can require a password or an authenticator code, and failed checks can lock the gate.

Changes to authentication factors invalidate active grants. The gate confirms that a person may make the decision. It does not replace action-specific policy and scope checks. Extension authority enrollment and mutations add one-shot proofs bound to the exact authority identity, catalog, revision, and mutation; first enrollment also requires direct local-terminal confirmation.

References: src/…/approval_gate.py• L523-663 src/…/approval_gate.py• L735-829 src/…/extension_control_proof.py• L364-427

Harness protection capability

Each supported harness has a protection capability profile. The profile states whether Guard can pre-block an action, ask inline, use the harness's native remember behavior, or fail open when a hook is unavailable. This lets product surfaces describe the real enforcement strength instead of presenting every harness as equivalent.

The profile is a boundary contract, not a policy override. A harness with no inline prompt can still open Guard for resolution. A harness that fails open on hook failure has limited protection because an unavailable hook may let the action continue.

CapabilityMeaning
can_pre_blockGuard can stop the action before the harness runs it.
can_ask_inlineGuard can use an in-context prompt during the action.
has_native_rememberThe harness can retain an approved choice through its own approval path.
fail_open_on_hook_failureA failed hook can allow the action to continue.
can_pre_block_limitedGuard can stop only the surfaces it can observe.

References: src/…/protection_capabilities.py• L10-74 src/…/contracts.py• L13-47

Approval resolution

Queued requests represent actions that may still be resolved by a user. Guard rejects a resolution when the stored decision is contract-invalid or already terminal. block and sandbox-required need a policy or execution change rather than a simple queue choice.

When a request is resolved, the resolution action becomes the authority for later receipt composition. The old pending envelope remains history and cannot revive a stale approval decision. Read-only diagnostics can inspect approval state, but approval mutation commands remain protected actions.

References: src/…/approval_resolution.py• L10-34 src/…/decision_boundaries.py• L27-102 src/…/native_business_review_queue.py• L24-78 rust/…/guard_diagnostics.rs• L1-13

Decision flow

The flow below shows how an action becomes redacted evidence, how policy and assurance compose into one authoritative decision, and how that decision reaches an enforcement or approval boundary.

flowchart LR
    A[Agent action] --> B[Typed action envelope]
    B --> C[Capability and risk evidence]
    C --> D[Configured and default policy]
    D --> E[Cloud pack facts or native observations]
    E --> F[Saved approval or trusted override]
    F --> G[Runtime detector result]
    G --> H[Assurance requirements and guarantees]
    H --> I[Native action composition]
    I --> J[Authoritative decision]
    J --> K{Enforcement state}
    K -->|allow or warn| L[Launch or continue with advisory]
    K -->|review or re-approval| M[Approval gate and scoped resolution]
    K -->|sandbox required| N[Approved isolation path]
    K -->|block| O[Stop action]
    N --> P[Contained execution proof]
    L --> Q[Command activity proof]
    M --> R[Fresh authority check]

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the action lattice, native effect disposition, product DecisionV2 mapping, Cloud dispatch_permitted mapping, and enforcement flags aligned when adding or changing an action.
  • Keep the native decision authority and the Python DTO projections aligned when changing decision or enforcement fields. A local object must not bypass native validation.
  • Keep all persisted action projections synchronized with the authoritative decision. Check snake-case and camel-case aliases at every boundary.
  • When changing action-envelope fields or redaction rules, keep the stable action identity, capability scope, approval context, receipts, and local display derived from the same meaning.
  • When changing cloud pack schemas, fact extraction, unclassified classification, policy presets, or obligations, preserve bounded inputs, class-only unknown calls, effect floors, missing-obligation blocks, and provenance digests.
  • When changing pack request templates, connection values, broker transports, or response projections, keep tenant identity, declared hosts, argument bounds, credential headers, response limits, and sensitivity labels aligned.
  • When changing the packaged native command program or its control binding, preserve content identity, active extension state, control revision, observation digests, and the distinction between no match and evaluation failure.
  • When changing command parsing, shell structure, environment screens, Git compatibility, or read-only filters, keep command classification, native matcher reading, approval scope, and contained sink reading aligned. Unsupported shapes must not become empty successful evidence.
  • When changing capability identity or risk evidence, update the approval context that determines whether a saved approval is still reusable.
  • When changing assurance guarantees or boundaries, keep the required guarantee set, proof binding, action floor, and execution plan consistent.
  • When changing saved approval reuse, recheck launch identity before and after the claim. Package claims must also handle authority-revision races without replacing a current review with a stale allow.
  • When changing runtime launch planning or shell directory modeling, keep the pre-claim and post-claim authority signatures bound to the same command, environment, detector context, policy context, and path-pinned identity.
  • When changing policy-bundle activation, Cloud action bindings, or network protection bundles, preserve signature checks, workspace binding, freshness, monotonic versions, canonical shadow comparison, bounded input, and last-good fallback behavior.
  • When changing supply-chain egress, keep destination validation, redirect screening, proxy choice, trust roots, archive claims, timeout and response limits, and resident outcome parsing under the same managed policy.
  • When changing extension catalogs or control snapshots, keep catalog digests, authority revisions, negotiated capabilities, upload acknowledgements, trust classes, and runtime bindings consistent. An unanswered resident must not become allow authority.
  • When changing contained execution profiles, keep wrapper peeling, resolved command re-authorization, required profile, workspace root, bounded output roots, toolchain roots, and the actual OS sink consistent. Worktree creation must be rechecked after the checkout exists.
  • When changing verified reads or content-risk screens, keep resident plans, repository-relative opens, target identity checks, content bounds, proof requirements, and the resident final disposition bound to the same request.
  • When changing protection-health checks, keep unknown proof distinct from pass and keep global state aligned with each harness state.
  • When changing outcome receipts or the hook evidence writer, preserve schema validation, correlation pairing, bounded durable replay, receipt deduplication, and the rule that sensitive evidence is represented only by an opaque digest.
  • When changing Guard Cloud error handling or catalog completion, keep edge challenges, expired authorization, pending nonces, credential bindings, server time, and durable receipt state distinct so retry and reconnect guidance stays correct.

Important failure modes

TriggerConsequenceGuard
A stored decision or action envelope has conflicting action fields or an unknown action-bearing field.The decision cannot safely identify its authority.Return authoritative_decision_inconsistent and fail closed.
A stored Cloud action has rich facts but is marked unclassified.Unproven facts could lower or redirect policy.Accept only the class-only fact shape and refuse richer input.
A Cloud fact rule needs an obligation the caller cannot perform.The provider result could omit a required count, preview, redaction, or trust label.Convert the result to block.
A pack request uses an undeclared host, caller-controlled tenant value, or unbounded argument.The call could reach another tenant or provider route.Reject the pack or request before rendering.
A provider response exceeds its limit or contains fields outside the allowlist.The agent could receive unbounded or unreviewed provider data.Refuse oversized responses and project only declared scalar or bounded fields.
Native command controls cannot validate their packaged program, control binding, or observation evidence.A local compatibility path could invent a weaker result.Reject the native result and do not use it as launch or persistence authority.
Native command evaluation is unavailable or rejects its bound evidence.Guard cannot prove that the command is within its active controls.Keep the action blocked; only a distinct transient deadline may route to review when no administrator floor applies.
A stored approval or package context changes after approval.The old approval or proof no longer covers the request.Raise the action to require-reapproval or the required assurance floor.
A saved approval would lower a new sandbox-required or block action.Earlier evidence could weaken current policy.Keep the stronger current action.
The resident approval-reuse authority is unavailable or returns a malformed answer.Guard could claim an approval without a trustworthy reuse decision.Preserve the current evaluation on transport failure; reject malformed output and claim nothing.
A runtime detector produces a terminal block.The action must not reach launch or interactive approval.Preserve the detector block in run and artifact authority.
Required execution guarantees are missing at the requested boundary.The action lacks the promised containment.Raise the floor and require an enforceable sandbox when the boundary needs it.
A command uses a hidden interpreter, unsupported wrapper, path override, or unbounded expansion.The native evaluator cannot bound the program or data flow.Keep the shape uncertain or blocked; do not treat an empty observation set as allow.
A command carries a code-loading, credential, trust-anchor, endpoint, or configuration environment setting.The setting can change what runs, what it trusts, where it connects, or what it presents.Keep the setting in the reviewed command; remove it only through a proof that preserves the same run.
A contained wrapper selects an unsupported command shape or resolves outside the approved workspace.The command could escape the authorized execution profile.Re-authorize the resolved command and reject it when the receipt or path does not match.
A provider schema is incomplete or an unknown provider action is presented as benign.Guard may miss the operation's effect or destination.Keep classification advisory and require review for unresolved provider actions.
A policy bundle, action binding, or network protection bundle is invalid, stale, downgraded, untrusted, or fails canonical shadow comparison.New policy authority could broaden or replace trusted policy without proof.Reject activation and retain only a still-valid signed authority.
The extension authority snapshot is unanswered, unread, tampered, or replaced at the same revision.A stale or unknown control view could grant an extension capability.Mark authority degraded or require recovery; fail closed and reject the replacement.
A shell directory expression is unresolved or its filesystem identity changes.The launch target is not stable or may escape the approved workspace.Refuse a path-pinned launch and return the shell or launch failure.
A verified read reaches a secret, symlink, changed repository, or changed target.Guard cannot prove that the output came from the approved read.Return no silent verified result.
Remote output contains an instruction override, endpoint lure, or hidden request to expose data.Agent output may become an unreviewed action or exfiltration route.Keep the result as risk evidence and require the applicable review or block.
A harness hook fails on a profile that fails open.An action on an unseen surface can continue without Guard enforcement.Expose the harness as limited and do not claim complete protection.
Evidence queue capacity, journal recovery, or store persistence fails.Receipts or activity evidence may be delayed or dropped, and health can degrade.Keep decision authority separate from evidence storage; journal accepted records, bound retries, and report degraded state.

Key files

FileWhy to read it
src/…/models.pyDefines the shared action, policy, artifact, receipt, and approval data model.
src/…/action_lattice.pyDefines the shared order and safe normalization of Guard actions.
rust/…/cloud_action_v2.rsShows how Cloud facts, policy rules, obligations, consent, capabilities, and provenance become one dispatch result.
rust/…/cloud_action_classifier.rsShows how an unknown provider action receives a tighten-only class proposal.
rust/…/cloud_pack.rsDefines the bounded provider action language used for reviewed cloud operations.
rust/…/cloud_pack_validate.rsShows the structural checks that stop a pack from widening hosts, requests, or response data.
rust/…/cloud_pack_request.rsShows how checked arguments become one confined provider request without sending it.
rust/…/cloud_pack_response.rsShows how provider responses become bounded, labelled data for the agent.
rust/…/cloud_policy_pack.rsDefines shipped policy presets and their fact-rule decisions.
rust/…/cloud_pack_simulate.rsShows how stored facts support a policy preview without replaying a provider call.
rust/…/native_command_controls.rsShows how authenticated extension controls and native observations become an action floor.
rust/…/native_command_controls_floor.rsShows how uncertainty, deadlines, authority health, and hard floors shape the result.
rust/…/native_command_program_observations.rsShows how bounded command observations and redacted evidence reach a decision.
rust/…/command_parse_surface.rsDefines the canonical command identity shared by policy, review, and launch.
rust/…/shell_structure.rsDefines the shell structure needed to distinguish bounded scripts from hidden execution.
src/…/decisions.pyDefines the native-validated product and enforcement projections of one authoritative decision.
src/…/runner.pyConnects policy activation, runtime authority, approval reuse, stable runtime state, and Cloud failure classification.
src/…/assurance_planning.pyDefines how execution assurance raises the action floor without auto-approval.
src/…/approval_reuse.pyDefines when resident approval evidence can satisfy the current action without weakening current policy.
rust/…/sfrs_self_approval.rsShows how agent attempts to mutate Guard approval state are identified and protected.
src/…/decision_boundaries.pyKeeps approval-surface projections within native size and consistency limits.
src/…/protection_capabilities.pyDefines the enforcement limits that product surfaces must state for each harness.
rust/…/workspace_contained.rsShows which actions the workspace sandbox can contain and which remain reviewable.
rust/…/generic_content_reviews.rsShows how file content and unsandboxed programs add review floors.
rust/…/output_injection.rsDefines risk signals for instructions hidden in tool output.
rust/…/output_endpoint_lure.rsDefines risk signals for output that redirects data to another site.
src/…/verified_read_execution.pyShows how Guard proves and performs a narrow workspace read.
rust/…/hook_evidence_writer.rsShows how command activity and decision receipts move through durable, bounded evidence storage.
src/…/approval_gate.pyShows the local proof required for sensitive decision and policy changes.