@burtson-labs/bandit-stealth-cli 1.7.565 → 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.
- package/README.md +5 -3
- package/dist/cli.js +1777 -1698
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -106,7 +106,7 @@ guard, not a guarantee of correctness; `BANDIT_VERIFY_BEFORE_DONE=0` disables it
|
|
|
106
106
|
- **Decision cards under the composer** — a permission card or a question from the model is pinned below the input box rather than replacing it: one card at a time (the title counts a batch, `1 of 3`), the keyboard on the card (digits, arrows, Enter, Esc), and anything else you type goes into the box above it, where Enter queues it for after the turn; Tab moves between the box and the card, and a bare `y` or `n` sent from the box answers the card. An answered card leaves one dim line in the transcript (`✓ allowed once · read_file ~/notes.md`, `→ answered · New Year`). A permission card offers three choices up front: **allow once**, **always allow** with the exact rule it would save stated on the row (`any \`npm test …\` command — saved to .bandit/settings.json`, `apply_edit on src/cart.js`), and **deny** (Tab adds a note); **more…** (4) opens the full menu with allow for the turn, allow for the session and deny + note. The always row is only ever a rule narrowed to a command, a path, a site or (for a read outside the workspace) a folder for the session; when only a tool-wide rule exists, or the action asks every time (secrets, destructive commands), the card offers allow once and deny, and the rest under more…. `BANDIT_APPROVAL_CARD=full` keeps the six-option menu on every card. A long card folds to the rows the screen can spare (`Ctrl+E` unfolds it, PgUp/PgDn scroll), so the box is always on screen.
|
|
107
107
|
- **Pointing and clicking in prompts and menus** — question choices, Continue/Submit, permission choices (allow once, always allow, deny, more…, and in the full menu allow turn/session and deny + note; Confirm, Cancel), the MCP trust check, the theme and session pickers, the `/` command list, the `@` file list and follow-up suggestions react to the mouse. Moving the mouse onto an option highlights it exactly as the arrow keys do (a `❯` in the gutter, the label in the accent colour), and a click on the highlighted option answers with it (as Enter does), so any option is one click; a click on a row that is not highlighted highlights it first. Buttons are underlined while the mouse is over them. A `/` command or `@` file is inserted with one click. Arrow keys, digits and Enter keep working, and Alt+1–3 still picks a suggestion. Clicks and hover need a terminal with SGR (1006) mouse reporting and any-motion tracking (1003): the Stealth IDE terminal, VS Code's, iTerm2, Terminal.app, Windows Terminal, kitty, WezTerm, Alacritty and GNOME Terminal have both. Motion is requested only while something clickable is on screen. Over a clickable option the mouse pointer turns into a hand where the terminal lets an app set it (OSC 22): kitty, Ghostty, foot, xterm and iTerm2 3.7+; Terminal.app keeps its I-beam, and WezTerm, VS Code and the Stealth IDE show their arrow while the mouse is captured. `BANDIT_POINTER_SHAPE=0` leaves the pointer alone.
|
|
108
108
|
- **Scrolling and native selection** — the mouse wheel scrolls the terminal's own scrollback as usual: the first wheel tick hands the mouse back to the terminal (that one tick does not scroll), and the next key you type takes it again. While it is handed back, and whenever you hold **Shift** (most terminals), **Option** (iTerm2) or **Fn** (Terminal.app), dragging is the terminal's own selection, copied with its shortcut (Cmd+C on macOS, usually Ctrl+Shift+C elsewhere). Only what is visible on screen can be selected with the in-app drag; for older text scroll up and use the native selection. `BANDIT_MOUSE=0`, `--no-mouse` or `"mouse": false` in `~/.bandit/config.json` turns the mouse features off entirely and leaves the mouse to the terminal.
|
|
109
|
-
- **Selecting text while Bandit works or a card waits** — in the scrollback layout (`--no-fullscreen`) the spinner, the turn view and a decision card leave the mouse to the terminal: drag selects natively and the wheel scrolls, with nothing to hold down; the card answers from the keyboard (its hint ends `Ctrl+G clicks`). **Ctrl+G** hands the mouse to Bandit for clicks, hover and drag-to-copy, and gives it back; a notice at the lower right says which way it went, and the choice lasts for the session. In the full-screen layout Bandit keeps the mouse (the wheel scrolls its transcript) and drag-to-copy works while output streams: the view holds still under the selection until the highlight goes. Ctrl+G
|
|
109
|
+
- **Selecting text while Bandit works or a card waits** — in the scrollback layout (`--no-fullscreen`) the spinner, the turn view and a decision card leave the mouse to the terminal: drag selects natively and the wheel scrolls, with nothing to hold down; the card answers from the keyboard (its hint ends `Ctrl+G clicks`). **Ctrl+G** hands the mouse to Bandit for clicks, hover and drag-to-copy, and gives it back; a notice at the lower right says which way it went, and the choice lasts for the session. In the full-screen layout a decision card leaves the mouse to the terminal too, so its text and the transcript select natively; the wheel then reaches the terminal as arrow keys and moves the card's highlighted choice (Enter still confirms). While Bandit works there it keeps the mouse (the wheel scrolls its transcript) and drag-to-copy works while output streams: the view holds still under the selection until the highlight goes. Ctrl+G gives the mouse to the terminal, or to Bandit, in either layout. `BANDIT_MOUSE=clicks` keeps clicks on cards and mid-turn from the start.
|
|
110
110
|
- **Clickable web links** — labeled links retain their destinations through the live renderer. Stealth opens them in your browser; other terminals use their own link gesture and hyperlink support.
|
|
111
111
|
- **Agentic tool use** — reads files, searches code, runs commands, writes changes
|
|
112
112
|
- **Auditable approval gate** — writes show a colored diff, shell commands show the full command/cwd/risk, and `Allow once` / `Allow session` / `Always for target` scopes are recorded in turn traces. Cards come one at a time (`1 of 3` when a batch needs several decisions, with `apply to all N pending` for siblings of the same tool, never for destructive calls) and collapse to one line once answered
|
|
@@ -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
|
|
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
|
|
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.
|