@burtson-labs/bandit-stealth-cli 1.7.566 → 1.7.568

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +4 -2
  2. package/dist/cli.js +1774 -1695
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -466,6 +466,8 @@ Workspace config overrides user config. Secrets belong in the user-level file, n
466
466
 
467
467
  ### Settings file — hooks, permissions, security guard
468
468
 
469
+ Edit the files by hand, or from the shell: `bandit config get|set|unset|add|remove|path <key> [value] [--workspace]` validates the value and writes atomically — `bandit config add permissions.allow 'run_command:ssh*'`, `bandit config set permissions.autoDecisionTimeoutMs 600000`, `bandit config set gates.prePush '["pnpm check"]' --workspace`. A running session reloads `permissions.allow`/`deny`/`ask` and `gates` within about a second; `permissions.mode` and `offline` apply to the next session (or use `/auto`, `/plan`, shift+tab live). In auto mode a card nobody answers within `permissions.autoDecisionTimeoutMs` (default 15 minutes, `0` = never) is skipped with a desktop notification and the model continues other work; `gates.prePush` lists the checks auto mode runs before a `git push` and refuses the push on failure (without it, the commands named under a gate/push section of AGENTS.md, CLAUDE.md, BANDIT.md or CONTRIBUTING.md). `bandit help config` has the rule syntax.
470
+
469
471
  Plan mode is read-only: the agent reads files, searches and runs read-only commands (`git status`, `ls`, `grep`), and every edit, file write, state-changing command and network write is refused, so it ends with a plan instead of changes. Start a session in it with `bandit --read-only` (also for one-shot prompts: `bandit --read-only "how would you add caching here?"`), or switch with shift+tab or `/plan`; `BANDIT_PERMISSION_MODE=plan` does the same. `--read-only` cannot be combined with `--auto`.
470
472
 
471
473
  Terminal `--auto` mode runs routine work immediately and reviews other actions with the selected provider/model. Reads (`read_file`, `list_files`, `search_code`, read-only commands) run anywhere, outside the workspace included, and are recorded in the auto ledger; the exception is secrets and credentials (`~/.ssh`, `~/.aws`, `~/.bandit-keys`, `.env*`, keychains, cloud CLI credential folders, key material, `secrets.*`/`tokens.*`/`password.*` files), which ask in every mode. Writes and edits outside the workspace, network calls and destructive commands keep their rules. The reviewer considers the raw user requests in the current session, the proposed action and bounded local metadata. Requested cleanup can proceed without a blanket deletion prompt; uncertain effects or missing authorization still ask. External, system and irreversible actions need explicit authorization. Reviews use no tools, have a 12-second deadline, and their decisions appear in the turn log and `/permissions`. Explicit policy rules and security guards remain in force. Targeted edits to existing user-owned temporary helper files can qualify as task-related scratch work when the host verifies file ownership and location; this does not authorize arbitrary temporary-file deletion or replacement. Model review is fallible; `ask` mode remains available when every ungranted action should be reviewed by you.
@@ -655,8 +657,8 @@ bandit-agent --model qwen2.5-coder:32b
655
657
 
