Strong mode: agents in an NVIDIA OpenShell sandbox#

In Strong mode (Lockpin in key mode inside our NVIDIA OpenShell set-up), an agent in the sandbox can’t raise its key’s limits or reach Lockpin’s controls. Tested with OpenShell v0.1.7 on WSL 2 with headless Claude Code and Codex; it holds only while the shipped sandbox policy is unchanged.

This page is the set-up that sentence describes, and its limits.

Why a sandbox#

Without one, an agent runs as you. It can open Lockpin’s meter, edit Lockpin’s files, or call a provider directly if a key is within reach. Passkeys stop the first of those (see Passkeys). Nothing on your own account stops the rest.

OpenShell (NVIDIA, Apache-2.0) runs the agent in a sandbox where every connection is refused unless a policy allows it. In this set-up:

  • The policy allows one thing: Lockpin’s model paths.

  • Lockpin holds the provider keys.

  • OpenShell holds the agent’s Lockpin key and puts it into a call only on those paths. The agent sees a placeholder.

The limits are the key’s limits#

Everything this set-up promises is about the agent’s Lockpin key.

  • The agent can’t raise the key’s limits or reach Lockpin’s controls.

  • It can still name a new task, project or wallet, and each starts fresh. A per-task budget or a wallet is therefore not a limit on the agent. Only the key’s day limit is.

So the agent’s key must carry a day limit (-day).

What was tested#

Everything below was run from inside a sandbox.

Part

Version or setting tested

OpenShell

v0.1.7 only, with the MicroVM driver

System

Windows 11 with WSL 2, which OpenShell lists as experimental

Agents

Claude Code 2.1.322 and Codex 0.167.0, headless only (claude -p, codex exec)

Lockpin

The build of 10 November 2026, just before v0.4.0. The commands on this page were checked against v0.4.0.

Provider

A test provider, not a real one

The agent’s calls went through Lockpin within the key’s limits. Streaming and the task headers worked.

The policy refused:

  • Lockpin’s meter and member pages;

  • the meter’s port;

  • the provider’s API;

  • the OpenShell gateway;

  • every other host.

Not tested:

  • OpenShell’s packaged gateway with TLS. The test gateway ran without TLS or user sign-in.

  • Docker, Podman, Kubernetes, macOS and Linux outside WSL.

  • The interactive terminal UIs of Claude Code and Codex.

  • Passkeys. They need a person at a browser, so in the tests only the policy kept the agent away from the meter’s control token.

Settings the sentence needs#

All five, together with the unchanged sandbox policy below:

  1. Key mode: Lockpin runs with -keys.

  2. A member key with a day limit for the agent: -day, role member (the default), bound to loopback (-bind loopback).

  3. The meter on its own loopback port: -admin-listen 127.0.0.1:8790, separate from the model port 8787.

  4. Provider keys only in Lockpin’s environment: never in the sandbox, its image or its --env.

  5. A passkey for every owner and admin. Without one, raises above the allowance are confirmed with the meter’s control token, and Lockpin warns that an agent on this machine could read it. With passkeys, a raise needs a person even if the policy were widened.

What you need#

  • Linux (Debian or Ubuntu, x86_64), or Windows 11 with WSL 2.

  • KVM access for OpenShell’s MicroVM driver. On Linux and WSL, add yourself to the kvm group once, then log in again (on Windows: wsl --shutdown):

    sudo usermod -aG kvm $USER
    
  • Lockpin for Linux, on the same machine as the OpenShell gateway. On Windows, run Lockpin inside WSL rather than the Windows Lockpin: host.openshell.internal reaches WSL’s own loopback.

  • The three files below: lockpin-profile.yaml, lockpin-policy.yaml and boundary.yaml. They are not in the release archives, so copy them from this page.

1. Install OpenShell#

Follow NVIDIA’s installation page. On Debian and Ubuntu that is the .deb. It installs the CLI, the policy prover and a gateway service with TLS and local credentials. Use that service, not a gateway started with allow_unauthenticated_users.

Set compute_driver = "vm" in the gateway’s TOML file, then check that a sandbox starts:

openshell status
openshell sandbox create --name hello --no-tty -- /bin/echo hello
openshell sandbox delete hello

2. Run Lockpin in key mode#

Lockpin keeps its keys file and ledger in the folder it starts in. Keep that folder out of the sandbox.

