Supply chain and package firewall
HOL Guard protects package use at two points: it assesses what a package command or workspace dependency intends to use, and it can route package-manager activity through a managed firewall before execution. Local checks provide device-level coverage. Guard Cloud adds signed supply-chain intelligence, shared policy, and cross-device status. The dashboard brings these states together so an engineer can review risk, enable coverage, and repair incomplete setup. The resident runtime is the primary authority for package intent, review planning, saved package-policy resolution, and supported package evaluation; Python coordinates transport, archive exchange, and evidence persistence without creating a second verdict. The contained execution and runtime boundaries page covers the execution controls. The runtime hooks, proxies, and shims page covers the execution boundary. The guard decision and enforcement page covers the shared decision model. The policy bundles, integrity, and sync page covers signed policy distribution. The dashboard product workspaces page places the remediation experience in the wider product.
Package and dependency intent
Package intent is the normalized description of a package action. It turns shell requests and workspace files into a request that Guard can compare with policy and supply-chain data without relying only on the original command text.
Request identity
The intent model covers package installation, package execution, and dependency synchronization across supported package managers. It records the package target, ecosystem, requested version or source, related manifests and lockfiles, and evidence for local execution. Guard uses this material to build a stable package-request identity. The identity binds a decision to the package request and its relevant workspace context rather than to a broad command name. Intercepted requests also carry the harness that launched them for attribution. That label affects receipts and user-facing status, not the policy scope used for the decision.
References: src/…/package_intent_common.py• L21-50 src/…/package_intent_common.py• L91-115 src/…/package_intent_common.py• L323-351 src/…/package_protect_projection.py• L14-32
Execution context binding
Package approvals bind to a versioned execution context. The context covers repository and workspace identity, the package-manager executable, dependency files, manager configuration, lifecycle hooks, patches, and relevant environment policy. Guard stores digests and safe labels rather than registry credentials or configuration contents.
The context is portable only when Guard can prove that all material inputs match across linked worktrees. Unsupported managers, global requests, unresolved configuration, or another missing input make the approval local to the current retry. A changed component therefore causes re-review instead of silently reusing an approval from a different package setup.
References: src/…/package_execution_context.py• L61-199 src/…/package_execution_context_configuration.py• L25-105 src/…/package_execution_context_configuration.py• L124-183 src/…/package_execution_context_configuration.py• L288-332
The resident package authority parses package-manager commands found in shell input or tool action envelopes. It models each command segment with its control flow, effective working directory, executable path, source settings, and local runner evidence. Ambiguous shell context is kept as a reason for review instead of being treated as a safe request. Local-only runners such as npx and bunx carry evidence about the manager, executable, manifest, and lockfile used for the run. When the resident parser is unavailable or finds no intent, package protection does not re-parse the command in Python; it returns no package intent rather than creating a competing interpretation. Supported package evaluation also stays in the resident: a missing, mismatched, or malformed resident answer becomes a terminal block rather than a Python fallback allow.
Package review planning is also resident-owned. It accepts only a plain, supported package-manager command and builds the exact artifact that the evaluator will inspect. A leading workspace-local cd is included only when Guard can prove where it lands. A plain npm install may continue only when the resident proves the npm executable; installs and package launches that lack that proof remain eligible for a block-only review. npx and bunx launches are judged by the package they fetch, and launches that name multiple packages remain with human review. An approval key is reusable only when it names the same harness-owned package request and its valid execution context.
When the caller requests a registry retry, the review plan adds that instruction only for an npm install whose execution is proven well enough to allow. Block-only or ambiguous plans do not receive a retry path. The planner can read command text from standard tool fields and from Copilot toolArgs, but it still requires the same plain command shape.
References: rust/…/package_authority_op.rs• L2550-2662 rust/…/package_authority_op.rs• L2881-2970 rust/…/package_review_plan_op.rs• L67-123 rust/…/package_review_plan_op.rs• L221-287 rust/…/package_review_plan_op.rs• L307-360 rust/…/package_approval_key.rs• L15-51
Package-script project memory
Package-script recognition uses live project state instead of only remembered paths. Guard refreshes the working project and remembered package projects while their package.json files exist, then includes valid workspace packages named by those manifests. A saved choice can keep a missing project visible, but an unsaved stale project drops from the available list.
When an operator pastes a package command, Guard uses a valid requested directory first. It otherwise uses the current directory when it is inside a package project, and falls back to the home directory when it is not. Linked workspace paths that resolve outside the project do not become package projects.
References: rust/…/package_script_memory.rs• L1-17 rust/…/package_script_memory.rs• L142-195 rust/…/package_script_memory.rs• L198-240 rust/…/package_script_memory.rs• L321-340
Package scripts keep the generic review route unless Guard can prove that the protected sink will run the same narrow script body. Read-only tool scripts and builds receive a narrower route only when their inputs and output location stay within the accepted boundary. A script that the sink cannot resolve remains an untrusted package script and does not gain a broader allow from its name alone.
References: rust/…/package_script_route.rs• L1-15 rust/…/package_script_route.rs• L128-171 rust/…/package_script_route.rs• L320-327
Workspace dependency inventory
Workspace audit starts with dependency declarations and resolved versions. Guard discovers supported manifests and lockfiles in the workspace, reads dependency names and version ranges, and can merge an SBOM inventory. It skips sensitive environment files and keeps unreadable or incomplete project files visible as audit warnings. A manifest dependency that is not pinned in the current lockfile remains a review item because the requested package is not yet tied to a known resolved version.
References: src/…/local_supply_chain.py• L75-100 src/…/local_supply_chain.py• L1258-1336 src/…/native_workspace_inventory.py
The inventory spans several ecosystems with different coverage levels. npm and PyPI have protected coverage. Cargo, Go modules, Maven or Gradle, Composer, and RubyGems have beta coverage. Homebrew, Docker images, GitHub Actions, system packages, and unsupported managers are monitor-only. A binary Bun lockfile can fall back to manifest-only monitoring when Guard cannot parse it.
References: src/…/supply_chain_support.py• L5-19 src/…/local_supply_chain.py• L92-117
Supply-chain evaluation
Supply-chain evaluation combines the package intent with local evidence, workspace dependency data, and the strongest trusted intelligence available. The result is a decision with reasons that can be enforced at a runtime boundary and explained to the user.
Local risk signals
Local evaluation identifies risky package sources and build behavior even without a Cloud connection. Signals cover install lifecycle commands, remote package execution, Git or HTTP sources, build hooks, lockfile integrity and source drift, remote code piped to a shell, mutable action references, and unsafe image choices. These signals express why a package needs monitoring, warning, review, or a block. Incomplete lockfile parsing becomes an explicit review result instead of an unverified allow.
References: src/…/native_supply_chain_eval.py• L1-9 src/…/native_supply_chain_eval.py• L380-432 src/…/local_supply_chain.py• L593-600
Local Python project detection also separates an on-disk project from a remote source. An explicit local path is inspected even when its directory name looks like a distribution archive. Remote HTTP and Git sources do not become local project evidence.
References: rust/…/local_projects.rs• L118-195 rust/…/local_projects_tests.rs• L19-55
Local checks also inspect package sources that do not fit a normal registry flow. An insecure source is blocked. A Git source or a source archive needs review. External archives are inspected in a separate request so the inspected content can stay bound to the approved source and later execution. Mixed registry and external-source requests are blocked because one decision cannot safely cover both source types. The same separation applies to npm source dependencies.
References: src/…/local_supply_chain.py• L369-408 src/…/local_supply_chain.py• L868-875 src/…/native_supply_chain_eval.py• L190-301 rust/…/source_review.rs• L23-216
Registry metadata can help resolve a requested npm or PyPI range to a candidate release when the request is not already pinned. The lookup is supporting evidence for the evaluation. It does not replace lockfile evidence or turn an unavailable registry response into a trusted resolution.
References: src/…/supply_chain_package_services.py• L293-382
Signed supply-chain intelligence
Guard Cloud supplies a signed bundle of package records, advisories, emergency denies, and package policy rules. Before Guard trusts the bundle, it checks the payload hash, time window, version order, verification-key state, and signature. The resident is the single verifier and reports a compact summary of the parsed bundle, so the caller does not create a second interpretation of the signed response. A present trusted keyring must contain at least one key; the empty-keyring case is not treated as a valid trust boundary. The local device stores the accepted bundle and can evaluate it while offline.
References: src/…/supply_chain_bundle_models.py• L301-347 src/…/supply_chain_bundle_models.py• L417-436 src/…/supply_chain_bundle_runtime.py• L83-110 src/…/supply_chain_bundle_runtime.py• L114-210 rust/…/supply_chain_bundle_verify_op.rs• L43-114
The bundle adds package risk context such as severity, exploit state, malware state, source integrity, reachability, and a recommended fix. Policy rules can override the default package action for a package, ecosystem, version range, harness, or severity level. A high-confidence malware or known-exploited result can block from the cached bundle. Audit findings can also expose advisory aliases so a package finding can be matched to the names used by the signed advisory data.
References: src/…/supply_chain_bundle_models.py• L130-219 src/…/supply_chain_bundle_models.py• L222-279 src/…/supply_chain_bundle_runtime.py• L255-273 src/…/local_supply_chain.py• L725-802
Brokered network evidence
The resident does not open sockets for package evaluation. It describes each needed OAuth, Cloud, registry, or archive exchange to the caller. The caller performs the exchange under managed network policy and returns the response or failure. The resident then parses the supplied result and owns the package decision. External archive needs can also carry bounded offline inspection rules and return a digest, final URL, size, and inspection status so later execution remains tied to the inspected content.
References: rust/…/supply_chain_egress.rs• L1-9 rust/…/supply_chain_egress.rs• L36-64 rust/…/supply_chain_egress.rs• L81-143
Decision resolution
When Guard evaluates a package request, it checks the relevant cached result before it performs a live Cloud evaluation. It reuses a result only when the package intent, workspace identity, feed, policy, scoring version, and bundle version still match. A cached Cloud validation error has a short reuse window and cannot turn a stored allow into permission without a fresh evaluation. The final result carries the decision, enforcement source, entitlement state, cache state, package findings, reason codes, review settlement, and user-facing next step. Supported local requests are evaluated by the resident package authority; Python or another caller supplies managed egress and persists the evidence without creating a second verdict.
Saved package policy reuse is also resident-owned. When the caller's store decision is not trusted but the request includes the policy workspace context needed for recovery, the resident can resolve a matching daemon-backed policy decision. It returns that decision and its authority with the evaluation patch, then tells the caller which saved row must be claimed. This keeps policy lookup, reuse classification, verdict rewrite, and claim selection in one decision model.
The resident also decides how a result settles a pending package review. A valid settlement can allow, block with a message, or provide review guidance. A missing or malformed settlement never weakens a blocked result and otherwise leaves the review open.
When a package process has waited for a Cloud decision, the continuation names the exact request IDs it waited on. The resident can use a matching one-shot Cloud allow for that request during the post-wait re-check, bind it to the resolved package artifact and execution context, and consume it on first use. A later retry that does not name the waited request cannot reuse that allow. A saved block or stronger sandbox requirement remains in force.
References: src/…/native_supply_chain_eval.py• L190-301 src/…/native_supply_chain_eval.py• L304-432 src/…/package_request_evaluation.py• L43-67 src/…/local_supply_chain.py• L604-726 src/…/local_supply_chain.py• L742-875 rust/…/package_policy_resolve_op.rs• L202-415 rust/…/package_policy_resolve_wire.rs• L11-48
Cloud availability failures are kept distinct from package findings. A timeout or expired session stops the request for review when Cloud protection is required, while an explicitly unpaid account can use local intelligence when local policy permits it. An unknown or untrusted entitlement does not grant a fallback allow. An untrusted Cloud endpoint or invalid Cloud response also keeps the request in a review or block state. User-facing copy points to reconnection for authorization failures instead of exposing a stale Cloud review link.
References: src/…/native_supply_chain_eval.py• L207-301 src/…/package_firewall_entitlement.py• L248-359 src/…/local_supply_chain.py• L1349-1383
The decision ladder separates action from telemetry. allow and warn permit execution. ask requires review. block stops the request. monitor records a low-impact observation and does not by itself authorize execution. Unknown or malformed execution actions fail closed.
References: src/…/package_execution_policy.py• L5-15 src/…/native_supply_chain_eval.py• L130-142
The main request flow moves from intent to local or signed intelligence and then to an enforceable result.
flowchart LR
A[Package command or workspace files] --> B[Package intent]
B --> C{Trusted package evidence}
C -->|Local checks| D[Local risk result]
C -->|Accepted bundle| E[Offline package result]
C -->|Cloud session| F[Brokered Cloud result]
D --> G[Guard decision and reasons]
E --> G
F --> G
G --> H[Allow, warn, review, monitor, or block]
H --> I[Runtime enforcement and evidence]
Local trust and firewall entitlement
Local trust answers whether the device can safely rely on local protection and remembered rules. Firewall entitlement answers whether this device is allowed to use Cloud-backed package-firewall operations. These are related boundaries, but one does not replace the other.
Local tool trust
Trusted local tool approval is limited to verified runner identity, exact command shape, safe local paths, and read-only behavior. The profile rejects wrappers, path overrides, sensitive paths, shell chaining, and mutating options. This path supports safe inspection tools. It does not turn a package install or an arbitrary package executable into a trusted action.
References: src/…/trusted_local_tools.py• L21-80 src/…/trusted_local_tools.py• L133-208 src/…/trusted_package_tools.py• L27-40 src/…/trusted_package_tools.py• L43-95
Package requests have a separate local identity boundary. Guard records the package-manager executable, effective path, working directory, manifests, lockfiles, and local executable evidence when a request runs a local package tool. A changed execution context can therefore require a new review instead of reusing an approval from a different local setup. If the resident approval authority is unavailable during this reuse check, Guard leaves the current result unchanged and does not claim the saved approval.
References: src/…/package_intent_common.py• L53-89 src/…/package_intent_parser.py• L489-565 src/…/package_execution_context.py• L225-237 src/…/local_supply_chain.py• L737-861 rust/…/package_approval_key.rs• L15-51
Policy integrity status
The local trust contract reports three related states: runtime protection, remembered rules, and Cloud policies. A protected device enforces local policy. A degraded device exposes the reason and setup path instead of presenting uncertain local trust as protection.
References: src/…/local_trust_contract.py• L19-30 src/…/local_trust_contract.py• L307-359
Trust failures use stable, user-safe reasons such as an unavailable key, unsafe Guard storage, or an unavailable trust backend. Passive checks can time out without blocking the main process. The dashboard can use these reasons to distinguish setup work from a Cloud connection problem.
References: src/…/local_trust_contract.py• L46-90 src/…/local_trust_contract.py• L221-304
Firewall entitlement
The package firewall uses Cloud entitlement to control operations that install, test, audit, synchronize, or otherwise manage active package protection. Entitlement resolution compares the local bundle claim, OAuth claim, and Cloud connection state. It accepts canonical Guard Cloud plan IDs while retaining older paid-tier aliases during rollout. A missing or expired firewall claim on a paid plan means reconnect is required, not that the account is unpaid. Conflicting paid OAuth and bundle records also require reconnection so stale state cannot grant new access or show a false upgrade demand.
References: src/…/package_firewall_entitlement.py• L42-65 src/…/package_firewall_entitlement.py• L248-317
Entitlement input is normalized before action gates use it. A usable canonical plan identity takes precedence over legacy fields. Recognized boolean feature or Cloud gate values can enable or disable firewall access, while malformed values do not create a grant. If no usable plan exists, no entitlement is resolved.
References: rust/…/entitlement_vectors.json• L114-143 rust/…/entitlement_vectors.json• L226-260 rust/…/entitlement_vectors.json• L317-373 rust/…/entitlement_vectors.json• L593-659 rust/…/entitlement_vectors.json• L87-95
Existing local protection remains recoverable when Cloud access needs repair. If installed package shims exist, repair and removal can remain available even when new protection actions are gated. Entitlement resolution can make a bounded refresh attempt when local Cloud proof is stale and a Cloud profile exists. The refresh is throttled so status checks do not create repeated sync work. This lets an operator clean up or restore a local state without treating local recovery as approval for new package activity.
References: src/…/package_firewall_entitlement.py• L300-359 src/…/local_supply_chain.py• L318-374
Firewall action state separates Cloud-gated work from local recovery. Status, connection, and shell access remain available. Installation, testing, auditing, and intelligence sync are available only with a valid entitlement. Repair and removal remain available when a manager is already installed, including while reconnection or paid access is required.
References: src/…/package_firewall_entitlement.py• L320-398
Package-manager coverage
The firewall protects package-manager commands by placing managed shims in the command path. Its status distinguishes detected, installed, active, tested, protected, and unprotected managers. It also reports the shell path, the current process path, shell profile setup, restart needs, and the shim directory. Generated shims must point to a runnable trusted Guard interpreter and pass integrity checks before they count as protected. On frozen runtimes, the wrapper, sidecar, and embedded base command must also bind to the current trusted launcher. Protection is effective only when the active command path reaches the managed shim.
References: src/…/local_supply_chain.py• L1302-1346 src/…/package_shim_frozen.py• L19-119 src/…/package_shim_frozen.py• L148-181 src/…/package_shim_frozen.py• L263-333 src/…/guard-dashboard.js• L18570-18603
If the shim manifest is missing or malformed, status can conservatively recover bounded Guard-generated shim files that still match a supported manager. Recovered managers are surfaced for visibility, but their details mark them stale and path-broken, so they do not count as protected until the normal repair path rewrites and re-attests them. This keeps orphaned local coverage visible without trusting an unverified file.
References: src/…/package_shim_status.py• L45-101 src/…/package_shim_status.py• L127-185
The firewall panel leads with one restore action and groups managers by the next useful state: those that need a fix, those that are protected, and those that are not protected yet. Global Audit and Sync actions sit beside status refresh. The panel can focus the unprotected group, keep long groups folded, and show a search when a machine has many tools. Each row gives a plain-language reason and next action, while the manager drawer keeps the full path details.
References: dashboard/…/supply-chain-firewall-panel.tsx• L87-95 dashboard/…/supply-chain-firewall-panel.tsx• L990-1031 dashboard/…/supply-chain-firewall-panel.tsx• L1045-1123
The related contained execution and runtime boundaries page describes the execution controls that act on this decision. This page treats those controls as the enforcement boundary and focuses on why a package request is trusted, gated, or shown for repair.
Receipts and evidence
Receipts make package protection observable after a decision or firewall operation. They connect the action to its decision, package context, manager coverage, and the reason an operator may need to act.
Package decision evidence
The package evaluation record is the typed result that the resident authority decides and callers display. It carries the decision, enforcement and entitlement state, trusted-version data, package findings, reasons, user copy, review settlement, and any external-source inspection proof. For non-allowed results, Guard can create one supply-chain evidence row per relevant package. The row ties the package to the request identity, command shape, package manager, finding, reasons, matched policy or exception, enforcement source, and workspace fingerprint. Evidence selection includes blocked, review, and warning package results, plus monitor results when the evaluation requests continued observation; an allowed result does not create the same risk evidence.
The resident authority derives the evidence IDs and sends them in the same order as the packages that need records. Python checks that the count matches before it writes anything, then stores those IDs without recomputing package identity. A mismatch stops evidence persistence so the local layer cannot create a second evidence model. The stored receipt also preserves the attributed invoking harness and the policy metadata used to present the verdict.
References: src/…/package_request_evaluation.py• L1-6 src/…/package_request_evaluation.py• L25-105 src/…/package_request_evaluation.py• L117-180 src/…/native_supply_chain_eval.py• L380-432 src/…/package_protect_projection.py• L35-88 src/…/local_supply_chain.py• L864-875
Firewall operation receipts
Headless firewall operations add operation type and manager scope to a receipt. A test also records whether Guard invoked an evaluator for each manager, which gives the dashboard a proof of interception rather than only an installation claim. Workspace audits add manifest and lockfile paths, file hashes, package totals, blocked counts, inventory, and package findings. The shim manifest stores the latest audit time, while firewall status exposes the latest intercept and audit proof so the dashboard can separate tested coverage from untested or recovered coverage.
References: src/…/package_firewall_receipts.py• L52-120 src/…/local_supply_chain.py• L729-740 src/…/local_supply_chain.py• L1258-1336 src/…/package_shim_status.py• L103-205 src/…/package_shim_status.py• L208-215
The local store keeps the accepted bundle and package evaluations by workspace and package-intent identity. Feed, policy, scoring, and bundle versions are part of the evaluation key. A change in trusted intelligence therefore causes a fresh evaluation instead of silently reusing an old result.
References: src/…/store_supply_chain.py• L9-63 src/…/store_supply_chain.py• L129-209
Repair and dashboard remediation
The dashboard presents supply-chain posture as a recovery-oriented workspace. It combines Cloud state, package-manager coverage, recent evidence, workspace audit findings, and direct actions for the next repair step.
Protection recovery
The repair path runs three independent steps: repair detected package tools, activate the runtime path, and refresh supply-chain intelligence. It reports completed and failed steps separately. The sync step is limited to intelligence refresh. Workspace audits stay in explicit audit actions so a long audit cannot hold the repair response open. The dashboard checks Cloud access before the combined restore action, can resume after connection, and asks for local approval when required. It also preserves a named connection step when intelligence sync needs Cloud setup.
References: src/…/supply_chain_repair.py• L14-76 src/…/supply_chain_repair_sync.py• L16-65 dashboard/…/supply-chain-firewall-panel.tsx• L594-663 dashboard/…/supply-chain-firewall-panel.tsx• L672-711 dashboard/…/supply-chain-repair-result.ts• L15-69
The package firewall panel maps manager state to focused actions. An uninstalled manager can be protected. An installed manager with broken routing can have its PATH fixed. A protected manager can be tested for intercept proof or removed. A shell restart is shown as a separate activation state because the saved shell setup may not affect the current process yet. Recovered or stale shims are shown as repair work rather than as active protection.
References: dashboard/…/supply-chain-firewall-controls.tsx• L171-279 src/…/package_shim_status.py• L127-185 src/…/guard-dashboard.js• L22983-23020
Workspace audit remediation
The Supply Chain hub groups the main posture view with Audit and Feed Health tabs. The posture view shows recovery guidance, Cloud capabilities, receipt evidence, an audit teaser, bundle state, and connected-app coverage. The Audit tab owns the detailed workspace findings and can resume an audit after its connection gate is cleared.
References: dashboard/…/supply-chain-hub-workspace.tsx• L14-40 dashboard/…/supply-chain-hub-workspace.tsx• L81-127 dashboard/…/supply-chain-workspace.tsx• L168-236
Workspace audit indexes project dependencies and surfaces packages that need review. The Audit view links findings to evidence, shows whether the issue is a blocked package or a manager that bypasses Guard, and offers an inline PATH repair for managers that need it. Operators can mark a finding resolved when it needs no automatic action.
References: src/…/audit-workspace.js• L915-1058 src/…/audit-workspace.js• L1067-1122
Cloud connection experience
The dashboard keeps local protection visible while it explains what Cloud adds. Local-only mode supports device checks and local evidence. A paired active mode adds live warnings, synced policy, and cross-device evidence. Connection and reconnection flows use a browser step before Guard changes package-manager routing.
References: src/…/supply-chain-workspace.js• L424-473 src/…/guard-dashboard.js• L22751-22903
The workspace recovery flow is organized around the operator's next safe action.
sequenceDiagram
participant O as Operator
participant D as Dashboard
participant L as Local daemon
participant C as Guard Cloud
O->>D: Open Supply chain
D->>L: Read status and receipts
L-->>D: Coverage, entitlement, posture, evidence
alt Cloud connection needed
O->>D: Connect or reconnect
D->>L: Start local connect
L->>C: Open signed authorization flow
C-->>L: Cloud access and supply-chain state
else Local issue found
O->>D: Fix PATH or fix all
D->>L: Run bounded repair steps
L-->>D: Completed and failed steps
end
O->>D: Run audit or inspect evidence
D->>L: Evaluate workspace and record receipt
L-->>D: Findings and remediation state
The dashboard product workspaces page places this workspace beside review, policy, and evidence experiences. The dashboard review and approval workflow page explains the human review path for requests that cannot proceed automatically. The supply-chain workspace is the product surface for package posture. The evidence view remains the place to inspect the recorded action in detail.
References: dashboard/…/supply-chain-firewall-panel.tsx• L267-339 dashboard/…/supply-chain-firewall-panel.tsx• L544-571 dashboard/…/supply-chain-firewall-panel.tsx• L804-907
Change checklist
When these files or sections are changed, remember to consider these:
- A new package manager or ecosystem must remain consistent across intent parsing, workspace inventory, ecosystem support labels, firewall coverage, and dashboard manager state.
- A new decision or reason code must map consistently to execution permission, user copy, receipt policy, evidence severity, and dashboard remediation.
- Changes to package evaluation fields, resident evidence-ID ordering, review settlement, or evidence selection must preserve stable evidence IDs and the link from each finding to its request and package context.
- Changes to bundle identity or risk fields must update bundle validation, package matching, offline evaluation, and the cache key that prevents stale decisions.
- Changes to entitlement sources, canonical plan IDs, claim freshness, or connection-state precedence must preserve the difference between active access, connect required, reconnect required, and paid access required.
- Changes to entitlement payload normalization, feature gates, or legacy field aliases must preserve the precedence rules and must not turn malformed values into firewall access.
- Changes to entitlement reasons must update daemon operation gates and the dashboard's connect, reconnect, upgrade, and local-recovery actions together.
- Changes to local trust states or degraded reasons must preserve the mapping between runtime protection, remembered rules, Cloud policy status, and dashboard setup guidance.
- Changes to shim generation, interpreter trust, or frozen-runtime binding must preserve the distinction between runnable, intact, stale, unknown, and tampered manager coverage.
- Changes to package execution context inputs, configuration files, referenced environment values, or digest versioning must preserve portable approval reuse and fail-closed re-review when context proof is incomplete.
- Changes to harness attribution must preserve the separation between the user-facing invoking harness and the fixed policy-scoping harness.
- Changes to manifest recovery, sensitive-file filtering, lockfile warnings, advisory aliases, or audit proof fields must preserve conservative recovery and the dashboard's evidence links.
- Changes to local Python project path classification or source review must preserve the separation between on-disk project inspection and remote source handling.
- Changes to intercept or audit proof fields must preserve the receipt metadata consumed by the Supply Chain and Audit workspaces.
- Changes to repair, restore, or sync steps must preserve honest completed, failed, deferred, and remaining step reporting. Intelligence sync must not start a long workspace audit.
- Changes to Cloud fallback rules must preserve the difference between a signed cached block, an explicitly unpaid account, and an unknown or untrusted Cloud state.
- Changes to external archive or npm source handling must preserve separate-request rules and the binding between inspected source content and later execution.
- Changes to the resident package authority, its intent-parser sole-authority rule, or its terminal evaluation path must preserve one decision model and one local evidence record. A missing or invalid resident evaluation must remain a fail-closed block.
- Changes to resident package-policy resolution must keep the decision and authority returned by the resident aligned with the evaluation patch, claim selection, request digest, and caller-side claim operation.
- Changes to resident review settlement must preserve the rule that malformed settlement data cannot weaken a blocked result or silently close an unresolved review.
- Changes to resident approval reuse must preserve the no-claim behavior when the authority is unavailable, the claim-failure re-evaluation path, and the exact request binding for a waited Cloud allow.
- Changes to bundle verification keys, fingerprints, or key lifecycle states must preserve keyring anchoring, rotation grace periods, revocation checks, and the signature gate before offline use.
- Changes to brokered egress needs or supplied outcomes must preserve request identity, response limits, archive inspection binding, and the rule that the caller moves bytes while the resident owns parsing and decisions.
- Changes to review planning or package approval keys must preserve token-for-token artifact binding, block-only handling for unproven installs and launches, workspace-local directory proof, and harness-scoped approval reuse.
- Changes to the review-plan retry output must preserve the rule that registry retry guidance is present only for a proven npm install and is absent for block-only plans.
- Changes to package-script memory must preserve live package.json checks, in-project workspace boundaries, and the fallback order for the operator's working directory.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Package source uses insecure HTTP or has ambiguous source identity | Guard blocks or requires review before installation | Keep source parsing and source review bound to the package request identity |
| Manifest dependency is not pinned in the existing lockfile | The request needs review because the resolved package is not known | Update the lockfile, then re-run the request or workspace audit |
| Lockfile cannot be parsed or is a binary format outside audit support | Audit falls back to a visible warning or manifest-only monitoring | Preserve the warning and do not report complete resolved-version coverage |
| A local Python project is stored in a directory whose name looks like an archive | The project can be missed by local inspection if its name is treated as the source type | Resolve the explicit on-disk path and inspect project metadata while keeping remote URLs out of local-project evidence |
| The package execution context contains an unsupported manager, global request, dynamic configuration, or an unavailable required input | A saved approval is bound to the current retry or requires re-review instead of becoming portable | Repair the context or approve the new context explicitly |
| A paid OAuth firewall claim is missing, expired, or conflicts with the bundle state | New Cloud-gated actions require reconnection instead of being treated as unpaid or allowed | Reconnect Guard Cloud so the plan and firewall claim are refreshed together |
| Entitlement input has no usable plan or only malformed grant fields | No Cloud firewall entitlement is resolved | Keep canonical plan and recognized boolean gate precedence fail closed |
| Cloud evaluation times out or the endpoint is not trusted | The request stays stopped or needs review instead of bypassing Cloud protection | Honor a signed cached block; otherwise fail closed unless the account is explicitly unpaid and local policy permits fallback |
| Local trust material or its storage cannot be verified | Local protection reports a degraded or unknown state instead of claiming full trust | Follow the named setup or repair reason; do not treat degraded status as protected |
| Package shim is installed but its directory is missing from PATH or is behind the real binary | Package-manager commands can bypass Guard | Repair PATH, open a new shell, and run an intercept test |
| Generated shim points to a missing or untrusted Guard interpreter, its frozen sidecar is changed, or its bindings target an old launcher | The manager is not treated as protected and package execution can fail or lose Guard coverage | Recreate the shim and its sidecar through the normal repair path, then test interception |
| Package-shim manifest is missing or malformed while a Guard-generated shim remains on disk | Status can lose the install record or trust an orphaned file if recovery is not conservative | Recover only bounded Guard-shaped files, mark them stale, and require rewrite and re-attestation |
| Signed bundle is stale, invalid, rolled back, signed by a revoked or expired key, or signed by a key outside the trusted keyring | Guard cannot safely use the bundle as current intelligence | Refresh trusted intelligence and restore the trusted keyring; do not treat an unverified bundle as permission |
| A present trusted keyring is empty | Bundle verification refuses the response instead of accepting its advertised key | Restore a non-empty trusted keyring or use the explicit bootstrap case only when no keyring exists |
| Repair completes only some independent steps or leaves Cloud sync pending | Protection remains incomplete even if one layer works | Show failed and remaining steps, then retry the remaining repair work |
| External archive or npm source dependency is mixed with registry packages in one request | Guard blocks the mixed request because source inspection cannot stay bound to execution | Install the external source in a separate request |
| An inspected external archive changes or is not present at launch | Guard blocks the install rather than running content that was not reviewed | Preserve the archive digest and bind the reviewed file to the final installer command |
| Audit request includes a sensitive environment file | Sensitive local data must not become audit input | Skip the file and report only supported project material |
| Resident package intent parsing is unavailable or returns no intent | Package protection does not create a competing Python interpretation | Keep the resident parser as the sole intent authority and require a supported resident result |
| Resident package evaluation is unavailable, unbound, or malformed | The package request receives a terminal block rather than a fallback verdict | Repair or restart the resident and retry the request |
| Resident policy resolution has no trusted daemon match while the store decision is ignored | The saved package state is not reused and the request remains on the safe reapproval path | Restore the trusted policy source or evaluate the package again; do not treat an unresolved row as an allow |
| Resident review settlement is missing or malformed | A pending review stays open, and a blocked result remains blocked | Accept only a valid resident settlement with the action-specific message shape |
| Resident evidence IDs do not match the packages selected for recording | No evidence row is written for that evaluation | Keep resident ID ordering aligned with the local record-selection rule |
| Resident approval reuse is unavailable or an approval claim fails | The saved approval is not silently applied or consumed | Keep the current evaluation and re-evaluate reuse after claim failure |
| A waited Cloud allow is used by a different request or retry without its waited request ID | The allow must not authorize that package action | Bind the one-shot allow to the exact request, artifact, and context, then consume it once |
| The caller supplies an egress outcome for the wrong request, body, or occurrence | The resident cannot safely use the response and evaluation remains gated | Match supplied outcomes to the resident's need identity and preserve body and archive limits |
| A package review contains shell expansion, chaining, unsafe filters, or an unproven npm executable | The review is not given a permissive settlement path | Keep the command on the generic review route or apply only a block verdict |
An npx or bunx launch fetches several packages or hides the package target | The evaluator cannot bind one package decision to the launch | Leave the review unresolved until the launch names one reviewable package |
| A registry retry is requested for a block-only or unproven review plan | The plan provides no retry instruction and the command stays non-permissive | Emit retry guidance only when the resident proves an npm install may allow |
| A package approval key names another harness or has an invalid context token | An Always allow is not saved or reused for the request | Require a harness-matching package-request key with a valid context |
| A remembered package-script project loses its package.json or a linked workspace resolves outside the project | The stale project is not refreshed or shown as an in-project package target | Rebuild roots from live manifests and reject workspace paths outside the project |
Key files
| File | Why to read it |
|---|---|
| src/…/package_intent_parser.py | Shows the package intent interface and the package-manager, shell-context, and local-runner concepts used by the resident authority. |
| src/…/package_intent_common.py | Defines the request identity and the workspace and local-execution evidence carried into decisions. |
| src/…/package_execution_context.py | Defines the complete package execution identity used to decide if an approval can be reused. |
| src/…/package_execution_context_configuration.py | Shows which manager, workspace, hook, registry, and environment inputs can change package execution. |
| src/…/native_supply_chain_eval.py | Defines the resident boundary for package evaluation, request binding, managed egress, fail-closed behavior, and evidence persistence. |
| src/…/package_request_evaluation.py | Defines the package evaluation shape, resident review settlement, and resident-supplied evidence IDs for non-allowed and monitored package findings. |
| src/…/supply_chain_package_services.py | Isolates registry metadata, archive inspection, lockfile context, workspace fingerprints, and Cloud request shaping used by evaluation. |
| src/…/package_protect_projection.py | Keeps package verdicts, invoking-harness attribution, public targets, and receipts aligned. |
| src/…/supply_chain.py | Defines the main local supply-chain risk signal families. |
| src/…/supply_chain_bundle_runtime.py | Defines signed bundle trust, freshness, rollback checks, and offline package evaluation. |
| src/…/supply_chain_bundle_models.py | Defines the package, advisory, policy, denylist, and signed-response records carried by supply-chain intelligence. |
| src/…/supply_chain_verification_keys.py | Defines the verification-key records and keyring input used to trust signed supply-chain bundles. |
| src/…/local_supply_chain.py | Coordinates workspace audits, local posture, resident-first package intent and evaluation, Cloud refresh, package-manager coverage, package protection, approval reuse, and audit receipts. |
| src/…/native_package_authority.py | Defines the resident transport and DTO boundary used for package intent and package evaluation responses. |
| rust/…/package_authority_op.rs | Shows the resident authority that parses intent, builds artifacts, evaluates packages, brokers trusted state, and persists the shared result. |
| rust/…/package_policy_resolve_op.rs | Shows resident-owned saved package-policy lookup, approval reuse classification, verdict rewriting, and claim selection. |
| rust/…/package_policy_resolve_wire.rs | Shows the typed response that carries the evaluation patch, resolved decision, authority, and claim result across the resident boundary. |
| rust/…/package_review_plan_op.rs | Shows how package reviews accept only provable command shapes and how the review artifact records whether an allow is possible. |
| rust/…/package_review_plan_op_tests.rs | Captures the review boundary for launches, command fields, workspace changes, npm proof, and approval-key eligibility. |
| rust/…/package_script_memory.rs | Shows how live package manifests, workspace roots, remembered script projects, and operator working directories support package-script recognition. |
| rust/…/package_approval_key.rs | Defines the harness-scoped package approval identity used by Always allow decisions. |
| rust/…/supply_chain_egress.rs | Defines the brokered network exchange and bounded external-archive inspection contract. |
| rust/…/supply_chain_bundle_verify_op.rs | Defines the resident signed-bundle verification result and trust-keyring refusal cases. |
| rust/…/entitlement_vectors.json | Captures the accepted plan, feature-gate, expiry, alias, and malformed-input entitlement cases. |
| src/…/local_trust_contract.py | Defines the shared local trust states and the user-safe status of runtime protection, remembered rules, and Cloud policies. |
| src/…/package_firewall_entitlement.py | Resolves Cloud plan and connection state, separates new firewall actions from local recovery, and defines the operation gates shown to the dashboard. |
| src/…/package_firewall_receipts.py | Defines manager coverage and intercept proof added to firewall operation receipts. |
| src/…/package_shim_frozen.py | Defines trusted launch, current-runtime binding, and integrity behavior for package shims, including frozen Desktop runtimes. |
| src/…/package_shim_status.py | Defines shim status enrichment, conservative recovery of orphaned shims, and audit-proof persistence. |
| src/…/supply_chain_repair.py | Defines the bounded repair result and partial-failure contract. |
| src/…/supply_chain_repair_sync.py | Maps missing or expired Cloud pairing to a named deferred sync step without running a long workspace audit. |
| src/…/server.py | Shows the daemon boundary for supply-chain status, firewall operations, audits, and repair. |
| rust/…/package_script_route.rs | Shows how package scripts retain a generic review route unless Guard can prove the narrow read-only or build boundary that will run. |
| rust/…/local_projects.rs | Shows how local PyPI project paths are recognized without treating remote sources as local projects. |
| rust/…/local_projects_tests.rs | Shows the boundary between archive-named local directories and remote package sources. |
| rust/…/source_review.rs | Shows the separate handling of external archives and npm source reviews. |
| dashboard/…/supply-chain-firewall-panel.tsx | Coordinates package-manager status, one-action restoration, Cloud connection, audit and sync recovery, approval gates, and result refresh. |
| dashboard/…/supply-chain-hub-workspace.tsx | Shows the product-level Supply Chain, Audit, and Feed Health workspace flow. |
| dashboard/…/supply-chain-firewall-controls.tsx | Shows manager groups, global audit and sync actions, and per-manager remediation controls. |
| dashboard/…/supply-chain-repair-result.ts | Normalizes repair responses so the dashboard does not report partial or deferred work as complete. |
| src/…/audit-workspace.js | Shows audit findings, evidence links, and manager PATH remediation. |