Seshat AIDocumentation

Documentation / Concepts

Sandboxing

How Seshat confines the shell commands the model runs: no isolation, Landlock on Linux, or a Docker container, and how to require one.

The bash tool lets the model run shell commands. A command runs with your rights, so Seshat can confine it. This page explains the three levels, how to choose one, and what happens when the one you asked for is not available.

Three levels

LevelWhat it doesWhere it works
NoneThe command runs directly on the host, with your rightsEverywhere. It is the only level on Windows and macOS unless you choose Docker
LandlockThe command can read the system but can write only inside the working folderLinux, when the kernel supports Landlock
DockerThe command runs inside a container, and only the working folder is shared with the hostAnywhere Docker runs

Landlock is used automatically on Linux when it is available. Docker is something you ask for.

Choosing a level

A bash commandasked by the modelSandboxKind ?Docker answers at start ?In a containeronly the working folderis shared with the hostLandlock available ?Confinedreads the system,writes only in the working folderRequireSandbox ?Refusedsandbox required butunavailable on this hostRuns unconfined, with a warning in the logthe command has your rights: this is the default on Windows and macOSDockeryesnoLocal, the defaultyes (Linux)noyesno
If Docker does not answer, Seshat falls back to the local level and writes a warning in the log. RequireSandbox turns the last case into a refusal.

In Go, two fields of ClientConfig decide:

cfg.SandboxKind = sdk.SandboxKindDocker // or sdk.SandboxKindLocal, the default
cfg.RequireSandbox = true               // refuse to run a command without a sandbox
  • SandboxKindLocal (the default) uses Landlock where it exists, and nothing elsewhere.
  • SandboxKindDocker runs the commands in a persistent container. If Docker is not reachable when the client starts, Seshat falls back to the local level and writes a warning in the log.
  • RequireSandbox turns an unconfined command into an error. When no sandbox is available, bash refuses with “sandbox required but unavailable on this host: refusing to run the command unconfined”.
SituationAdvice
A desktop applicationLeave RequireSandbox off. Refusing to run bash at all is often worse than a visible warning
A shared serverAlways set RequireSandbox. An unconfined command runs with the rights and the environment of the server

What the Docker level does

The working folder of the session is shared with the container, and appears there as /workdir. Everything else the command sees is the image. The defaults are meant to be careful, and you can change each one through ClientConfig.SandboxDocker:

SettingDefaultEffect
BaseImageubuntu:24.04The image of new containers
SetupCommandsnoneShell commands run once, when a container is created, for example to install tools
WorkDir/workdirWhere the working folder appears in the container
EnvnoneVariables always set in the container
NetworkAccesstrueSet it to false for no network at all
MemoryLimitMB2048The memory the container may use
CPULimit2.0The CPUs the container may use
RuntimeDocker’s defaultA stronger runtime such as runsc (gVisor). It must already be set up in Docker. If it is not, the health check fails instead of running without it
PublishPortsnoneContainer ports to publish, for example to preview a development server the agent starts
TrackFileChangesfalseKeep a git history of the changes made in the working folder, in a separate repository, as an audit and undo aid. It needs git on the host

Which level am I running at?

client.SandboxKind() reports the sandbox this client actually resolved to: Docker only if you asked for it and Docker answered its health check at startup. sdk.SandboxAvailable() answers a different question: is Landlock available on this host? Use the first to show your users the real state. See Integrating in your product.

What the sandbox does not do

  • It confines the commands of the bash tool. It does not replace permissions: a command that deletes your files inside the working folder is still a command that can delete them.
  • It does not hide the working folder. Anything in it, a .env file included, can be read by the command.
  • The environment of the commands is filtered separately: variables whose name says secret (*_API_KEY, *_TOKEN…) are not passed on. See Security and trust.

Updated on 2026-10-14