Enroll HACP Control
Enrollment connects a user, device, harness installation, release manifest, and runtime evidence to a workspace.
Linux: Install From A Release Artifact
ops/hacp-control/install.sh \
--artifact dist/hacp-control/artifacts/hacp-control-0.1.0-x86_64-unknown-linux-gnu.tar.gz \
--public-key hacp-control-release.pub
hacp --version
hacp doctor --jsonWindows WSL2: Start With The Setup Guide
The dedicated setup guide separates the one-command localhost workflow from the hosted/enterprise installer, identifies the deployed downloads and checksums, and explains which production signing outputs users receive without exposing private signing keys.
- Open Windows Secure WSL Setup — Choose the correct path before running a script.
Windows WSL2: Before You Install
- Use Windows 11 x86-64 build 22000 or newer, WSL 2.5.9 or newer, virtualization, and the Microsoft WSL kernel.
- TPM 2.0 is required for hardware-backed L5. A machine without usable TPM evidence may still attain L4.
- Production and shared deployments require the timestamped Authenticode installer, release-key-signed HACP_WINDOWS_BOOTSTRAP_AUTHENTICODE/1 evidence, an independently pinned verification-descriptor hash and signer-certificate hash, the signed HACP_RUNTIME_APPLIANCE/2 release and reviewed RSA public key, and reachable HTTPS API, WSS Gateway, artifact, and appliance URLs. Interactive localhost development instead runs checked-in source under an explicit development exception and can offer a separately consented appliance build when release inputs are absent.
- Remove any global .wslconfig kernel or kernelModules override. The wizard preserves other settings, asks before enabling mirrored networking, and performs the required WSL shutdown and restart itself.
- Keep your normal Ubuntu distribution. Sigroom imports a separate non-interactive Sigroom-HACP-L4-<release-id> appliance and never upgrades a normal WSL shell into L4.
Windows WSL2: Run One PowerShell Entry Point
onboard-wsl-hacp.ps1 is the only script a user runs. Launch it from native Windows PowerShell so it survives the required WSL networking restart. It boots and validates the selected ordinary Ubuntu WSL2 distribution, automatically invokes its Bash worker, asks for missing release, TPM, GeneSYS, model-broker, consent and enrollment inputs, configures the localhost HTTPS/WSS origin, runs conformance, waits for separate approval, and verifies the connected service. Do not run the worker or enter the managed appliance. Rerun the identical PowerShell command after exit code 10 or 11.
powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File "\\wsl.localhost\<Ubuntu-distro>\home\<linux-user>\code\teamwork\ops\hacp-control\onboard-wsl-hacp.ps1"Windows WSL2: Hands-On Local Lab
- Start with the raw local Web, API and Gateway ports healthy in the ordinary Ubuntu distro; the wizard adds one https://localhost:8443 origin.
- To test an externally signed appliance in this localhost lab, supply the complete HACP_RUNTIME_APPLIANCE/2 release, separately reviewed RSA public key, and Authenticode-valid Windows TPM broker. The wizard still runs setup-l4-windows.source.ps1 after explicit development consent; production and shared clients use the separately signed hosted bootstrap set.
- When release inputs are absent on localhost, the interactive wizard may build and sign a development-only release after separately prompting to create or trust a mode-600 RSA key and non-exportable current-user Windows development identities. Never promote those identities or artifacts to production.
- The fresh appliance measures and locks Trivy, Syft, Grype, OSV-Scanner, Gitleaks, Semgrep, Checkov, cargo-audit, and cargo-deny, including the full IaC scan path. Its trusted service needs outbound access to populate vulnerability databases on first use; runsc workloads remain network-denied.
- A first local appliance build requires at least 16 GiB of free Linux-distro storage and separate consent for its sudo-installed cross-build and image tools; later runs reuse verified state.
- The wizard prompts separately before changing .wslconfig, making sudo-backed Caddy/publication changes, trusting the displayed localhost CA, or creating development signing trust.
- For L5, review the Microsoft-signed TPM manufacturer package and assemble the approved roots and intermediates as one PEM bundle.
- Use a private server-owned provider-key file only when enabling model calls; never place the key in Windows, the appliance, GeneSYS, enrollment commands or rooms.
- Use a different authorized administrator to approve enrollment, then verify the final report, Windows shim, scheduled task, revocation, WSL termination recovery and Windows restart recovery.
- The complete commands, local-lab release-engineering checklist and expected evidence are in docs/deployment/runtimes/windows-wsl2/local-development-walkthrough.md.
Windows WSL2: Local Environment Contract
The wizard writes .local/wsl-hacp-onboarding/sigroom-wsl.env as a mode-600, marker-owned profile. Local start and health commands auto-load it after .env.local and .local/gateway-tls.env. It explicitly clears disabled TPM, model, inference, and next-key settings so stale base values cannot remain active. Do not source, edit, commit, or copy it. The profile persists across restarts; rerun the same PowerShell wizard if it becomes invalid. An explicit SIGROOM_LOCAL_ENV_OVERRIDE_FILE is an advanced CI/recovery override. Hosted values are intentionally deferred.
| Group | Variables and guarantees |
|---|---|
| WSL temporary storage | TMPDIR, TMP, and TEMP point at the protected Linux-filesystem onboarding temp directory so Node/tsx never falls back to an inherited /mnt/c Windows temp path. |
| Local dependency routing | REDIS_URL is redis://localhost:6379 for direct WSL processes; REDIS_INTERNAL_URL is redis://redis:6379 for explicitly mapped Compose services. |
| Origin and TLS | PUBLIC_WEB_ORIGIN, WEB_PUBLIC_URL, API_PUBLIC_URL, GATEWAY_PUBLIC_URL, WEBAUTHN_RP_ID/ORIGIN, and NODE_EXTRA_CA_CERTS use the generated https://localhost:8443 authority without disabling TLS verification. |
| Enrollment | SELF_SERVICE_ENROLLMENT_V2 and HACP_WINDOWS_WSL2_ENABLED are true only with the exact selected HACP_WINDOWS_WSL2_WORKSPACE_IDS allowlist. |
| Local auth | Seeded test-auth fixtures are enabled for the disposable lab; OAuth provider values and hosted cookie-domain overrides are cleared. |
| L4/L5 | HACP_WINDOWS_TPM_L5_ENABLED reflects the selected mode; HACP_TPM_MANUFACTURER_ROOTS_PATH contains a reviewed PEM path only for L5 and is explicitly empty for L4. |
| GeneSYS | HACP_GENESYS_LIVE_LAUNCH_ENABLED is the local kill switch. The disposable-local evaluator derives manual/autonomy admission for the selected workspace from HACP_AUTONOMY_ENABLED; hosted admission comes from versioned database policies. |
| Launch trust | HACP_LAUNCH_ROOTFS_MEASUREMENT comes from the signed asset's dedicated launch_rootfs_measurement field, not its whole-appliance rootfs_measurement; stable local launch keys and the exact Gateway session public-key descriptor survive API restarts. |
| Release security | RELEASE_SIGNING_PUBLIC_KEY plus local-folder HACP download settings select the generated signed GeneSYS release; PACKAGE_SECURITY_RELEASE_BLOCKING_ENABLED remains true, alongside the package-security UI, auto-revocation, and admin controls. |
| Model broker | Provider credentials are cleared unless explicitly enabled; when enabled, exact model allowlists plus token, spend, timeout and response-size ceilings are server-owned. |
| Local-only base defaults | Codex/Claude, HACP project-test execution, platform/harness document generation, and the generic package scanner remain disabled; loop scheduling follows the explicit autonomy choice. WSL onboarding uses legacy_env with a stable random protected repository credential key, while the checked-in example key is only a non-WSL disposable fallback. |
| Secret ownership | Direct-process startup gives CA/receipt/launch/model keys only to API, TLS/session keys only to Gateway, object-storage or direct-inference secrets only to their API/Worker consumers, and none of those private keys to Web or health/build orchestration. |
| Scope boundary | Only the default local-process stack is supported. HACP_PROJECT_TEST_EXECUTION_ENABLED and PROJECT_TEST_* belong to a separate Linux project-test Worker; GeneSYS tests run inside HACP. |
Windows WSL2: What Changed
The implementation reference maps every supported behavior to its contracts, appliance builder, Windows installer, TPM verifier, local wizard, GeneSYS integration, update lifecycle and acceptance evidence.
- Runtime contracts distinguish windows.wsl2.runsc from native linux.runsc.l4 and persist the signing-key algorithm with device evidence.
- The signed Ubuntu 24.04 appliance disables Windows mounts and interop, verifies an immutable file manifest and keeps mutable state below /var/lib/sigroom/hacp.
- The measured scanner payload locks Trivy, Syft, Grype, OSV-Scanner, Gitleaks, Semgrep/pysemgrep, Checkov, cargo-audit, cargo-deny, its SBOM, scanner lock and local rules.
- One user-run PowerShell entrypoint divides work internally across Windows host checks, an automatically invoked ordinary-WSL worker, and non-interactive managed-guest verification.
- L5 is verifier-derived from native TPM evidence and live proof of possession; invalid or absent TPM evidence cannot be converted into an administrator-assigned L5.
- Side-by-side updates preserve the active appliance until the staged harness enrolls and connects, and retirement requires matching revocation evidence.
Windows WSL2: Hosted Or Enterprise Sigroom
The same signed appliance can connect to a public or private Sigroom control plane. The browser origin is separate from the API enrollment and WSS Gateway channels; every configured origin must pass TLS and reachability checks from Windows and the managed appliance. The deployed Downloads command uses API_PUBLIC_URL for both -ApiUrl and -ArtifactUrl and GATEWAY_PUBLIC_URL for -GatewayUrl.
- Publish the timestamped Authenticode installer, release-key-signed HACP_WINDOWS_BOOTSTRAP_AUTHENTICODE/1 evidence, independently reviewed verification-descriptor hash and signer-certificate hash, signed runtime manifest, measured WSL asset, SBOM, provenance and Authenticode-valid TPM broker before enabling the Windows enrollment UI.
- Enable HACP_WINDOWS_WSL2_ENABLED plus the exact workspace allowlist. Enable TPM L5 only with a reviewed manufacturer-root bundle.
- Public WebPKI deployments require no local CA. A private CA requires explicit current-user consent and a separately reviewed SHA-256 pin.
- Use --allow-mixed-origins only for reviewed hosted subdomains; the localhost wizard deliberately remains restricted to https://localhost.
- A healthy web page alone is insufficient: verify API readiness, release objects, a real WSS upgrade, workspace flags and the registered Windows-capable GeneSYS release.
Windows WSL2: Hosted Or Enterprise Installer
This lower-level command is for a hosted or enterprise bundle containing an externally signed appliance; it is not another localhost onboarding step. Before invoking it, download every file to disk, independently pin the verification-descriptor hash, verify the RSA-PSS signature over the exact Authenticode evidence bytes before parsing them, require Get-AuthenticodeSignature status Valid, and compare the actual signer-certificate SHA-256 against an independently supplied pin. Never pipe the download into execution. The deployed Downloads command supplies -ApiUrl from API_PUBLIC_URL, -GatewayUrl from GATEWAY_PUBLIC_URL, and -ArtifactUrl from API_PUBLIC_URL; the manual example below preserves a valid reviewed split-origin topology. Localhost users run only onboard-wsl-hacp.ps1. When using a reviewed private CA, append -AcceptTlsRootCa only after checking its subject, expiry, purpose, and SHA-256 pin.
.\setup-l4-windows.ps1 `
-ManifestUrl 'https://sigroom.local/appliance/runtime-appliance.json' `
-PublicKey '.\sigroom-appliance-release-public.pem' `
-ApiUrl 'https://sigroom.local/api' `
-GatewayUrl 'wss://sigroom.local/gateway' `
-ArtifactUrl 'https://sigroom.local/artifacts/' `
-JsonWindows WSL2: Verify Readiness
- Rerun the identical setup command after a Windows restart when setup reports WINDOWS_RESTART_REQUIRED.
- Require HACP_L4_SETUP_RESULT/2 with status ready, runtime_readiness ready, and runtime_isolation_profile windows.wsl2.runsc.
- For an L5-capable device, require tpm_readiness ready, maximum_attainable_trust L5, broker identity, and a TPM evidence path. This reports attainable trust, not enrollment approval.
- Confirm wsl -l -v lists the versioned Sigroom appliance and Get-ScheduledTask -TaskName 'Sigroom HACP L4' finds the per-user login task.
- Run service doctor only through %LOCALAPPDATA%\Sigroom\HACP\bin\hacp.cmd; do not use the appliance as a general interactive shell.
wsl -l -v
Get-ScheduledTask -TaskName 'Sigroom HACP L4'
& "$env:LOCALAPPDATA\Sigroom\HACP\bin\hacp.cmd" service doctor --jsonWindows WSL2: Release-Maintainer Conformance
The full-onboarding entrypoint runs conformance automatically. Release maintainers may run this lower-level command independently from a Windows checkout; omit -RequireL5 for an L4-only device.
.\scripts\acceptance\windows-wsl-tpm-conformance.ps1 `
-ManifestUrl 'https://sigroom.local/appliance/runtime-appliance.json' `
-PublicKey '.\sigroom-appliance-release-public.pem' `
-ApiUrl 'https://sigroom.local/api' `
-GatewayUrl 'wss://sigroom.local/gateway' `
-ArtifactUrl 'https://sigroom.local/artifacts/' `
-RequireL5Windows WSL2: Enroll And Connect
- Open the workspace enrollment page and choose Windows secure WSL appliance.
- Select a trusted GeneSYS release that advertises windows.wsl2.runsc and create a one-time enrollment session.
- Run the generated PowerShell command, then have a different authorized administrator approve the request.
- If the bounded approval wait expires, approve the request and rerun the same enrollment command.
- Require status connected and service.status service.accepted. Sigroom derives L5 only after verifying TPM attestation and live proof of possession; administrators cannot assign L5 directly.
& "$env:LOCALAPPDATA\Sigroom\HACP\bin\hacp.cmd" enroll `
--code '<one-time-code>' `
--api-url 'https://sigroom.local/api' `
--enable-service `
--json
& "$env:LOCALAPPDATA\Sigroom\HACP\bin\hacp.cmd" service status --json
& "$env:LOCALAPPDATA\Sigroom\HACP\bin\hacp.cmd" service logs --redactedWindows WSL2: End-To-End Acceptance
- Create an L4 or L5 room, bind the enrolled appliance harness, and launch a manual GeneSYS task.
- Verify model calls use the Sigroom model broker and that no provider, SSH, Git, or cloud credential is mounted from Windows or the normal WSL distribution.
- Verify signed status, test, patch, artifact, and review evidence; the Windows host repository must not be modified directly.
- Revoke the harness, confirm its Gateway session disconnects, and confirm reconnect is denied.
- Terminate the managed distribution, start the Sigroom HACP L4 scheduled task, and confirm the service reconnects. Repeat after a Windows restart.
- Enable the autonomy rollout stage only after manual acceptance passes, then repeat with a bounded autonomy grant.
Windows WSL2: Deliberate Limitations
Evidence Captured
- Release fingerprint and installed-tree fingerprint.
- Entrypoint hash and sandbox profile fingerprint.
- Runtime measurement and isolation provider version.
- Host platform, architecture, OS version, and network-denial evidence hash.
Source Material
- docs/06-linux-launcher-and-enrollment.md
- docs/deployment/runtimes/macos-hacp-control-runtime.md
- ops/hacp-control/onboard-macos-lima-hacp.sh
- ops/hacp-control/setup-l4-macos.sh
- docs/deployment/runtimes/windows-wsl2/README.md
- docs/deployment/runtimes/windows-wsl2/operator-guide.md
- docs/deployment/runtimes/windows-wsl2/local-development-walkthrough.md
- docs/deployment/runtimes/windows-wsl2/implementation-reference.md
- docs/deployment/runtimes/windows-wsl2/hosted-deployment.md
- ops/hacp-control/README.md
- ops/hacp-control/onboard-wsl-hacp.ps1
- ops/hacp-control/onboard-wsl-hacp.sh
- ops/hacp-control/appliance/complete-managed-onboarding.sh
- ops/hacp-control/setup-wsl-hacp-e2e.sh
- ops/hacp-control/setup-l4-windows.ps1
- scripts/local/build-local-wsl-appliance-state.sh
- scripts/local/prepare-local-wsl-appliance-release.sh
- scripts/local/sign-local-windows-broker.ps1
- scripts/local/run-full-stack.sh
- scripts/local/start-services.sh
- scripts/local/check-health.sh
- scripts/local/resolve-local-env-override.sh
- scripts/local/ensure-gateway-tls-env.sh
- .env.local.example
- apps/api/src/env.ts
- apps/worker/src/env.ts
- ops/hacp-control/appliance/sigroom-hacp-control.service
- scripts/acceptance/windows-wsl-tpm-conformance.ps1