Sandbox Commands

Every command the sandbox module offers, from its declarations, in order of the resource each acts on. Each command's help says the same.

Log

lnk sandbox log show

Show every call on the sandboxes' wires, their one way out

lnk sandbox log show [--json] [--lines <lines>] [--refused] [--sandbox <sandbox>]
  • --json, boolean: Print the answer as JSON for other programs
  • --lines, -n, integer: How many of the latest calls to show [default: 40]
  • --refused, boolean: Only the calls refused
  • --sandbox, string: Only this sandbox's calls (main-link, alice)

It answers sandbox.log.

Permission

lnk sandbox permission list

List what a sandbox can be opened to: a spec's sections and flags

lnk sandbox permission list

It answers sandbox.ended.

Question

lnk sandbox question list

List the questions waiting on your answer

lnk sandbox question list [--json]

It takes --json, boolean: Print the answer as JSON for other programs. It answers sandbox.asked.

Sandbox

lnk sandbox answer

Answer a question waiting: allow a call once, or refuse it

lnk sandbox answer <id> <answer>

It takes answer, position 2, one of yes, no, required: Your answer. It takes id, position 1, string, required: The question's id. It answers sandbox.ended.

lnk sandbox check

Test the sandbox: try from inside it what it shouldn't allow

lnk sandbox check [--ready] [--upstream <upstream>] [--yes] [--spec <file>] [field flags]
  • --ready, boolean: Only make sure the sandbox can run on this machine, trying nothing from inside
  • --upstream, string: Where its internet traffic leaves from: direct, a SOCKS5 upstream on this machine (socks5://127.0.0.1:, or socks5:// with a Unix socket's absolute path), or an HTTP proxy on its loopback (http://127.0.0.1:), handed each host's name [default: direct]
  • --yes, boolean: Say yes to what it would ask

It reads the sandbox spec, from a file or its field flags. It answers sandbox.ended.

lnk sandbox learn

Run a command once with every program open, and list those to allow

lnk sandbox learn [-- <commands>...] [--upstream <upstream>] [--yes] [--spec <file>] [field flags]
  • commands, after --, list of string, required: The command, after --
  • --upstream, string: Where its internet traffic leaves from: direct, a SOCKS5 upstream on this machine (socks5://127.0.0.1:, or socks5:// with a Unix socket's absolute path), or an HTTP proxy on its loopback (http://127.0.0.1:), handed each host's name [default: direct]
  • --yes, boolean: Say yes to what it would ask

It reads the sandbox spec, from a file or its field flags. It answers sandbox.ended.

lnk sandbox list

List the sandboxes this machine knows, running or not

lnk sandbox list [--json] [--paused]

It takes --json, boolean: Print the answer as JSON for other programs. It takes --paused, boolean: Only the sandboxes whose way out is paused, and why. It answers sandbox.sandboxes.

lnk sandbox run

Run a command in the sandbox: your files and network closed

lnk sandbox run [-- <commands>...] [--upstream <upstream>] [--yes] [--spec <file>] [field flags]
  • commands, after --, list of string, required: The command, after --
  • --upstream, string: Where its internet traffic leaves from: direct, a SOCKS5 upstream on this machine (socks5://127.0.0.1:, or socks5:// with a Unix socket's absolute path), or an HTTP proxy on its loopback (http://127.0.0.1:), handed each host's name [default: direct]
  • --yes, boolean: Say yes to what it would ask

It reads the sandbox spec, from a file or its field flags. It answers sandbox.ended.

lnk sandbox show

Show each running sandbox: its proxy, and what it has carried each way

lnk sandbox show [name] [--json]

It takes --json, boolean: Print the answer as JSON for other programs. It takes name, position 1, string: Only this sandbox (main-link, alice). It answers sandbox.carried.

lnk sandbox start

Open the sandboxes' ways out again: every wire, or one sandbox's

lnk sandbox start [name]

It takes name, position 1, string: Only this sandbox (main-link, alice; lnk sandbox list names them). It answers sandbox.ended.

lnk sandbox stop

Stop every sandbox's way out at once, and the programs sandboxed here, or one sandbox's way out

lnk sandbox stop [name]

It takes name, position 1, string: Only this sandbox (main-link, alice; lnk sandbox list names them). It answers sandbox.ended.

Tool Call

lnk sandbox tool-call list

List a tool's calls, from its server, started here

lnk sandbox tool-call list <name>

It takes name, position 1, string, required: The tool. It answers sandbox.ended.

Tool

lnk sandbox tool add

Add a tool: an MCP server that runs outside the sandbox

lnk sandbox tool add <name> [--allow <allow>] [--ask <ask>] [--ask-if <ask-if>] [--ask-if-hint <ask-if-hint>] [-- <command>...] [--env <env>] [--header-file <header-file>] [--shared] [--url <url>]
  • --allow, list of string: A call that doesn't ask (repeatable): the server's own name for it, as lnk sandbox tool-call list lists them
  • --ask, one of all, none: Which calls ask you: all but those allowed, or none [default: all]
  • --ask-if, list of string: A call that asks by one of its boolean arguments, . (repeatable): asked unless that argument is given false, even when --allow names the call (schedule.recurring)
  • --ask-if-hint, string: With --ask-if, what lets a call it asks by through, in the words of whoever added the tool (an owner's setting): named when the call is refused with no one to answer, since --allow doesn't
  • command, after --, list of string: The server's command (stdio), after --
  • --env, list of string: A variable for its environment, NAME=value, or NAME for its value here (repeatable): AWS_PROFILE, NODE_EXTRA_CA_CERTS. A secret's name alone (GITHUB_TOKEN), never its value on the command line
  • --header-file, path: With --url, a file of headers sent with each request, Name: value a line (Authorization: Bearer <token>), or - for standard input: never on the command line, where other users of this machine can see them
  • name, position 1, string, required: Its name: lowercase letters, digits and dashes (gh)
  • --shared, boolean: One server for every session of every sandbox naming it, started when first needed and stopped once idle, not one each: a shared memory
  • --url, string: A server at a URL instead (streamable HTTP): https://, or http:// on this machine

It answers sandbox.ended.

lnk sandbox tool list

List the tools, and which calls ask

lnk sandbox tool list [--json]

It takes --json, boolean: Print the answer as JSON for other programs. It answers sandbox.tools-listed.

lnk sandbox tool remove

Remove a tool: no sandbox reaches it anymore

lnk sandbox tool remove <name>

It takes name, position 1, string, required: The tool. It answers sandbox.ended.