mkdir -p ~/lockpin-strong && cd ~/lockpin-strong
lockpin keys create agent -day 5 -bind loopback
lockpin keys create me -role owner -day 20 -bind loopback
  • The first key is the agent’s. Copy the lp_... it prints; it is shown only once. It is a member key, limited to $5 a day and usable only from this machine.

  • The second key is yours, for the passkey in step 3. Keep it out of the sandbox.

Start Lockpin with the provider keys in its environment only:

export ANTHROPIC_API_KEY=sk-ant-...   # provider keys: Lockpin's environment only
export OPENAI_API_KEY=sk-...
lockpin -listen 127.0.0.1:8787 -admin-listen 127.0.0.1:8790 -keys lockpin-keys.json

The meter is now at http://localhost:8790/lockpin/, and the model port 8787 answers 404 for the meter. The model port still serves some pages to anyone with the agent’s key: /lockpin/api/me, its wallets, grant requests, /lockpin/healthz, join and team. The policy in step 5 refuses all of them.

3. Set up passkeys#

In another terminal, in the same folder:

lockpin passkeys add-link -owner me -keys lockpin-keys.json -admin-listen 127.0.0.1:8790

Open the one-time link it prints in your browser and register a passkey (see Passkeys). Every owner and admin does this. Lockpin’s start-up line then stops saying “passkeys: none set up”.

4. Give OpenShell the agent’s Lockpin key#

Save the provider profile as lockpin-profile.yaml:

# lockpin-profile.yaml: OpenShell provider profile for the agent's Lockpin key.
# Guide: https://lockpin.dev/docs/guide/strong-mode/
# Tested with OpenShell v0.1.7.
#
# OpenShell provider profile for a Lockpin key. It declares the agent's
# Lockpin key (lp_ or lpc_) under the variables Claude Code and Codex read,
# so OpenShell stores the real key and the agent sees only a placeholder.
#
# The profile has no endpoints on purpose: the sandbox policy
# (lockpin-policy.yaml) binds it to Lockpin's model paths with
# credential_binding, so the network rule and the credential binding are
# reviewed in one file and the placeholder resolves nowhere else.
#
#   openshell profile lint -f lockpin-profile.yaml
#   openshell profile import -f lockpin-profile.yaml
#   openshell provider create --name lockpin --type lockpin \
#     --credential ANTHROPIC_API_KEY --credential OPENAI_API_KEY
#
# --credential KEY reads the value from your shell's environment, so the
# key never appears on a command line.
id: lockpin
display_name: Lockpin
description: The agent's Lockpin key, for a Lockpin proxy on the gateway host. Lockpin holds the provider keys.
category: inference
inference_capable: true
credentials:
  - name: anthropic_key
    description: The agent's Lockpin key, sent by Anthropic clients (Claude Code) as x-api-key
    env_vars: [ANTHROPIC_API_KEY]
    required: false
    auth_style: header
    header_name: x-api-key
  - name: openai_key
    description: The agent's Lockpin key, sent by OpenAI clients (Codex) as a bearer token
    env_vars: [OPENAI_API_KEY]
    required: false
    auth_style: bearer
    header_name: authorization
discovery:
  credentials: [anthropic_key, openai_key]

Import it and store the agent’s key in OpenShell:

openshell profile import -f lockpin-profile.yaml
export ANTHROPIC_API_KEY=lp_...   # the agent's key from step 2, in this shell only
export OPENAI_API_KEY=lp_...
openshell provider create --name lockpin --type lockpin \
  --credential ANTHROPIC_API_KEY --credential OPENAI_API_KEY
unset ANTHROPIC_API_KEY OPENAI_API_KEY

The agent sees only a placeholder such as openshell:resolve:env:…_ANTHROPIC_API_KEY.

OpenShell v0.1.7 adds no Forwarded, X-Forwarded-For or Via header, so the loopback-bound key works. If a call does carry one, Lockpin refuses it: the agent gets 401 unknown Lockpin key, and Lockpin’s log says it “refused a loopback-bound key’s call that came through a proxy on this machine”.

If that starts after an OpenShell update, stop and tell us at security@lockpin.dev. Do not loosen the key with lockpin keys bind agent any.

5. Start the sandbox with the policy#

Save the sandbox policy as lockpin-policy.yaml:

