The sandbox overlay separates the privileged panel (artex, holding
PostgreSQL credentials, jwt.key, secret.key, config.json, and LLM keys)
from disposable per-task worker containers (artex-worker:local).
artex(panel): API, UI, DB-only tools (report_finding,insert_assets,record_fact). Never mounts/var/run/docker.sockand never executes agent commands locally whenARTEX_SANDBOX=required(default).artex-runner(:8789on internalrunner-net): The only service mounting/var/run/docker.sock. RequiresAuthorization: Bearer $ARTEX_RUNNER_TOKENon every endpoint includingGET /v1/health. Creates and tracks one worker + one egress proxy per task by Docker label (artex.task=<id>).artex-worker-<id>(artex-worker:local): Runs as10001:10001,--read-only,--cap-drop ALL,--security-opt no-new-privileges:true,--pids-limit 512,--memory 2g,--cpus 2, boundedtmpfson/tmpand/home/exec, mounted only with/app/data/tasks/<id>:/workspace:rw, and attached only to the per-taskinternal: truenetworkartex-task-<id>.artex-egress-<id>(artex-egress-proxy:local): Attached toartex-task-<id>andegress-net. Enforces the task's domain suffix and CIDR allowlists (deny by default, blocking RFC1918, loopback, link-local, metadata endpoints169.254.169.254,fd00:ec2::254,168.63.129.16,100.100.100.200, and IPv6 unless explicitly inARTEX_SCOPE_CIDRS) on both HTTP/HTTPS CONNECT (:3128) and SOCKS5 (:1080) with DNS pinning (no rebinding window). Logs one JSON line per connection to/app/data/egress-audit/<id>/egress.jsonland stdout.
The runner, worker and proxy are part of docker-compose.yml and
docker-compose.ghcr.yml. install.sh and update.sh generate
ARTEX_RUNNER_TOKEN and build the three images:
./install.sh # first install
./update.sh # existing checkoutManual, from a source checkout (put ARTEX_RUNNER_TOKEN in .env once):
docker compose build artex artex-runner
docker compose --profile build-only build artex-worker artex-egress-proxy
docker compose up -dFrom the published images:
docker compose -f docker-compose.ghcr.yml --profile build-only pull
docker compose -f docker-compose.ghcr.yml up -ddocker-compose.sandbox.yml is kept as a compatibility overlay; it is no longer
required.
Starting with this release, ARTEX_SANDBOX defaults to required. If
artex-runner is unavailable, ARTEX refuses to start new tasks and pauses
running tasks rather than falling back to local execution on the panel.
To opt out explicitly in development (degraded mode — logs a prominent startup
warning banner and records sandbox=off in every task event log):
ARTEX_SANDBOX=off-
Tamper-proof egress audit log:
artex-egress-<id>writes JSONL connection logs to a proxy-only bind mount (/app/data/egress-audit/<id>/egress.jsonl, mounted at/audit:rwinside the proxy) and stdout. The worker container only mounts/app/data/tasks/<id>:/workspace:rwand cannot read, truncate, or forge the egress audit log. -
Kernel-backed kill-switch (no agent-writable state):
artex-worker-<id>runs/usr/local/bin/artex-exec-wrap --initas PID 1 (reaping all orphaned children). OnPOST /v1/tasks/{id}/kill,artex-runnerexecutes/usr/local/bin/artex-exec-wrap --kill-uid 10001as uid10001(preserving--cap-drop ALL) scanning/procdirectly (defeatingsetsid,nohup, nested double-forked daemons,trap '' TERM, and/tmptampering), verifies zero non-PID-1 uid-10001 processes remain, and falls back to force-removing the worker container if any check fails. -
Browser &
WebFetchcontainment: InARTEX_SANDBOX=requiredmode, local stdio MCP servers (including the default private browser MCP) are skipped on the panel;WebFetchenforces the task'ssandbox.EgressPolicyon every URL, redirect hop, and pinned dial (with direct retry disabled); and the opt-in panel-hosted shared browser MCP is only attached whentarget_gateis enabled or an explicit egress proxy is configured, with every browser navigation URL gated against the task'ssandbox.EgressPolicy(execution containment + scope-gated panel fetch/browser; full subresource browser network isolation requires running the shared browser behindegress-guardinEGRESS_MODE=enforce). -
No scope drift (
approved_by_operator): Only operator-approvedtask_scoperows (approved_by_operator = true, set exclusively via the operator API/UI orTaskCreateOptions.CompanyIDs) and operatortask_intercept_rulesgrant sandbox egress to Bash,WebFetch, and the shared browser. Agent-added (add_task_scope), auto-added (insert_assets), and expanded rows are coverage-only (approved_by_operator = false). Tasks with no approved scope deny all egress by default.
| Write path | Sets approved_by_operator |
Notes |
|---|---|---|
POST /api/tasks (TaskCreateOptions.CompanyIDs, operator API) |
true |
Operator-selected companies at task creation |
POST /api/tasks/{id}/scope (AddOperatorScope) |
true |
Operator API/UI; promotes existing unapproved coverage row if present |
POST /api/tasks/{id}/retarget (db.RetargetTask) |
true |
Operator retarget to a newly provisioned target host |
add_task_scope (AddAgentScope) |
false |
Agent coverage-only (even if source="manual" is passed) |
insert_assets (AddAutoScope) |
false |
Auto-discovered coverage-only |
spawn_task (CompanyScopeByAgent: true) |
false |
Agent-spawned subtask company links require operator approval before granting sandbox egress |
Archive restore (restoreTaskScopes) |
preserved (false if absent) |
Post-0023 archives preserve approved_by_operator; legacy pre-0023 archives default to false (fail-closed — operators must re-approve scope rows before sandbox egress is granted) |
In ARTEX_SANDBOX=required mode, target-gate approval only clears the tool-call approval gate; worker egress (as well as sandbox WebFetch and shared-browser navigation) still requires an operator-approved Task Scope entry (POST /api/tasks/{id}/scope) or a task allow rule.
This behavior is surfaced explicitly rather than failing silently:
- Approving a pending target-gate request via
POST /api/intercept/pending/{id}/decideorPOST /api/intercept/pending/batch-decideincludessandbox_egress_notein the JSON response whenARTEX_SANDBOX=required. - Every sandbox egress denial from the per-task proxy (
HTTP 403),WebFetch, and the shared browser states verbatim that target-gate approval only clears the tool gate and directs the operator to approve the target in Task Scope.
- Migration
0023_task_scope_operator_approval.sqladdstask_scope.approved_by_operator BOOLEAN NOT NULL DEFAULT FALSEand backfillsapproved_by_operator = TRUEfor all existingsource = 'manual'rows so upgraded operator-scoped tasks retain sandbox egress immediately. - Goal-derived/agent scopes (
source = 'agent', created viaadd_task_scope) and auto-discovered scopes (source = 'auto', created viainsert_assets) remainapproved_by_operator = FALSE(coverage-only) and must be re-approved once via the Task Scope UI (POST /api/tasks/{id}/scope) if sandbox egress is required for those hosts.