Skip to content

run.sh: start bravebot with --dangerously-bypass-approvals-and-sandbox - #209

Merged
bbondy merged 1 commit into
masterfrom
bravebot-bypass-sandbox
Nov 1, 2026
Merged

bbondy merged 1 commit into
masterfrom
bravebot-bypass-sandbox

Conversation

@netzenbot

Copy link
Copy Markdown
Collaborator

User impact: ./run.sh --agent bravebot now starts bravebot with its sandbox off, as it already does for codex.

The problem

./run.sh starts bravebot with --dangerously-skip-permissions. That flag skips the permission prompts but leaves bravebot's default sandbox (workspace-write) on, so every program the agent runs is still confined. Per bravebot's --help, the flag that also turns the sandbox off is --dangerously-bypass-approvals-and-sandbox, "as --dangerously-skip-permissions with --sandbox off". run.sh already passes that flag to codex.

Reproduce

tests/sim/sim.sh builds a throwaway deployment with a fake target repo and dummy stories, so no tokens are spent. A stub stands in for the bravebot binary and records the flags it was started with. Story US-003 is the one for issue 103.

  1. BOTSIM_DIR=/tmp/botsim-bypass tests/sim/sim.sh build

  2. Create /tmp/botsim-bypass/fake-bravebot (chmod +x):

    #!/bin/bash
    # Records the flags it was started with; the prompt spans lines.
    { printf 'bravebot'; for a in "$@"; do case "$a" in *$'\n'*) a='<prompt>';; esac; printf ' %s' "$a"; done; echo; } > /tmp/botsim-bypass/argv.txt
    echo done
  3. cd /tmp/botsim-bypass && BRAVE_DEV_LOOP_HOME=/tmp/botsim-bypass/home ./run.sh 1 --agent bravebot --agent-bin /tmp/botsim-bypass/fake-bravebot https://github.com/example/sim/issues/103

  4. cat /tmp/botsim-bypass/argv.txt

Run from master, the run starts US-003 and bravebot is started without --sandbox off:

bravebot --dangerously-skip-permissions <prompt>

Run from this branch (copy its run.sh over /tmp/botsim-bypass/run.sh after step 1), the same command gives:

bravebot --dangerously-bypass-approvals-and-sandbox <prompt>

(run.sh exits 1 in both runs: the stub does not finish the story, so it reports reaching the iteration limit. The sim's repository example/sim does not exist, so gh prints warnings.)

tests/test_bravebot_launch.py runs the bravebot launch cut out of run.sh, one-shot and with tui, against a stub that records its flags. Four of its eight cases (the flag is passed, the old one is not) fail on the parent commit.

The fix

Both bravebot launches in run.sh, the one-shot run and the tui run, now pass --dangerously-bypass-approvals-and-sandbox where they passed --dangerously-skip-permissions. bravebot takes the new flag out of its arguments wherever it sits, as it does the old one, so the -i and --model placement the comment describes still holds.

Test plan

  • make lint — passed
  • make test — 1594 passed, 4 skipped
  • The tests/sim runs above, on master and on this branch
  • make check-reviewdog — no findings; landrun is not installed on this host, so opengrep and pip-audit ran unsandboxed
  • CI passes cleanly
Choices worth a look
  • No real bravebot session was started. The runs above use a stub, so what the new flag does inside bravebot comes from its --help and its argument parser, not from watching a confined program succeed or fail.
  • scripts/lib/agent-launch.sh is unchanged. It still starts bravebot with --dangerously-skip-permissions for the comparison run, its evaluator and scripts/pr-feedback.sh. This PR is about run.sh; those launches stay sandboxed until someone decides otherwise.
  • The agent's programs are no longer confined. bravebot's help recommends the flag "only for machines you can lose".

The loop launched bravebot with --dangerously-skip-permissions, which
skips the permission checks but leaves the default workspace-write
sandbox on. The flag that also turns the sandbox off is the one codex
already gets from this script.
@bbondy
bbondy merged commit d12537a into master Nov 1, 2026
3 checks passed
@bbondy
bbondy deleted the bravebot-bypass-sandbox branch November 1, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants