Dangerous mode: let your agent run commands, when only you can give it work

Merged
RO
2mo ago
+1119-29

Your agent can read and change files in the folder you start it in, and that's all. It can't run anything: not your linter, not your tests, not git. So "fix this and make sure the tests pass" isn't something it can do. It edits the code and you run the tests.

This adds a dangerous mode you can switch on for your own agent:

basecamp connect setup -P agent --dangerous

With it on, the agent can run any command on your computer, as you. It can run the linter and tests, fix what fails, and commit. Turn it off with --dangerous=false.

Why it's called dangerous

The agent reads the whole thread it's working in, including other people's comments and attachments. With a shell, text anywhere in that thread could steer it into running something on your machine. Everything you can reach, it can reach: your files, SSH keys, your Basecamp login, cloud tokens, the network. So it's off by default, and switching it on is deliberate:

  • You have to type yes. Setup explains what it means and asks you at the terminal. With no terminal (a script, or an AI running the command) it refuses, so an agent can never switch this on for itself.
  • Only for an agent you alone can give work to. If others can give it work (--trust project or --allow), setup refuses and explains why. It gives the one command that makes it possible (--trust operator --dangerous). Letting people in while it's on is refused the same way, and so is changing who the operator is.
  • It's hard to miss. Setup's summary, connect status, connect doctor and the connector's first log line all say it's on.

Why not for shared agents yet

If anyone in a project could give your agent work, anyone in that project could get your computer to run something, as you. Keeping it to you alone means the only person making those requests is you. It will stay off for shared agents until the agent's work can run in a box that holds only the project, with nothing of yours in it to reach.

Making sure it only ever runs your requests

  • The connector reads trust once, when it starts. A connector started while others could give it work never uses dangerous mode, whatever the file says later.
  • If requests from other people are still waiting from when they could give the agent work, the connector starts with dangerous mode off and says so. Those requests run as usual, never with a shell. Once they're done, a restart turns it on.
  • Turning it off applies from the very next decision: the connector reads the setting fresh before every launch and follow-up. A worker already running in dangerous mode finishes what it's doing and is handed nothing more, not even new messages in its thread mid-turn. Once off, it stays off for that run: turning it back on takes a restart. Setup says so, and says how to stop it now if you want to. The off switch works with Basecamp unreachable, and with BASECAMP_TOKEN set.
  • --dangerous=false on its own is the off switch, and it's saved without asking Basecamp anything, so it works offline or with a credential Basecamp no longer takes.
  • Dangerous mode only applies while connect.json names the operator the connector started with, so turning it back on can never hand a previous operator a shell before a restart.
  • If the connector started with dangerous mode off for that run, connect status says so, rather than claiming it's on.
  • Turning it on while a connector is running asks you to restart it.
  • A connect.json edited by hand to be both dangerous and shared is refused when it's read, by setup, status and the running connector alike.

How it works

  • Claude Code workers get every built-in tool, Bash included, and --permission-mode bypassPermissions instead of acceptEdits.
  • Codex workers run without a sandbox, with the network on. The driver checks the session Codex reports is the unsandboxed one it asked for, as it already does for the sandboxed one.
  • Everything else is unchanged: your own Claude and Codex settings are still ignored, only the Basecamp tools are connected, and the worker's environment is still an allow-list.