quiet robotBook a call

Sandboxes

Approvals

Approval rules hold risky commands until a person approves or denies them in the dashboard.

View as Markdown

Sandboxes is in early access. It is free to try, some parts are still in testing, and details may change. Sign up free

An approval rule is a pattern. When a command matches one of your organization's rules, it doesn't run. The API answers 202 with an execution in pending_approval, and the command waits for a person.

Default rules

Every new organization starts with these. You can turn them off, edit them or add your own in the dashboard under Policy.

RuleCatches, for example
Recursive force deleterm -rf build, rm -fr /tmp/x
Privilege escalationsudo apt install …, su root
Pushing code to a remotegit push origin main
Sending data out with curl or wgetcurl -X POST …, curl --data …, wget --post-file …
Remote shell or file copyssh, scp, sftp, rsync

Rules are regular expressions, matched case-insensitively against the whole command. A rule whose pattern doesn't compile holds every command, so a typo fails safe.

What happens to a held command

  1. exec returns 202 with status: "pending_approval" and approval.reason, the rule's description.
  2. The command shows up in the dashboard under Approvals, with who asked (which API key or person) and the exact command.
  3. A signed-in person approves or denies it, with an optional note.
    • Approve: the command runs then, with the cwd, env and timeout it was sent with. The execution moves to running, then completed or failed.
    • Deny: the execution becomes denied. It never runs.
  4. Both the request and the decision are in the audit log.

An API key can't approve. POST /api/v1/executions/{id}/approve and /deny only work for a signed-in dashboard session. A key gets 403 forbidden.

Approvals guard against an agent, not against a teammate. Any signed-in member of the organization can approve a held command, including one they sent themselves. Rules match the text of the command, so they catch the usual forms and a determined person can word around them. To limit what a sandbox can reach whatever runs in it, use the network policy.

Waiting for the decision

Poll GET /api/v1/executions/{id} until status is no longer pending_approval or running. The SDK does this for you:

TypeScript
try {
  const run = await sbx.exec("git push origin main", {
    onPending: (e) => console.log(`Waiting for a person: ${e.approval?.reason}`),
    approvalTimeoutMs: 15 * 60_000, // default 30 minutes
  });
  console.log(run.exitCode);
} catch (e) {
  if (e instanceof CommandDeniedError) console.log("Denied:", e.message);
  else throw e;
}

Pass waitForApproval: false to get the pending execution back straight away.

Tip

Rules match the text of the command. They're a seatbelt for an agent that means well, not a wall against code that's trying to hide. The outbound network rules are the wall: they hold whatever the command looks like.