656
658
  - **Network** — with `provider=ollama` the conversation goes only to your Ollama server. The other connections Bandit can make, and how to turn each off, are listed under [Network and offline mode](#network-and-offline-mode). Tools that contact another host ask first in the default mode, and `BANDIT_OFFLINE=1` turns all of it off.
657
659
  - **Approval gate** — all file writes show a unified diff before touching disk (unless `BANDIT_AUTO_APPROVE=1`).
658
- - **Command allowlist** — `run_command` only executes from an internal allowlist (git, gh, kubectl, helm, brew, standard *nix tools). Arbitrary shell is refused.
659
- - **Container sandbox (opt-in)** — `bandit --sandbox` or `BANDIT_SANDBOX=1` runs every agent `run_command` / `watch_command` inside a short-lived Docker or Podman container with the same policy as the Stealth IDE: one workspace mount, no network, no Linux capabilities, read-only root, `no-new-privileges`, bounded CPU/memory/pids/output/time, your uid:gid. On a cluster with neither, Apptainer or Singularity run the same image (pulled by digest into a SIF under `$APPTAINER_CACHEDIR/stealth-sandbox` or `~/.bandit/sandbox-apptainer`), as you, with the network namespace checked before every command and the command refused when it cannot be isolated (`sandbox/README.md`, Apptainer). `BANDIT_SANDBOX_RUNTIME=apptainer` (or `docker`, `podman`, `singularity`, comma-separated) picks the runtime. Fail-closed once enabled — no runtime means the command is refused, never quietly run on the host. Image: `ghcr.io/burtson-labs/stealth-sandbox`, chosen from the project's files — the base (node, git, ripgrep, python3, C toolchain) or the dotnet, go, rust or python image built on it; override with `BANDIT_SANDBOX_IMAGE` (a stack name or an image reference). `BANDIT_SANDBOX_INSTALL_NETWORK=1` gives install commands (`npm install`, `pip install`, `dotnet restore`, `go mod download`, …, run on their own) the network; every other command stays offline. Enterprise-managed installs should set `BANDIT_SANDBOX=1` in the environment. Inside the sandbox `run_command` also runs programs the workspace itself provides: a binary the agent just built (`./heat`, `build/heat`), a repo script (`tools/dryrun.sh`), a venv interpreter (`.venv/bin/python`), and a shell given such a script (`bash tools/dryrun.sh`; `bash -c` stays blocked). The allow-list exists to keep the agent from running arbitrary code with your files, keys and network; in the container the workspace mount is the only thing a program can change and there is no network, so a workspace program has the same reach as `make`, `npm test` or `python3 script.py`, which the list already allows. On the host (no `--sandbox`) the allow-list applies as before and the model is told to ask you to run the program. Paths must be relative, contain a `/` and stay inside the workspace (no `..`, `~`, absolute paths or drive letters); the blocked-pattern check runs on every command either way.
660
+ - **Command admission** — `run_command` runs one program with no shell. Built-in programs (git, gh, node/npm/pnpm, python3/pip, cargo, go, dotnet, R/Rscript/julia, Slurm, kubectl, helm, brew, standard *nix inspection tools …) run on their own; any other program runs only when you admit it — approve it on the permission card ("allow once", or "allow `<program>` this session"), or keep a `run_command:<program>*` rule in `permissions.allow` (`bandit config add permissions.allow 'run_command:ssh*'`). Shell interpreters (`bash -c`, `sh`, `zsh`, `pwsh`), `sudo`/`su` and `rm` are never run, approvals included, and a line that needs a shell (`|`, `&&`, `;`, `>`) is refused before any card — the model filters output with `run_command`'s `grep`/`head`/`tail` params instead. A critical command whose only critical finding is the program itself (ssh, scp, rsync) is admitted by your rule without a card; a destructive argument, a credential path or `sudo` still asks.
661
+ - **Container sandbox (opt-in)** — `bandit --sandbox` or `BANDIT_SANDBOX=1` runs every agent `run_command` / `watch_command` inside a short-lived Docker or Podman container with the same policy as the Stealth IDE: one workspace mount, no network, no Linux capabilities, read-only root, `no-new-privileges`, bounded CPU/memory/pids/output/time, your uid:gid. On a cluster with neither, Apptainer or Singularity run the same image (pulled by digest into a SIF under `$APPTAINER_CACHEDIR/stealth-sandbox` or `~/.bandit/sandbox-apptainer`), as you, with the network namespace checked before every command and the command refused when it cannot be isolated (`sandbox/README.md`, Apptainer). `BANDIT_SANDBOX_RUNTIME=apptainer` (or `docker`, `podman`, `singularity`, comma-separated) picks the runtime. Fail-closed once enabled — no runtime means the command is refused, never quietly run on the host. Image: `ghcr.io/burtson-labs/stealth-sandbox`, chosen from the project's files — the base (node, git, ripgrep, python3, C toolchain) or the dotnet, go, rust or python image built on it; override with `BANDIT_SANDBOX_IMAGE` (a stack name or an image reference). `BANDIT_SANDBOX_INSTALL_NETWORK=1` gives install commands (`npm install`, `pip install`, `dotnet restore`, `go mod download`, …, run on their own) the network; every other command stays offline. Enterprise-managed installs should set `BANDIT_SANDBOX=1` in the environment. Inside the sandbox `run_command` also runs programs the workspace itself provides: a binary the agent just built (`./heat`, `build/heat`), a repo script (`tools/dryrun.sh`), a venv interpreter (`.venv/bin/python`), and a shell given such a script (`bash tools/dryrun.sh`; `bash -c` stays blocked). The built-in set exists to keep the agent from running arbitrary code with your files, keys and network; in the container the workspace mount is the only thing a program can change and there is no network, so every non-forbidden program runs there, and a workspace program has the same reach as `make`, `npm test` or `python3 script.py`. On the host (no `--sandbox`) a program that is not built in needs your approval on the card or a `run_command:<program>*` rule, and the model is told so. Paths must be relative, contain a `/` and stay inside the workspace (no `..`, `~`, absolute paths or drive letters); the blocked-pattern check runs on every command either way.
660
662
  - **Pre-tool security guard** (default-on) — configure `security.guard` in your [settings file](#settings-file--hooks-permissions-security-guard) to extend or explicitly disable blocking of catastrophic commands (`rm -rf /`, `curl … | sh`, disk wipes, credential exfil, writes to `/etc` or `~/.ssh`) before they run. Defense-in-depth against the model, applied in both CLI and IDE.
661
663
  - **Custom hooks** — your own `PreToolUse` shell scripts can veto any tool call; configure globally (`~/.bandit/settings.json`) or per-project.
662
664
  - **Workspace trust** — a repository's own `.bandit/settings.json` cannot run hooks, add allow rules or widen the permission mode until you run `bandit trust` in that folder (or set `BANDIT_TRUST_PROJECT_SETTINGS=1` in CI); see [the settings file](#settings-file--hooks-permissions-security-guard). A clone is read-only configuration until you say otherwise.