Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
a43227b
feat(assistant): run Python and bash in an OpenShell sandbox per conv…
claude Oct 17, 2026
e1caa5c
test(notes): keep the daily notes test from failing on 2026-10-17
claude Oct 17, 2026
0d3a945
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Oct 17, 2026
5b2576f
Merge remote-tracking branch 'origin/main' into port-c7
claude Oct 17, 2026
77f9aa2
feat(assistant): start the code sandbox's OpenShell gateway from Sett…
claude Oct 17, 2026
1b7d67c
Merge remote-tracking branch 'origin/claude/project-thread-r960xc-c7-…
claude Oct 17, 2026
91ee410
docs(threat-model): the code sandbox's gateway profile and its hosts …
claude Oct 17, 2026
795940c
Merge remote-tracking branch 'origin/main' into port-c7
claude Oct 17, 2026
e305f02
Merge remote-tracking branch 'origin/claude/project-thread-r960xc-c7-…
claude Oct 17, 2026
619d2dd
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Oct 17, 2026
96521d5
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Oct 17, 2026
5fbfe04
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Oct 17, 2026
0d17c46
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Oct 17, 2026
91274b4
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Oct 17, 2026
35c1d7e
Merge origin/main into claude/project-thread-r960xc-c7-gateway
claude Oct 17, 2026
563a4c6
fix(ci): the upgrade check counts entities of every type
claude Oct 17, 2026
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
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,14 @@ The backend (`fastapi_backend`) and the frontend (`nextjs-frontend`) are version
- **The assistant runs Python and bash.** Turn on Settings → Code sandbox and point Lens at an NVIDIA OpenShell
gateway, and the assistant gets `run_python`, `run_bash`, `sandbox_files` and `import_sandbox_file`: code runs in a
sandbox of the conversation's own, with none of Lens's data or keys and no network unless you allow the package
registries or the public web. Files attached to the conversation go in; a file it makes reaches a namespace once the
person approves. Off by default; starting the gateway from Settings is in progress
([Code sandbox](docs/assistant.md#code-sandbox)).
registries, or those and hosts you list. Files attached to the conversation go in; a file it makes reaches a
namespace once the person approves. Off by default ([Code sandbox](docs/assistant.md#code-sandbox)).
- **Start the code sandbox's gateway from Settings.** Settings → Code sandbox → Run the gateway on this machine has
the upgrade agent start NVIDIA OpenShell's gateway next to Lens (the Compose profile `sandbox`) and turns the sandbox
on; Lens signs in to it over mutual TLS. First it checks the machine can run it (the Docker Compose install, a
64-bit machine, Landlock in its Linux kernel) and says why not. Off deletes every sandbox and stops it. The same
over `PUT /api/v1/admin/sandbox` and the MCP tools `sandbox_gateway` and `set_sandbox_gateway`
([The gateway](docs/assistant.md#the-gateway)).
- **Find anything by who, what and when.** Agents and the API can find assets by the faces seen in them, the people
heard, the entities they mention, the topics they're about, their kind and content type, when they were made (a
day, a month or a year), tags, language, objects seen, emotions heard, length and words in them, together or alone,
Expand Down
5 changes: 4 additions & 1 deletion ci/upgrade/lens_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ def facts(api, token):
c["text"] for c in api.get(f"/resources/{rid}/comments")
)
entities = api.get("/entities", namespaces=NS, limit=200)["items"]
out["entities"] = sorted(e["name"] for e in entities)
# every entity by name, whatever its type: an upgrade step may type a Term (Monday becomes a Date, which the list
# leaves out unless asked for), but none may go
quiet = api.get("/entities", namespaces=NS, limit=200, types="DATE,NUMBER")["items"]
out["entities"] = sorted(e["name"] for e in entities + quiet)
for e in entities:
if e["name"] == ENTITY["name"]:
out[f"entity {e['name']}"] = {
Expand Down
85 changes: 84 additions & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ x-backend: &backend
# the MCP runner (the optional `mcp` service, docs/assistant.md): MCP servers that run as a program, sandboxed there
LENS_MCP_RUNNER_URL: http://mcp:8090
LENS_MCP_TOKEN_FILE: /mcp-key/token
# the code sandbox's gateway (the optional `sandbox` profile, docs/assistant.md#code-sandbox): the client
# certificate Lens signs in to it with
LENS_SANDBOX_TLS_DIR: /sandbox-key
# upgrading from the web app (docs/updates.md): the folder install.sh's upgrade agent watches, and the install folder
LENS_CONTROL_DIR: /control
LENS_HOST_DIR: ${LENS_DIR:-}
Expand All @@ -90,11 +93,12 @@ x-backend: &backend
- ${AUDIO_DIR:-./local-audio}:/audio:ro
- matterbridge-data:/matterbridge
- mcp-key:/mcp-key:ro
- sandbox-key:/sandbox-key:ro
depends_on:
surrealdb:
condition: service_healthy
restart: unless-stopped
networks: [lens, mcp]
networks: [lens, mcp, sandbox]

services:
surrealdb:
Expand Down Expand Up @@ -210,6 +214,82 @@ services:
restart: unless-stopped
networks: [mcp]

# The code sandbox's NVIDIA OpenShell gateway (docs/assistant.md#code-sandbox): Python and bash for the assistant, one
# sandbox container per conversation, made through this machine's Docker. Opt-in: Settings → Code sandbox → Start
# the gateway (the upgrade agent adds `sandbox` to COMPOSE_PROFILES and starts these), or
# `docker compose --profile sandbox up -d openshell-gateway`. Linux only, with Landlock (Linux 6.2 or newer).
# openshell-init makes the gateway's certificates once, in /var/lib/openshell on this machine (the gateway has
# Docker mount files from it into the sandboxes, so it is the same folder inside and out); openshell-key copies the
# client's to the sandbox-key volume, readable by Lens only. Lens reaches the gateway on the sandbox network over
# mutual TLS; each sandbox's supervisor reaches it on this machine's 127.0.0.1:17670.
openshell-init:
image: ghcr.io/nvidia/openshell/gateway:0.1.4
profiles: [sandbox]
user: "0"
network_mode: none
command: ["generate-certs", "--output-dir", "/var/lib/openshell/tls", "--server-san", "openshell-gateway"]
environment:
HOME: /var/lib/openshell
volumes:
- &openshell-data
type: bind
source: /var/lib/openshell
target: /var/lib/openshell
bind:
create_host_path: true
restart: "no"

openshell-key:
image: python:3.12-slim # the sandboxes' default image too, so nothing extra is downloaded
profiles: [sandbox]
user: "0"
network_mode: none
depends_on:
openshell-init:
condition: service_completed_successfully
command:
- python3
- -c
- |
import os, shutil
for src, dst in (("ca.crt", "ca.crt"), ("client/tls.crt", "tls.crt"), ("client/tls.key", "tls.key")):
shutil.copyfile("/tls/" + src, "/key/" + dst + ".new")
os.chown("/key/" + dst + ".new", 1000, 1000)
os.chmod("/key/" + dst + ".new", 0o400)
os.replace("/key/" + dst + ".new", "/key/" + dst)
volumes:
- /var/lib/openshell/tls:/tls:ro
- sandbox-key:/key
restart: "no"

openshell-gateway:
image: ghcr.io/nvidia/openshell/gateway:0.1.4
profiles: [sandbox]
user: "0" # it drives Docker through its socket
command: ["--bind-address", "0.0.0.0", "--port", "17670"]
security_opt: ["no-new-privileges:true"]
cap_drop: [ALL]
read_only: true
tmpfs: [/tmp]
depends_on:
openshell-key:
condition: service_completed_successfully
environment:
OPENSHELL_GATEWAY_CONFIG: /etc/openshell/gateway.toml
OPENSHELL_DB_URL: "sqlite:/var/lib/openshell/gateway.db?mode=rwc"
OPENSHELL_LOCAL_TLS_DIR: /var/lib/openshell/tls
OPENSHELL_TELEMETRY_ENABLED: "false"
XDG_DATA_HOME: /var/lib/openshell
HOME: /var/lib/openshell
ports:
- "127.0.0.1:17670:17670" # this machine only: the sandboxes' supervisors, on the host's network
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- *openshell-data
- ./sandbox/gateway.toml:/etc/openshell/gateway.toml:ro
restart: unless-stopped
networks: [sandbox]

# StyleTTS2 (docs/speech-providers.md#styletts2): spoken answers and podcasts read on this machine, in a voice like a
# short clip you put in its voices volume. Heavy (PyTorch and a 1 GB model, fetched on first use), so opt-in:
# `docker compose --profile styletts2 up -d`, then Settings → AI assistant → Voice → StyleTTS2.
Expand Down Expand Up @@ -319,6 +399,7 @@ volumes:
matterbridge-data:
mcp-data:
mcp-key:
sandbox-key:
styletts2-data:
styletts2-voices:
archive-data:
Expand All @@ -332,3 +413,5 @@ networks:
driver: bridge
mcp:
driver: bridge
sandbox:
driver: bridge
85 changes: 84 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ x-backend: &backend
# the MCP runner (the optional `mcp` service, docs/assistant.md): MCP servers that run as a program, sandboxed there
LENS_MCP_RUNNER_URL: http://mcp:8090
LENS_MCP_TOKEN_FILE: /mcp-key/token
# the code sandbox's gateway (the optional `sandbox` profile, docs/assistant.md#code-sandbox): the client
# certificate Lens signs in to it with
LENS_SANDBOX_TLS_DIR: /sandbox-key
volumes:
- ./fastapi_backend:/app
# the image's own packages, not the source tree's: anonymous, so `make dev` (up --build --renew-anon-volumes)
Expand All @@ -59,10 +62,11 @@ x-backend: &backend
- ${AUDIO_DIR:-./local-audio}:/audio:ro
- matterbridge-data:/matterbridge
- mcp-key:/mcp-key:ro
- sandbox-key:/sandbox-key:ro
depends_on:
surrealdb:
condition: service_healthy
networks: [lens, mcp]
networks: [lens, mcp, sandbox]

services:
surrealdb:
Expand Down Expand Up @@ -182,6 +186,82 @@ services:
- mcp-key:/key
networks: [mcp]

# The code sandbox's NVIDIA OpenShell gateway (docs/assistant.md#code-sandbox): Python and bash for the assistant, one
# sandbox container per conversation, made through this machine's Docker. Opt-in: Settings → Code sandbox → Start
# the gateway (the upgrade agent adds `sandbox` to COMPOSE_PROFILES and starts these), or
# `docker compose --profile sandbox up -d openshell-gateway`. Linux only, with Landlock (Linux 6.2 or newer).
# openshell-init makes the gateway's certificates once, in /var/lib/openshell on this machine (the gateway has
# Docker mount files from it into the sandboxes, so it is the same folder inside and out); openshell-key copies the
# client's to the sandbox-key volume, readable by Lens only. Lens reaches the gateway on the sandbox network over
# mutual TLS; each sandbox's supervisor reaches it on this machine's 127.0.0.1:17670.
openshell-init:
image: ghcr.io/nvidia/openshell/gateway:0.1.4
profiles: [sandbox]
user: "0"
network_mode: none
command: ["generate-certs", "--output-dir", "/var/lib/openshell/tls", "--server-san", "openshell-gateway"]
environment:
HOME: /var/lib/openshell
volumes:
- &openshell-data
type: bind
source: /var/lib/openshell
target: /var/lib/openshell
bind:
create_host_path: true
restart: "no"

openshell-key:
image: python:3.12-slim # the sandboxes' default image too, so nothing extra is downloaded
profiles: [sandbox]
user: "0"
network_mode: none
depends_on:
openshell-init:
condition: service_completed_successfully
command:
- python3
- -c
- |
import os, shutil
for src, dst in (("ca.crt", "ca.crt"), ("client/tls.crt", "tls.crt"), ("client/tls.key", "tls.key")):
shutil.copyfile("/tls/" + src, "/key/" + dst + ".new")
os.chown("/key/" + dst + ".new", 1000, 1000)
os.chmod("/key/" + dst + ".new", 0o400)
os.replace("/key/" + dst + ".new", "/key/" + dst)
volumes:
- /var/lib/openshell/tls:/tls:ro
- sandbox-key:/key
restart: "no"

openshell-gateway:
image: ghcr.io/nvidia/openshell/gateway:0.1.4
profiles: [sandbox]
user: "0" # it drives Docker through its socket
command: ["--bind-address", "0.0.0.0", "--port", "17670"]
security_opt: ["no-new-privileges:true"]
cap_drop: [ALL]
read_only: true
tmpfs: [/tmp]
depends_on:
openshell-key:
condition: service_completed_successfully
environment:
OPENSHELL_GATEWAY_CONFIG: /etc/openshell/gateway.toml
OPENSHELL_DB_URL: "sqlite:/var/lib/openshell/gateway.db?mode=rwc"
OPENSHELL_LOCAL_TLS_DIR: /var/lib/openshell/tls
OPENSHELL_TELEMETRY_ENABLED: "false"
XDG_DATA_HOME: /var/lib/openshell
HOME: /var/lib/openshell
ports:
- "127.0.0.1:17670:17670" # this machine only: the sandboxes' supervisors, on the host's network
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- *openshell-data
- ./sandbox/gateway.toml:/etc/openshell/gateway.toml:ro
restart: unless-stopped
networks: [sandbox]

# StyleTTS2 (docs/speech-providers.md#styletts2): spoken answers and podcasts read on this machine, in a voice like a
# short clip you put in its voices volume. Heavy (PyTorch and a 1 GB model, fetched on first use), so opt-in:
# `docker compose --profile styletts2 up -d`, then Settings → AI assistant → Voice → StyleTTS2.
Expand Down Expand Up @@ -215,6 +295,7 @@ volumes:
matterbridge-data:
mcp-data:
mcp-key:
sandbox-key:
styletts2-data:
styletts2-voices:
archive-data:
Expand All @@ -225,3 +306,5 @@ networks:
driver: bridge
mcp:
driver: bridge
sandbox:
driver: bridge
Loading
Loading