Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ RUN go mod download \
RUN mkdir -p /out/state && chown 65532:65532 /out/state

COPY cmd/healthcheck/main.go /tmp/healthcheck.go
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/nexus-proxy-healthcheck /tmp/healthcheck.go
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/nexus-proofs-healthcheck /tmp/healthcheck.go

FROM ${RUNTIME_IMAGE}

COPY --from=build /out/nexus-proxy /usr/local/bin/nexus-proxy
COPY --from=build /out/nexus-proxy-healthcheck /usr/local/bin/nexus-proxy-healthcheck
COPY --from=build --chown=nonroot:nonroot /out/state /var/lib/nexus-proxy
COPY THIRD_PARTY_NOTICES.md /usr/share/doc/nexus-proxy/THIRD_PARTY_NOTICES.md
COPY --from=build /out/nexus-proofs-healthcheck /usr/local/bin/nexus-proofs-healthcheck
COPY --from=build --chown=nonroot:nonroot /out/state /var/lib/nexus-proofs
COPY THIRD_PARTY_NOTICES.md /usr/share/doc/nexus-proofs/THIRD_PARTY_NOTICES.md

USER nonroot:nonroot
EXPOSE 3301
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nexus Proxy
# Nexus Proofs

Keeps your prompts encrypted all the way to Nexus, which runs inside a **TEE**
(trusted execution environment). Nobody in between can read them — not us, not
Expand All @@ -7,30 +7,30 @@ Dappnode. It verifies the TEE automatically on every connection.
## Use it

```text
Base URL: http://nexus-proxy.dappnode.private:3301/v1
Base URL: http://nexus-proofs.dappnode.private:3301/v1
API key: your normal Nexus API key
```

Same key, same models, same prices. Some Dappnode apps have a **private mode**
switch that does this for you — Hermes Agent is one.

For the whole path, pick a model whose id starts with **`private/`**. Those run
inside a TEE too, so your prompt stays encrypted from this proxy to Nexus and
inside a TEE too, so your prompt stays encrypted from Nexus Proofs to Nexus and
from Nexus to the model. Other models are run by their provider, which sees the
prompt to answer it.

## Check it yourself

```text
http://nexus-proxy.dappnode.private:3301/verification
http://nexus-proofs.dappnode.private:3301/verification
```

What was checked, right now, plus the raw proof to verify with independent
tooling. It never shows your prompts.

## Good to know

- Auto Router (`nexus/auto`) and PII masking do not work through the proxy.
- Auto Router (`nexus/auto`) and PII masking do not work through Nexus Proofs.
Pick a specific model.
- If the TEE cannot be verified, requests stop. That is deliberate.
- Keep port 3301 on the internal network.
Expand All @@ -41,14 +41,14 @@ tooling. It never shows your prompts.

## Scope

Encrypted: prompt and reply bodies, from this proxy to the verified Gateway
Encrypted: prompt and reply bodies, from Nexus Proofs to the verified Gateway
inside the TEE.

With a **`private/`** model, that continues past Nexus: the Gateway reaches
those models over an attested, encrypted transport that fails closed, so the
prompt is protected end to end.