# lockpin-policy.yaml: OpenShell sandbox policy for Lockpin in key mode.
# Guide: https://lockpin.dev/docs/guide/strong-mode/
# Tested with OpenShell v0.1.7. The port is Lockpin's default, 8787.
#
# The agent's only way out is Lockpin's model paths. Everything not listed
# is denied by OpenShell's default.
#
# Lockpin runs on the gateway host (inside WSL on Windows) in key mode:
#   lockpin -listen 127.0.0.1:8787 -admin-listen 127.0.0.1:8790 -keys lockpin-keys.json
# OpenShell delivers host.openshell.internal to the host's loopback, so
# Lockpin sees every sandbox call as coming from this machine. This policy is
# what keeps the agent off the meter (8790), the member pages under /lockpin/
# on 8787, the OpenShell gateway, and every other port on the host.
#
# Tasks, projects, branches and wallets are named with headers
# (X-Lockpin-Task, X-Lockpin-Project, X-Lockpin-Branch, X-Lockpin-Wallet), not
# with lockpin run's base URL segments (/w/ /t/ /p/ /b/ /f/): those paths are
# denied here on purpose.
#
# Change 8787 only if your Lockpin listens elsewhere. Never add 8790, the
# gateway's port, a provider's host or any path under /lockpin/, and reject
# advisor proposals for them. After any change, run openshell-prover check
# against boundary.yaml.
version: 1

filesystem_policy:
  include_workdir: true
  read_only: [/usr, /lib, /etc, /proc, /dev/urandom, /var/log, /app]
  read_write: [/tmp, /dev/null]

landlock:
  compatibility: hard_requirement

network_policies:
  lockpin_models:
    endpoints:
      - host: host.openshell.internal
        port: 8787
        protocol: rest
        enforcement: enforce
        credential_binding:
          provider: lockpin
        rules:
          # Anthropic Messages (Claude Code: ANTHROPIC_BASE_URL=http://host.openshell.internal:8787/anthropic)
          - allow: {method: POST, path: /anthropic/v1/messages}
          - allow: {method: POST, path: /anthropic/v1/messages/count_tokens}
          - allow: {method: GET, path: /anthropic/v1/models}
          - allow: {method: GET, path: "/anthropic/v1/models/*"}
          # OpenAI Responses and Chat Completions (Codex: base_url = "http://host.openshell.internal:8787/openai/v1")
          - allow: {method: POST, path: /openai/v1/responses}
          - allow: {method: POST, path: /openai/v1/chat/completions}
          - allow: {method: GET, path: /openai/v1/models}
          - allow: {method: GET, path: "/openai/v1/models/*"}
        deny_rules:
          # Already denied by the rules above; stated so a later edit that
          # widens an allow cannot reach the meter or the member pages.
          - {method: "*", path: "/lockpin/**"}
          - {method: "*", path: "/spendrail/**"}
    binaries:
      # The agents' executables, by real path, and anything they start (a
      # tool's curl, a shell). Any listed process may use the agent's key on
      # these paths; the key's limits are the boundary, not this list.
      # These are the paths when the agents are uploaded to /sandbox/agents.
      # Use the paths in your image (readlink -f inside the sandbox).
      - path: /sandbox/agents/claude
      - path: /sandbox/agents/codex

Then edit two things:

  • List the real paths of your agents under binaries. Check them with readlink -f inside the sandbox.

  • Change 8787 only if Lockpin listens elsewhere. Keep boundary.yaml’s port the same.

Start the sandbox:

openshell sandbox create --name agent --policy lockpin-policy.yaml \
  --provider lockpin --detach \
  --env ANTHROPIC_BASE_URL=http://host.openshell.internal:8787/anthropic \
  --env OPENAI_BASE_URL=http://host.openshell.internal:8787/openai/v1 \
  -- sleep infinity

Put the agents in the sandbox, either in your image or by uploading them:

openshell sandbox upload agent ./agents /sandbox

The upload keeps the folder’s name, so ./agents/claude becomes /sandbox/agents/claude. The tested set-up uploaded:

  • Claude Code’s Linux build, from Anthropic’s download site;

  • Codex’s x86_64-unknown-linux-musl build, from its GitHub release.

Name tasks, projects, branches and wallets with headers: X-Lockpin-Task, X-Lockpin-Project, X-Lockpin-Branch and X-Lockpin-Wallet. The policy refuses lockpin run’s base URLs (/w/…, /t/…, /p/…, /b/…, /f/…). A wallet named this way does not bind the agent, which can leave the header out. Only the key’s limits do.

Claude Code:

openshell sandbox exec -n agent -- /bin/bash -c \
  'HOME=/sandbox CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \
   ANTHROPIC_CUSTOM_HEADERS="X-Lockpin-Task: my-task" \
   /sandbox/agents/claude -p "..." --model claude-sonnet-5-5'

