Task-level block rules do not constrain sandbox egress, so a deny rule is bypassable by Bash in the default mode

Open
#802 4 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

@00xcyd is already working on this.

Since Dec 2, 2026.

  • #821 by @00xcyd — open

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
docker, go

Research direction

Start with server/sandbox.go and sandbox/policy.go, then trace how SandboxRunInfo reaches the ARTEX_* container environment and artex-egress-proxy. Read the gate contract in intercept/target_gate_pg_test.go and check how sandbox WebFetch handles URLs and redirects. Done means block rules consistently deny matching sandbox egress, including when a host is also allowed, with the chosen behavior documented in the changelog.

Written by the indexing model from the issue text.

Description

bug P1

Problem

A task-level block (deny) rule is evaluated in two places: the target gate (intercept/target_gate.go) and asset insertion (db/asset_intercept_match.go). Neither sees the traffic of a sandboxed worker, and the sandbox egress policy does not read block rules at all.

With ARTEX_SANDBOX=required (the default since 0.7.1), Bash runs in artex-worker, whose network is enforced by artex-egress-proxy against sandbox.EgressPolicy. That policy is an allowlist only:

  • sandbox/policy.go:129 — EgressPolicy has Domains and CIDRs; there is no deny list field.
  • server/sandbox.go:66-155 — taskSandboxRunInfo builds that list from task_scope rows with approved_by_operator = true, frozen company grants (task_scope_egress), and task_intercept_rules where action='allow'. Block rules are never read.

Impact

A task-level deny rule does not stop a worker curl/python/nmap to any host the task already has in scope. Operators reasonably read the rule editor as an enforcement control — the same reading the UI now invites by putting the target gate next to it.

Concretely: task scope approves example.com; an operator adds a block rule for admin.example.com; the planner's worker fetches it with curl and the rule never fires. Only the target gate would stop it, and the gate never sees the socket.

Proposal (needs a design decision, not a quick patch)

  1. Read task_intercept_rules with action='block' in taskSandboxRunInfo and propagate them as a deny list through SandboxRunInfo → EgressPolicy → ARTEX_* container env → artex-egress-proxy, matching the existing "block wins over allow" order documented for the gate.
  2. Decide the semantics for a pattern that is both allowed (scope/company) and blocked (rule): block should win, as it does at the gate.
  3. Decide whether the deny list also applies to WebFetch in sandbox mode, which currently enforces EgressPolicy per URL and redirect hop — it should, for consistency.
  4. Migration/behaviour note: this narrows egress for existing tasks that carry block rules today; that is the intent, but it belongs in the changelog as a security fix.

Related

The gate's own contract is documented in intercept/target_gate_pg_test.go ("Task allow rules play no role in the gate: they neither satisfy it nor restrict it. Block rules, global and of the task, always win."), which is the behaviour the sandbox path should mirror.

Dominant language
Go
Stars
18.7k
Forks
7k
Avg merge
10h 57m
Merged PRs (30d)
494

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from BaaRai/ARTEX

All issues in BaaRai/ARTEX

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.