Outside that: the hop from your app to this proxy (ordinary HTTP on the
Outside that: the hop from your app to Nexus Proofs (ordinary HTTP on the
Dappnode internal network) and request metadata — method, path, headers, sizes,
timing and your bearer key.

Expand All @@ -72,7 +72,7 @@ No prompt or reply content, ever — only verification evidence and per-request
identifiers, timing and sizes. The on-disk format cannot express a prompt.

Stored on the `verification_state` volume at
`/var/lib/nexus-proxy/verification.json`, so it survives restarts and is in
`/var/lib/nexus-proofs/verification.json`, so it survives restarts and is in
package backups. Anything on the Dappnode internal network can read it.
`--verification-ui=false` removes the page and its API; dropping `--state-file`
keeps history in memory only.
Expand All @@ -86,12 +86,12 @@ download is not trusted — GitHub is a CDN here, and a swapped release is
rejected.

A new Gateway is picked up **on first contact**, not on a timer: a release the
policy has never seen is what a new deployment looks like, so the proxy
policy has never seen is what a new deployment looks like, so Nexus Proofs
re-derives and verifies within the same request. Nothing needs pushing to the
node, which matters behind NAT. An hourly refresh is a backstop.

Fail-closed: if neither the network nor the cache produces a verified policy,
the proxy refuses to start. `--trust-policy-cache` keeps the signed material on
Nexus Proofs refuses to start. `--trust-policy-cache` keeps the signed material on
the `verification_state` volume and every signature is re-verified on load.

Pinned here: the SDK commit (`UPSTREAM_VERSION`), the Gateway origin
Expand All @@ -105,7 +105,7 @@ if the cache already holds a verified policy.
## Dependency

```json
{ "dependencies": { "nexus-proxy.dnp.dappnode.eth": "^0.1.0" } }
{ "dependencies": { "nexus-proofs.dnp.dappnode.eth": "^0.1.0" } }
```

## Build
Expand Down
2 changes: 1 addition & 1 deletion cmd/healthcheck/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ func main() {
}

func fail(err error) {
_, _ = fmt.Fprintf(os.Stderr, "nexus-proxy health check failed: %v\n", err)
_, _ = fmt.Fprintf(os.Stderr, "nexus-proofs health check failed: %v\n", err)
os.Exit(1)
}
18 changes: 9 additions & 9 deletions dappnode_package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "nexus-proxy.dnp.dappnode.eth",
"name": "nexus-proofs.dnp.dappnode.eth",
"version": "0.1.0",
"upstreamVersion": "v0.1.0",
"upstreamRepo": "dappnode/dappnode-nexus-sdk",
"upstreamArg": "UPSTREAM_VERSION",
"shortDescription": "Keep your Nexus prompts private, and verify it yourself",
"description": "Keeps your prompts encrypted all the way to Nexus, which runs inside a TEE (trusted execution environment). Nobody in between can read them — not us, not Dappnode. It verifies the TEE automatically on every connection.\n\nYou do not have to take our word for it: the verification page shows what was checked, right now, and lets you download the raw proof to verify independently. It never shows your prompts.\n\nPoint any OpenAI-compatible app on this Dappnode at http://nexus-proxy.dappnode.private:3301/v1 with your normal Nexus API key. Same key, same models, same prices. Some apps, such as Hermes Agent, have a private mode switch that does this for you.\n\nFor the whole path, pick a model whose id starts with private/ — those run inside a TEE too, so your prompt stays encrypted from the proxy to Nexus and from Nexus to the model. Other models are run by their provider, which sees the prompt to answer it.\n\nAuto Router (nexus/auto) and PII masking do not work through the proxy.",
"description": "Keeps your prompts encrypted all the way to Nexus, which runs inside a TEE (trusted execution environment). Nobody in between can read them — not us, not Dappnode. It verifies the TEE automatically on every connection.\n\nYou do not have to take our word for it: the verification page shows what was checked, right now, and lets you download the raw proof to verify independently. It never shows your prompts.\n\nPoint any OpenAI-compatible app on this Dappnode at http://nexus-proofs.dappnode.private:3301/v1 with your normal Nexus API key. Same key, same models, same prices. Some apps, such as Hermes Agent, have a private mode switch that does this for you.\n\nFor the whole path, pick a model whose id starts with private/ — those run inside a TEE too, so your prompt stays encrypted from Nexus Proofs to Nexus and from Nexus to the model. Other models are run by their provider, which sees the prompt to answer it.\n\nAuto Router (nexus/auto) and PII masking do not work through Nexus Proofs.",
"type": "dncore",
"backup": [
{
"name": "verification-state",
"path": "/var/lib/nexus-proxy"
"path": "/var/lib/nexus-proofs"
}
],
"mainService": "nexus-proxy",
"mainService": "nexus-proofs",
"architectures": [
"linux/amd64",
"linux/arm64"
Expand All @@ -38,18 +38,18 @@
"author": "DAppNode Association <admin@dappnode.io> (https://github.com/dappnode)",
"repository": {
"type": "git",
"url": "https://github.com/dappnode/DNP_NEXUS_PROXY"
"url": "https://github.com/dappnode/DNP_NEXUS_PROOFS"
},
"bugs": {
"url": "https://github.com/dappnode/DNP_NEXUS_PROXY/issues"
"url": "https://github.com/dappnode/DNP_NEXUS_PROOFS/issues"
},
"license": "MIT",
"warnings": {
"onInstall": "Point your apps at http://nexus-proxy.dappnode.private:3301/v1 with your normal Nexus API key. Auto Router and PII masking do not work through the proxy. If the TEE cannot be verified, requests stop. Keep port 3301 on the internal network."
"onInstall": "Point your apps at http://nexus-proofs.dappnode.private:3301/v1 with your normal Nexus API key. Auto Router and PII masking do not work through Nexus Proofs. If the TEE cannot be verified, requests stop. Keep port 3301 on the internal network."
},
"links": {
"ui": "http://nexus-proxy.dappnode.private:3301/verification",
"ui": "http://nexus-proofs.dappnode.private:3301/verification",
"homepage": "https://nexus.dappnode.com",
"docs": "https://github.com/dappnode/DNP_NEXUS_PROXY#readme"
"docs": "https://github.com/dappnode/DNP_NEXUS_PROOFS#readme"
}
}
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
version: "3.5"

services:
nexus-proxy:
nexus-proofs:
build:
context: .
dockerfile: Dockerfile
args:
UPSTREAM_VERSION: v0.1.0
image: nexus-proxy.dnp.dappnode.eth:0.1.0
container_name: DAppNodeCore-nexus-proxy.dnp.dappnode.eth
image: nexus-proofs.dnp.dappnode.eth:0.1.0
container_name: DAppNodeCore-nexus-proofs.dnp.dappnode.eth
restart: unless-stopped
command:
- --gateway-url
- https://nexus-api-tee.dappnode.com
- --trust-policy-updates
- --trust-policy-cache
- /var/lib/nexus-proxy/releases.json
- /var/lib/nexus-proofs/releases.json
- --listen
- 0.0.0.0:3301
- --listen-scope
- dappnode
- --state-file
- /var/lib/nexus-proxy/verification.json
- /var/lib/nexus-proofs/verification.json
expose:
- "3301"
volumes:
- verification_state:/var/lib/nexus-proxy
- verification_state:/var/lib/nexus-proofs
cap_drop:
- ALL
security_opt:
Expand All @@ -34,7 +34,7 @@ services:
healthcheck:
test:
- CMD
- /usr/local/bin/nexus-proxy-healthcheck
- /usr/local/bin/nexus-proofs-healthcheck
interval: 30s
timeout: 5s
retries: 3
Expand Down
12 changes: 6 additions & 6 deletions getting-started.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nexus Proxy
# Nexus Proofs

Keeps your prompts encrypted all the way to Nexus, which runs inside a **TEE**
(trusted execution environment). Nobody in between can read them — not us, not
Expand All @@ -8,7 +8,7 @@ It verifies the TEE automatically on every connection.

## Check it yourself

**[Open the verification page](http://nexus-proxy.dappnode.private:3301/verification)**
**[Open the verification page](http://nexus-proofs.dappnode.private:3301/verification)**
— what was checked, right now, plus the raw proof to verify independently. It
never shows your prompts.

Expand All @@ -17,7 +17,7 @@ never shows your prompts.
Point any OpenAI-compatible app on this Dappnode at:

```text
Base URL: http://nexus-proxy.dappnode.private:3301/v1
Base URL: http://nexus-proofs.dappnode.private:3301/v1
API key: your normal Nexus API key
```

Expand All @@ -27,15 +27,15 @@ that does this for you — Hermes Agent is one.
## Get the most out of it

Pick a model whose id starts with **`private/`**. Those run inside a TEE too,
so your prompt stays encrypted the whole way — from this proxy to Nexus, and
so your prompt stays encrypted the whole way — from Nexus Proofs to Nexus, and
from Nexus to the model. Other models are run by their provider, which sees the prompt to
answer it.

## Good to know

- Auto Router (`nexus/auto`) and PII masking do not work through the proxy.
- Auto Router (`nexus/auto`) and PII masking do not work through Nexus Proofs.
Pick a specific model.
- If the TEE cannot be verified, requests stop. That is deliberate.
- Keep port 3301 on the internal network.

[Full documentation](https://github.com/dappnode/DNP_NEXUS_PROXY#readme)
[Full documentation](https://github.com/dappnode/DNP_NEXUS_PROOFS#readme)
Loading