jdx/mise · error

per-host network filtering (--allow-net=<host>) is not suppo

Error message

per-host network filtering (--allow-net=<host>) is not supported on Linux. Use --deny-net to block all network, or remove --allow-net.

What it means

On Linux, mise's network sandbox is an all-or-nothing seccomp filter installed by seccomp::apply_seccomp_net_filter; per-host allow-listing is only implemented on macOS (endpoint-security based). If effective_deny_net() is true and any --allow-net=<host> entries were supplied on Linux, apply_linux bails with this message instead of silently ignoring the host list.

Source

Thrown at src/sandbox/mod.rs:222

        {
            return self.apply_macos(program, args).await;
        }

        #[cfg(not(any(target_os = "linux", target_os = "macos")))]
        {
            warn!("sandbox is not supported on this platform, running unsandboxed");
            Ok(None)
        }
    }

    #[cfg(all(not(test), target_os = "linux"))]
    fn apply_linux(&self) -> eyre::Result<()> {
        if self.effective_deny_read() || self.effective_deny_write() {
            landlock::apply_landlock(self)?;
        }
        if self.effective_deny_net() {
            if !self.allow_net.is_empty() {
                eyre::bail!(
                    "per-host network filtering (--allow-net=<host>) is not supported on Linux. \
                     Use --deny-net to block all network, or remove --allow-net."
                );
            }
            seccomp::apply_seccomp_net_filter()?;
        }
        Ok(())
    }

    #[cfg(all(not(test), target_os = "macos"))]
    async fn apply_macos(
        &self,
        program: &str,
        args: &[String],
    ) -> eyre::Result<Option<SandboxedCommand>> {
        let profile = macos::generate_seatbelt_profile(self).await;
        let mut sandbox_args = vec![
            "-p".to_string(),

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Remove the --allow-net=<host> flags and keep plain --deny-net to block all network on Linux.
  2. Split the work: run the networked step unsandboxed (no --deny-net) and the pure build step with --deny-net.
  3. Guard flags per-OS in tasks/scripts (e.g. separate linux/macos task variants or shell conditionals) so macOS uses allow-lists and Linux uses deny-all.

Example fix

# before (fails on Linux)
mise x --sandbox --deny-net --allow-net=registry.npmjs.org -- npm ci
# after (Linux): block everything, or run networked step outside sandbox
mise x --sandbox --deny-net -- ./build-offline.sh
mise x -- npm ci
Defensive patterns

Strategy: validation

Validate before calling

#!/usr/bin/env bash
if [ "$(uname -s)" = "Linux" ] && [[ "$*" == *"--allow-net="* ]] && [[ "$*" == *"--deny-net"* ]]; then
  echo 'error: --allow-net=<host> is macOS-only; on Linux use --deny-net alone' >&2
  exit 1
fi
exec mise x --sandbox "$@"

Prevention

When it happens

Trigger: On Linux, running e.g. `mise x --sandbox --deny-net --allow-net=registry.npmjs.org -- npm install` — any combination where --deny-net (or a config equivalent enabling network denial) is active together with a non-empty --allow-net list.

Common situations: Writing cross-platform task definitions or CI scripts that copy macOS sandbox flags to Linux; hardening a build step but still needing one registry host; switching development from macOS to Linux (or Linux CI) with the same flags.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/335ff84c7bff5492. Report an issue: GitHub.