To run Claude Code unattended without handing it free rein, pair a permissive mode with a check before every command. Sidefleet's worker adds a PreToolUse hook to each Claude Code run, so every tool call is checked against your policies first: it runs, waits for a person to approve it, or is blocked. Sidefleet records every check.
Why is full access on its own risky?
Unattended work means the agent runs commands without asking. Installs, builds and test runs all need that. Claude Code's bypassPermissions mode, the one --dangerously-skip-permissions turns on, allows that. It also allows a push to main, a psql against production or a deploy. The careful modes are safe but stop at the first command that needs a yes, and nobody is there to give it.
Which permission mode should an unattended task use?
| Mode | Claude Code | Codex | opencode |
|---|---|---|---|
| Read & edit files | acceptEdits | Sandbox workspace-write: commands sandboxed, no network | Shell denied |
| Full access | bypassPermissions | No sandbox | All permissions |
| Read only | plan | Sandbox read-only | Plan agent; edits, shell and fetches denied |
| Ask me | acceptEdits, other tools asked on the page | Not offered yet | Not offered yet |
With Ask me, Claude Code edits files on its own and asks you on the page, phone included, before anything else, such as a shell command. A request nobody answers is denied after 15 minutes, and sidefleet run --approval-timeout <secs> changes that. It suits work you check on now and then. For work you won't check on, use Full access with policies on.
What you've already allowed Claude Code on that machine still applies. That means the rules in ~/.claude/settings.json, and the checkout's own .claude/settings.local.json, which the worker copies into each task's worktree.
How do policies check each command?
Before Claude Code runs a tool, the hook asks the worker, and the worker asks the control plane. The control plane matches the call against your org's policies and answers allow, hold or block. Held calls pause the agent until someone answers. The hook runs in every permission mode, Full access included.
A new setup picks a safety level before its first task:
| Level | Blocked | Waits for your OK |
|---|---|---|
| Watch only | Nothing; Sidefleet shows what Balanced would have stopped | Nothing |
| Balanced | Pushes to main and release branches; deletes, drops and truncates against production data | Production database access, deploys, and reading secrets Sidefleet doesn't manage |
| Strict | As Balanced, plus writes outside the task's worktree | As Balanced, plus every shell command and MCP tool. Reading and editing files in the worktree stays allowed. |
Change the level any time under Policies, or write your own rules for the org, a team or one agent. The guardrails page lists what each level does with each kind of action. An install from before policies existed stays Off until someone turns them on.
What happens when a command is held?
- The agent pauses on that command. Nothing else runs in the meantime.
- The approval is tied to that exact command. If the agent changes it, it asks again.
- Answer from the task's thread, the Approvals page, a notification on your phone or your chat app.
- There are four answers: Approve once, Always allow in this repo, Always allow for this agent, or Deny.
- A request nobody answers expires, and the command doesn't run.
How do you check what agents did?
Approvals, blocked commands, policy changes and suspensions go into an audit log you can verify. Its entries are hash-chained, so an edited or deleted entry breaks the chain. You can look into any record, or export the log as CSV or JSONL.
To stop an agent at once, suspend it. It takes no new tasks, its pending approvals are cancelled and its running task stops. Each agent can have an owner, who can answer its approvals.
What can't policies catch?
Policies match patterns: database clients such as psql and mysql, deploy commands such as terraform apply, pushes to protected branches. A command hidden inside a script, or an ssh to a server, can get past them. Treat policies as guardrails, not a sandbox, and keep production credentials off the machines that run agents. A held deploy that waits an hour for you is a far better outcome than one nobody saw.
Codex and opencode are governed per task, not per command. A suspended agent gets no new tasks, and its running ones stop. Only Claude Code calls are checked one by one, and machines need a current Sidefleet build for the checks.
What setup works for unattended runs?
- Start on Watch only for a few days of normal work.
- Read what Balanced would have stopped. If that list looks right, turn Balanced on from the same card.
- Give unattended tasks Full access, so they can build and run tests.
- Turn on Notify me, so a held command reaches your phone instead of waiting until it expires.
- Use Strict for repos close to production, and keep each task in its own worktree so a bad run can't touch your checkout.
Questions
Is Full access the same as --dangerously-skip-permissions?
It runs Claude Code in bypassPermissions mode, the mode that flag turns on. The difference under Sidefleet is the PreToolUse hook, which still checks every call against your policies.
How does Sidefleet know a command touches production?
By matching patterns, such as database clients and deploy commands. It doesn't run the command to find out, which is why a script that hides one can get past it.
Can I try policies without blocking anything?
Yes, that is Watch only. Every command is checked and recorded, nothing is blocked, and Sidefleet tells you how often Balanced would have asked.