zeroclaw-labs/zeroclaw · error · anyhow::Error

--level domain-block requires at least one --domain

Error message

--level domain-block requires at least one --domain

What it means

The domain-block level blocks named network domains, so at least one `--domain` is required; `build_engage_level` bails when the domains list is empty before engaging.

Source

Thrown at src/main.rs:6597

    tools: Vec<String>,
) -> Result<security::EstopLevel> {
    let requested = level.unwrap_or(EstopLevelArg::KillAll);
    match requested {
        EstopLevelArg::KillAll => {
            if !domains.is_empty() || !tools.is_empty() {
                bail!("--domain/--tool are only valid with --level domain-block/tool-freeze");
            }
            Ok(security::EstopLevel::KillAll)
        }
        EstopLevelArg::NetworkKill => {
            if !domains.is_empty() || !tools.is_empty() {
                bail!("--domain/--tool are not valid with --level network-kill");
            }
            Ok(security::EstopLevel::NetworkKill)
        }
        EstopLevelArg::DomainBlock => {
            if domains.is_empty() {
                bail!("--level domain-block requires at least one --domain");
            }
            if !tools.is_empty() {
                bail!("--tool is not valid with --level domain-block");
            }
            Ok(security::EstopLevel::DomainBlock(domains))
        }
        EstopLevelArg::ToolFreeze => {
            if tools.is_empty() {
                bail!("--level tool-freeze requires at least one --tool");
            }
            if !domains.is_empty() {
                bail!("--domain is not valid with --level tool-freeze");
            }
            Ok(security::EstopLevel::ToolFreeze(tools))
        }
    }
}

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Add one or more `--domain <host>` values
  2. Check flag spelling and shell expansion: the flag is `--domain` (repeatable) and variables must expand non-empty
  3. Use no `--level` (kill-all default) if a global stop was intended

Example fix

# before
zeroclaw estop --level domain-block
# after
zeroclaw estop --level domain-block --domain api.example.com
Defensive patterns

Strategy: validation

Validate before calling

if [ "$level" = "domain-block" ] && [ "${#domains[@]}" -eq 0 ]; then
  echo "--level domain-block requires at least one --domain"; exit 2
fi

Prevention

When it happens

Trigger: `zeroclaw estop --level domain-block` with no `--domain` flags supplied.

Common situations: Typo in the flag name (`--domains`); flags lost behind a `--` separator or unexpanded empty shell variable in scripts; forgetting the selector when switching from kill-all.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/e26fd46b02fb2f13. Report an issue: GitHub.