Skip to main content

Swif OpenShell Sandbox Policy

Overview

The Swif OpenShell Sandbox Policy sets one Swif-managed policy for the NVIDIA OpenShell sandboxes on a device. OpenShell runs AI agents, such as Claude Code, OpenCode, or OpenClaw, in isolated sandboxes. This policy controls what those agents can reach:

  • Filesystem: which paths agents can read and write

  • Network Access: which hosts and ports agents can connect to

  • Model Endpoints: which model provider APIs agents can call

Swif applies the policy to every local OpenShell gateway on the device, so it covers every sandbox there, including sandboxes created later. Users can't change it from inside a sandbox.

Important: Anything you don't list is blocked. When the policy is enabled, sandboxed agents can only reach the hosts in Network Access and Model Endpoints. This includes model APIs that OpenShell providers would otherwise allow. If both lists are empty, agents can't reach the network or any model at all. List every destination and model endpoint your agents need before you turn on Enabled.


Requirements

Requirement

Details

Operating systems

macOS and Linux

Device ownership

Company-owned and BYOD

Swif agent

Swif Agentic Security agent installed and running. Deploy it with the Apple or Linux Agentic Security Policy.

OpenShell

NVIDIA OpenShell 0.1 or later

Not covered:

  • Windows. OpenShell runs on Windows only inside WSL 2, so the agent doesn't apply this policy there.

  • Remote or shared OpenShell gateways. Swif reports them but never changes them. Only gateways running locally on the device are managed.


What's enforced and when

Area

Enforced?

When changes take effect

Network Access

Yes

Running sandboxes within about 10 seconds. Open connections are closed.

Model Endpoints

Yes

Running sandboxes within about 10 seconds

Filesystem

Yes

Only when a sandbox starts. Running sandboxes keep their old rules until they restart.

Process (run as user and group)

Not yet

OpenShell 0.1 ignores this setting in a centrally applied policy. See Process (not enforced yet) below.

A new policy version is applied at the agent's next policy check, which runs every 20 minutes.


Settings reference

General

Setting

What it does

Default

Enabled

Applies the policy to the device's OpenShell sandboxes and reports drift. Turning it off removes the policy Swif set. A policy someone else set is left alone.

Off

When The Policy Is Removed Or Replaced

What the agent does if someone deletes or replaces the policy on the gateway. report flags the drift. reapply also applies the policy again, reaching running sandboxes within about 10 seconds.

reapply

When A Sandbox Runs Old Filesystem Settings

What the agent does with sandboxes that started before the latest filesystem change. report flags them. restart stops and starts them.

report

Check Interval (Minutes)

How often, in minutes, the agent checks that the policy is still in force and reports drift.

20 (range 20–1,440)

About restart: files in the sandbox's home directory are kept, but running agent sessions end, and /tmp is cleared. Use report if users may be in the middle of agent sessions, and restart sandboxes at a convenient time.

About the check interval: the check runs with the agent's 20-minute policy check, so 20 minutes is the shortest interval.

Filesystem

Paths sandboxed agents can read and write. Every other path is inaccessible.

Setting

What it does

Default

Include Working Directory

Lets the agent read and write the sandbox's working directory.

On

Read-only Paths

Additional absolute paths the agent can read but not change.

Empty

Read-write Paths

Additional absolute paths the agent can read and write. / isn't allowed.

Empty

Require Landlock

When on, a sandbox fails to start if the kernel can't enforce the filesystem rules. When off, it starts without them.

Off

System paths are always included. OpenShell needs these to run, so Swif always adds them, unless you list them with different access:

Access

Paths

Read-only

/usr, /lib, /etc, /app, /var/log, /proc, /dev/urandom, /bin

Read-write

/tmp, /dev/null

Paths must be absolute and can't contain ...

Turn on Require Landlock for the strongest protection. OpenShell enforces filesystem rules with Linux Landlock. When it's off, a sandbox on a kernel without Landlock support runs with no filesystem restrictions.

Network Access

Destinations sandboxed agents can connect to. Each rule has:

Field

What to enter

Required

Name

A unique rule name: 1–64 lowercase letters, digits, or underscores

Yes

Host

A hostname, IP address, or wildcard such as *.example.com. Wildcards need at least three labels, so *.com isn't allowed.

Yes

Port

TCP port, 1–65535

Yes

Protocol

rest to inspect HTTP requests, so you can limit methods with Access. Leave empty to allow any TCP traffic to the host and port.

No

Access

Required when Protocol is rest. See below.

With rest

Binaries

Absolute paths, inside the sandbox, of the programs this rule applies to, such as /usr/bin/curl. At least one.

Yes

Access

HTTP methods allowed

read-only

GET, HEAD, OPTIONS

read-write

GET, HEAD, OPTIONS, POST, PUT, PATCH

full

Every method

A rule applies only to the programs listed in Binaries. Other programs in the sandbox can't use it.

Each entry must be an absolute path inside the sandbox. Where a program lives depends on the sandbox image and how the agent was installed, so check the path in your image. The paths in this article's examples are illustrative.

Model Endpoints

Model provider APIs sandboxed agents can call, such as api.anthropic.com. Each endpoint has:

Field

What to enter

Required

Default

Name

A unique name: 1–48 lowercase letters, digits, or underscores

Yes

—

Host

The model API hostname

Yes

—

Port

TCP port

No

443

Binaries

Absolute paths, inside the sandbox, of the programs that can call this endpoint

Yes

—

Model access that OpenShell providers would normally add is turned off while this policy is applied. List every model endpoint your agents need.

Process (not enforced yet)

The user and group that sandboxed agents should run as.

Field

What to enter

Run As User

sandbox or a numeric UID (1–4294967294). Root isn't allowed. Leave empty to use the image's user.

