8000 Consider an operator-selected, caller-managed sandbox mode · Issue #197 · jiggy/jig · GitHub
[go: up one dir, main page]

Skip to content

Consider an operator-selected, caller-managed sandbox mode #197

Backlog

Description

@zvictor-mechatron

ELI12

We let coding agents work on Jig projects inside a restricted account on NixOS. They need to inspect, review, and run the Flows they edit. The agent already works inside a sandbox, and Linux prevents Jig's sandbox from setting itself up inside it. Even asking Jig to draw a Flow diagram fails because Jig has to run part of the project to work out what the diagram should show.

Could the person running Jig explicitly choose to have their existing sandbox protect that session? We would like Jig to keep protecting users by default and clearly label runs where the operator takes responsibility for isolation.

Use case and evidence

Our agents run under a dedicated, unprivileged NixOS account with Nono. We give each session worktree access, selected network and local socket access, and access to the shared Nix store. We already trust these sessions to build and test the code they edit. The goal is to support ordinary Jig development in that same session while keeping the runner's permissions and shared development environment.

Live jig inspect --flow succeeded from an ordinary SSH shell under the runner account and reported SANDBOX_UNAVAILABLE from its Nono-wrapped session. Jig evaluates the working declarations and their imports for live inspection, which explains why inspection needs an execution boundary. There were two setup problems. The restricted session blocked IPC used to request a delegated systemd scope, and supplying a delegated scope and private /proc still left Bubblewrap unable to set up its mount namespace. Inspection entry point · Linux delegation

I independently minimized the mount failure on x86_64 NixOS with Linux 6.18.63, Nono 0.82.0, and Bubblewrap 0.12.0. With the Nix-packaged binaries on PATH, run this in Bash as an unprivileged user on a host where unprivileged Bubblewrap works:

(
  probe=$(mktemp -d "$PWD/.jig-containment-probe.XXXXXXXX") || exit 1
  trap 'rmdir -- "$probe"' EXIT
  cd "$probe" || exit 1
  bwrap_path=$(command -v bwrap)
  true_path=$(type -P true)
  "$bwrap_path" --unshare-user --ro-bind /nix/store /nix/store -- "$true_path"
  printf 'direct exit=%s\n' "$?"
  nono run --read /nix/store --allow /proc -- \
    "$bwrap_path" --unshare-user --ro-bind /nix/store /nix/store -- "$true_path"
  printf 'under nono exit=%s\n' "$?"
)

The direct command exited 0. Under Nono it exited 1 with bwrap: Failed to make / slave: Operation not permitted. The /proc grant above is for the synthetic probe. It isolates the mount problem without Jig, a project checkout, or any systemd setup. Linux documents that processes with Landlock filesystem restrictions cannot modify mount topology. The Jig source links identify the revision inspected for this report. Linux Landlock documentation

Proposed scope

  • Keep Jig's built-in, fail-closed sandbox as the default. Offer an explicit caller-owned option, for example --sandbox=caller-managed or --unsafe, that can be selected in the CLI or in operator configuration outside the project. A repository-controlled setting should never select it, and a failed sandbox setup should never fall back to it.
  • Let a caller-managed development session inspect, review, and run. A run-only flag would help with an existing approved revision, but agents editing Flows need to prepare and review the new revision as well. Keep exact-revision approval, dependency-integrity checks, and the credential and descriptor m 62E2 inimization that can still be applied. Keep the mode distinct from approval flags.
  • Record caller-managed containment in the output and retained results. Project code and its dependencies can use whatever files, sockets, and network the caller lets them reach. Jig's own per-Flow isolation and resource ceilings should be reported only when enforced, and cancellation and descendant cleanup should be reported according to what Jig can actually verify. A host-supplied backend could eventually supply per-Flow guarantees if those are essential, but an existing outer sandbox alone is useful when the operator accepts its wider scope.

Please evaluate this against Jig's security and execution principles first. If an explicit caller-managed mode fits, we'd like it to cover the full inspect, review, run, and cancel workflow. If independently enforced per-Flow isolation or verified cleanup is fundamental to a Jig Run, please consider a narrower extension, such as caller-managed inspection or a host-provided backend. Please move forward only if the request fits Jig's design.

Activity

  1. zvictor-mechatron commented on Nov 24, 2026

    @zvictor-mechatron
    ContributorAuthor

    Following up on the original request. We'd like to preserve Jig's per-Flow permissions, resource limits, and verified cleanup, and qualify a stock NixOS configuration for agents working in separate Orca worktrees.

    Would Jig be willing to provide and maintain a pinned NixOS reference configuration? The goal is for agents to use ordinary jig inspect --flow, jig review, and jig run commands with independent cgroup delegation. We can validate the configuration on our Orca host with overlapping worktrees, cancellation, deadline expiry, and coordinator loss. We'll independently check that the affected cgroup is empty and that the other worktree keeps running.

    Would you also take an operator-configured HTTPS proxy for dependency preparation as a separate Jig feature? We can test an uncached locked fetch with direct egress blocked, failure when the proxy is unreachable, and the existing authorization requirement for resolving a missing lock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0