Repository navigation
Conversation
nexus/auto now works on confidential requests: the Router runs as a fourth process in the enclave, so a prompt is never sent out of it for routing. - Dockerfile.enclave builds dappnode-nexus-router at the commit the regular Router runs (v0.1.53, 816ad35), with ONNX Runtime 1.25.0 from Microsoft's NuGet package and the embedding model from a pinned Hugging Face revision, all checked by checksum. The image still builds reproducibly. - services.yaml starts it as uid 1002 after the Gateway, with its admin API off. nexus-enclave-init learns Compose's env_file, and waits for the file. - The Router has no network of its own. The Gateway relays Postgres (127.0.0.1:5432 -> parent vsock 8454) and runs a CONNECT proxy (127.0.0.1:3128) that opens tunnels to api.typesafe.ai:443 only, for the Jev strategy, over the measured TypeSafe route. TLS ends at TypeSafe. - The Router's secrets (ROUTER_DATABASE_URL, TYPESAFE_API_KEY) come in the KMS-sealed bundle. After bootstrap the Gateway writes them to /run/nexus/router.env (root only) for the init to pass on. - Inside the enclave ROUTER_URL must be http://127.0.0.1:<port>, and the Router transport dials loopback only. The bundle accepts ROUTER_URL only on loopback and ROUTER_DATABASE_URL only at the relay address. - The manifest drops router_vsock_port (nothing leaves the enclave for the Router any more) and declares database_vsock_port. Schema stays 4: clients read only schema_version, profile, workload, source_revision and ingress. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub secret scanning flagged a dummy test URL as a Postgres connection string. No check needs a password, so the test URLs carry none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #28 (PII in the enclave): merge #28 first. Companion infra PR: dappnode/infrastructure#349.
Why
nexus/autofails on confidential requests today: the Router isn't in the enclave, and sending the prompt to the one on premium-1 would take it out of the enclave. This runs the same Router code inside the enclave, as a fourth process next to Presidio and the Gateway. It works the way the regular Router does: it reads Postgres directly and supports Jev, whichnexus/autouses.How
Image (
Dockerfile.enclave), every input pinned:dappnode-nexus-router816ad35(v0.1.53, what premium-1 runs), via BuildKit's gitADDonnxruntime_gov1.30.1 expects)paraphrase-multilingual-MiniLM-L12-v2model and tokenizere8f8c21plus SHA-256The Router is built on Debian trixie, the same release as the Presidio runtime image (glibc 2.41).
Processes (
services.yaml)ROUTER_ADMIN_TOKEN, so nothing in the enclave writes routing configuration.nexus-enclave-initlearns Compose'senv_file, with one difference: it waits for a file that does not exist yet.Secrets
ROUTER_DATABASE_URLandTYPESAFE_API_KEYarrive in the KMS-sealed bundle with the Gateway's own./run/nexus/router.env(enclave RAM,0700/0600, root only), and the init starts the Router with it.Network. The Router has no network of its own; the Gateway relays (
internal/enclave/network/relay.go):127.0.0.1:5432→ parent vsock8454→ Postgres on premium-1. Queries carry router and model IDs, never prompt text.127.0.0.1:3128: an HTTP CONNECT proxy, set as the Router'sHTTPS_PROXY, that opens tunnels toapi.typesafe.ai:443only, over the measured TypeSafe route (vsock8452). TLS ends at TypeSafe, so the parent sees ciphertext. Every other host gets 403.Checks that keep prompts in the enclave
ROUTER_URLmust behttp://127.0.0.1:<port>(likePRESIDIO_ANALYZER_URL), and the Router transport dials loopback only.ROUTER_URLonly on loopback, andROUTER_DATABASE_URLonly at the relay address.Manifest
router_vsock_port(8445, which no parent served) is replaced bydatabase_vsock_port(8454).schema_versionstays 4. The SDK reads onlyschema_version,profile,workload,source_revisionandingress, and pins the version, so a bump would break every client for a change none of them reads.Attested inference. Requests with
require_attested_inferencestill refuse routers: Jev sends the prompt to TypeSafe.Checked locally
go vetandgo test -race ./...pass.0600/0700modes, no line-break injection, URL must point at the relay.env_fileboth spellings, waiting for the file, stopping while waiting,environmentoverenv_file, malformed lines.services.yaml: order, users, URLs, proxy, no admin token.--cpus 2 --memory 4gand the local (non-vsock) build. The Gateway's own relay code ran in the container's network namespace with TCP dialers. It reached a local Postgres with every Nexus migration applied.router: waiting for /run/nexus/router.env. Once the file appeared (9 s later), the Router connected to Postgres through the relay, loaded the model and was healthy 2.5 s later.test/smart(score 0.34), small talk totest/fast(0.88).api.typesafe.ai, which answered 401 to my fake key. A real Jev answer needs the production key, which I don't hold.api.deepseek.comwith 403.--no-cachelinux/amd64 builds withrewrite-timestampgave the identical image manifestsha256:b8bd233e…. I did not compute PCRs with nitro-cli.Before merging
The
dockerCI job will fail untildappnode/dappnode-nexus-routeris public. It buildsDockerfile.enclave, which fetches the Router by git. Marc is making the repository public. Until then, build locally with--build-context router-src=<checkout at 816ad35>.Check the model against premium-1, because the examples' stored embeddings were made with the model premium-1 mounts. The
nexusrole downloaded it from Hugging Face's unpinnedmain, once, into/data/dappnode_nexus/router/models:Expected:
10f7a088420252b26caf819236ca2c9d2987afd0fc06fec7553b542a5655a05aformodel.onnx;2c3387be76557bd40970cec13153b3bbf80407865484b209e655e5e4729076b8fortokenizer.json.The size matches (470,301,610 bytes). If they differ, pin this PR to premium-1's files instead.
Boot it on a real Nitro host. A 1.5 GB image has not run on one.
🤖 Generated with Claude Code