Codex: create /sandbox/.codex/config.toml in the sandbox:

model_provider = "lockpin"
web_search = "disabled"    # Lockpin refuses web_search calls it cannot price

[model_providers.lockpin]
name = "Lockpin"
base_url = "http://host.openshell.internal:8787/openai/v1"
env_key = "OPENAI_API_KEY"
wire_api = "responses"
http_headers = { "X-Lockpin-Task" = "my-task" }

Codex’s web search must stay off: Lockpin cannot price it, so it refuses those calls.

6. Check the boundary after every change#

Save the boundary as boundary.yaml:

# boundary.yaml: the most network access a Lockpin sandbox may ever have: Lockpin's
# model paths on one port of the gateway host, nothing else. Check a policy
# (or a sandbox's effective policy, `openshell policy get NAME --full`) with
#   openshell policy get NAME --full | sed '1,/^---$/d' \
#     | grep -v 'credential_binding:\|provider: lockpin' > effective.yaml
#   openshell-prover check effective.yaml --boundary boundary.yaml
# The prover (v0.1.7) answers "unsupported" for credential_binding, so the
# binding lines are removed for the check; the gateway checks the binding.
# A result other than within_boundary means the agent could reach something
# besides Lockpin's model paths. Keep the port equal to lockpin-policy.yaml's.
version: 1

filesystem_policy:
  include_workdir: true
  read_only: [/usr, /lib, /etc, /proc, /dev/urandom, /var/log, /app]
  read_write: [/tmp, /dev/null]

landlock:
  compatibility: hard_requirement

network_policies:
  lockpin_models:
    endpoints:
      - host: host.openshell.internal
        port: 8787
        protocol: rest
        enforcement: enforce
        rules:
          - allow: {method: POST, path: /anthropic/v1/messages}
          - allow: {method: POST, path: /anthropic/v1/messages/count_tokens}
          - allow: {method: GET, path: /anthropic/v1/models}
          - allow: {method: GET, path: "/anthropic/v1/models/*"}
          - allow: {method: POST, path: /openai/v1/responses}
          - allow: {method: POST, path: /openai/v1/chat/completions}
          - allow: {method: GET, path: /openai/v1/models}
          - allow: {method: GET, path: "/openai/v1/models/*"}
    binaries:
      - path: "/**"

Then check the sandbox’s policy against it:

openshell policy get agent --full | sed '1,/^---$/d' \
  | grep -v 'credential_binding:\|provider: lockpin' > effective.yaml
openshell-prover check effective.yaml --boundary boundary.yaml

Anything but result: within_boundary means the agent can reach more than Lockpin’s model paths. The prover cannot read credential_binding, which is why the grep removes it.

Keep it that way#

  • Keep all five settings above.

  • Nothing under /lockpin/ is safe to allow, member pages included. host.openshell.internal reaches the host as loopback, so Lockpin treats the sandbox as this machine. With the agent’s key, the model port serves:

    • /lockpin/api/me and its wallets, including opening new ones;

    • grant requests (/lockpin/api/me/grants/ask, .../apply);

    • /lockpin/healthz;

    • join and team pages.

  • Never allow these, whether in the policy, with openshell policy update, or by approving an advisor proposal:

    • host.openshell.internal on any port but the model port;

    • a provider’s API host;

    • lockpin run path prefixes.

  • Do not auto-approve. Do not use openshell rule approve-all, and do not approve proposals automatically.

  • Mount or upload none of these into the sandbox:

    • Lockpin’s data folder;

    • its keys file (lockpin-keys.json);

    • its ledger;

    • lockpin-forwarder.token;

    • a provider key.

  • Keep OpenShell up to date. NVIDIA supports the latest and the previous minor release. NVIDIA’s Security Bulletin 5872 (August 2026) fixed these in OpenShell v0.0.34:

    • two critical sandbox escapes, CVE-2026-65093 and CVE-2026-65083;

    • an L7 REST policy path-traversal bypass, CVE-2026-65092.

Not covered#

  • Any OpenShell version other than v0.1.7, and any runtime or system other than the one tested above.

  • A changed sandbox policy. The sentence at the top holds only while the policy above is unchanged, apart from the agents’ paths and the port.

  • A team node’s forwarder (lockpin node join, /f/…). Run Lockpin itself on the gateway host.

  • Anything outside the sandbox, and bugs in OpenShell itself.