Reference
Sandbox and security
Where the code agents write runs, what it can reach, and how to deploy Artiwright safely.
Agents build documents by writing code (artiwright_run). That code runs in a sandbox: a separate Node.js process
per active session, started with Node’s permission model.
What the sandbox is for
Section titled “What the sandbox is for”The sandbox contains mistakes in code an AI writes, such as writing outside the session or running for ever, and makes abuse harder. Don’t rely on it alone against someone deliberately attacking it: Node.js documents its permission model as a seat belt rather than a guarantee against malicious code, and the network is turned off in JavaScript, not by the operating system. When users you don’t trust send files or prompts, add the setup for untrusted input around it.
What agent code can and can’t do
Section titled “What agent code can and can’t do”| Boundary | In the sandbox |
|---|---|
| Files | Reads only Artiwright’s own packages and the session folder; writes only the session folder |
| Processes and threads | Denied: no child processes, worker threads or inspector |
| Native code | No native addon loads after start-up (the renderer’s loads before any agent code runs) |
| Network | Turned off in JavaScript: outbound connections, listening, DNS queries and UDP (fetch, http and https, net, tls, dgram, dns) |
| Environment | Empty apart from three settings: no keys or tokens from the server |
| Time and memory | Stopped after 60 seconds, and the call changes nothing; 1 GB of memory per process |
| Failures | A crash or timeout replaces the process; the saved document is untouched |
A session’s first call that needs the document (a run, or opening, drawing or checking it) starts its process, in about a second; later calls reuse it.
Limits to know
Section titled “Limits to know”ARTIWRIGHT_SANDBOX=off(orsandbox=Falsein Python) runs agent code, and the reading and drawing of files, inside the server process. Use it only on your own machine, with agents you trust.- Over HTTP the server doesn’t open files by path on a client’s behalf; clients send a file’s contents.
- Files are limited to 300 MB, and a file that unzips to far more than its size (a zip bomb) is refused. Engine calls time out after two minutes.
- A file you open is read, laid out, drawn and checked in its session’s sandbox process too (
artiwright_open,inspect,render,lint,applyandfinalize), so the fonts and pictures inside it are parsed there, never in the server process. These calls stop after 5 minutes. - A file from elsewhere can link to outside resources, such as a picture on a network share that loads when the file
opens. Artiwright keeps them as they were, and
artiwright_finalizelists each one as a warning so the agent can remove it or keep it knowingly. - A local server (stdio, as desktop apps run it) saves finished files with
artiwright_finalizeinto your working folder or any path you name that your account can write, and never overwrites a file. Over HTTP, finished files stay in the session’s outputs folder.
Setup for untrusted input
Section titled “Setup for untrusted input”For untrusted users or several tenants, run the server in the container image with the operating system doing the isolating:
- Run it as the image’s non-root user, with no outbound network, a read-only root filesystem (a volume for sessions and a
tmpfsfor/tmp), all Linux capabilities dropped andno-new-privileges. - Use a long random
ARTIWRIGHT_MCP_TOKENkept in a secret store (the server won’t listen beyond localhost without one), and serve it behind HTTPS. - Keep the sandbox on. Keep each tenant’s sessions in a separate folder, or a separate server.
- Delete old sessions on a schedule.
- Keep Artiwright up to date.
Your data
Section titled “Your data”Artiwright runs where you run it. Documents stay in the sessions folder you choose, and Artiwright sends nothing
anywhere: no telemetry, no usage reports. The only download is the Python package fetching its own JavaScript
dependencies from npm on first use (or when you run artiwright-setup). Your model provider sees what your agent sends
it, as with any other tool.