Run As Group

sandbox or a numeric GID (1–4294967294). Root isn't allowed. Leave empty to use the image's group.

OpenShell 0.1 doesn't enforce this in a centrally applied policy. Sandboxes keep running as their image's user, and every sandbox is reported as process not applied. Swif still sends the setting, so it takes effect automatically if a later OpenShell version supports it.

Report Network Decisions

The agent can report each sandbox's network decisions to the Agent Flight Recorder. This shows, for each agent session, which program tried to reach which host, whether it was blocked, and where decisions were lost, next to the session's other guardrail events.

Setting

What it does

Default

Report Network Decisions

off reports nothing. denied reports blocked connections only. all also reports allowed connections and connections routed to model endpoints, which is far more data.

off

Network Decision Interval (Seconds)

How often, in seconds, the agent reads each sandbox's log for network decisions. Shorter intervals lose fewer decisions from busy sandboxes.

30 (range 10–300)

Only the program, host, and port are reported. URLs, headers, and content are never reported.

The agent reads each sandbox's log on the interval. If a sandbox makes a burst of connections between reads, some decisions can be lost. The Flight Recorder shows these as gaps.

Limits

Item

Maximum

Filesystem paths, including the 10 system paths Swif adds

256

Length of a filesystem path

4,096 bytes

Network Access rules

128

Model Endpoints

32

Binaries per rule or endpoint

32

Length of a host

253 characters

Rule names can't start with _provider_ or swif_inference_. OpenShell and Swif reserve these prefixes, and Swif rejects names that use them.


Before you start

  1. Install OpenShell and the Swif agent on the devices.

  2. List the destinations your agents need, such as github.com, your package registries, and internal APIs, with the ports they use.

  3. List the model endpoints your agents call, such as api.anthropic.com or api.openai.com.

  4. Find the program paths inside the sandbox for each rule, such as /usr/bin/git or the path to your agent's runtime. OpenShell's denied-request logs show which programs tried to connect and were blocked.

  5. Decide how to handle running sandboxes after filesystem changes: report them, or restart them automatically.

  6. Choose a pilot group of devices.


Create the policy

  1. In Swif, go to Agentic Security > Policies.

  2. Select Swif OpenShell Sandbox Policy.

  3. Under Filesystem, add any paths agents need beyond the working directory.

  4. Under Network Access, add each destination agents need.

  5. Under Model Endpoints, add each model API agents call.

  6. Set what happens when the policy is changed on the device, and when sandboxes run old filesystem settings.

  7. Optionally, set Report Network Decisions to denied.

  8. Turn on Enabled.

  9. Assign the policy to your pilot devices and save.


Example configurations

Example 1: Coding agent with GitHub and Claude

Section

Setting

Filesystem

Include Working Directory: On; Require Landlock: On

Network Access

Name: github; Host: github.com; Port: 443; Binaries: /usr/bin/git

Model Endpoints

Name: anthropic; Host: api.anthropic.com; Port: 443; Binaries: the agent's runtime, such as /usr/local/bin/node

Report Network Decisions

denied

The agent can work in its working directory, use Git with GitHub, and call Claude. Everything else is blocked, and blocked connections are reported to the Flight Recorder.

Example 2: Read-only access to an internal API

Section

Setting

Network Access

Name: docs_api; Host: docs.internal.example.com; Port: 443; Protocol: rest; Access: read-only; Binaries: /usr/bin/curl

The agent can read from the internal docs API with curl, but it can't send POST, PUT, PATCH, or DELETE requests to it.

Example 3: Strict rollout

Setting

Value

When The Policy Is Removed Or Replaced

reapply

When A Sandbox Runs Old Filesystem Settings

restart

Require Landlock

On

Report Network Decisions

all

Network Decision Interval (Seconds)

10

Filesystem changes apply right away, by restarting sandboxes, and every network decision is recorded. Use this only where users have been told that sandboxes may restart and running agent sessions may end.


Turn off or remove the policy

Turning off Enabled, or unassigning the policy, removes only the policy Swif set. Policies that someone else set on the device are left alone.


Troubleshooting

Swif rejects a rule name

Names can't start with _provider_ or swif_inference_, which are reserved. Names must also be lowercase letters, digits, or underscores: up to 64 characters for Network Access rules, and up to 48 for Model Endpoints.

The agent can't reach the model or any website

The host isn't listed. When the policy is enabled, everything not in Network Access or Model Endpoints is blocked, including model access that OpenShell providers would otherwise add. Add the missing host, and check that Binaries includes the program making the connection.

A host is listed, but connections are still blocked

  • Check that Binaries includes the exact path, inside the sandbox, of the program making the connection.

  • Check the port.

  • With Protocol set to rest, check that Access allows the HTTP method the program uses.

  • Set Report Network Decisions to denied to see which program and host were blocked.

A filesystem change didn't take effect

Filesystem rules apply only when a sandbox starts. Restart the sandbox, or set When A Sandbox Runs Old Filesystem Settings to restart.

A sandbox won't start

Require Landlock is on, and the kernel can't enforce the filesystem rules. Update the kernel to one that supports Landlock, or turn off Require Landlock.

Sandboxes are reported as "process not applied"

This is expected. OpenShell 0.1 doesn't apply Run As User or Run As Group from a centrally applied policy.

The policy was changed on the device

Swif reports this as drift. With When The Policy Is Removed Or Replaced set to reapply, Swif applies its policy again.

The Flight Recorder shows gaps in network decisions

A sandbox made more connections between reads than the agent could capture. Lower Network Decision Interval (Seconds).

The policy doesn't apply on Windows

This is expected. OpenShell runs on Windows only inside WSL 2, which this policy doesn't cover.


Related resources

Swif

NVIDIA

Did this answer your question?