Sandboxes
A sandbox is a hidden branch for one task. Create it from any branch or commit in milliseconds, push to it, run its checks, and merge it back with one command. Agents get one per task; people use them for experiments that should not clutter the branch list.
How a sandbox works
- Its ref is
refs/sandbox/<owner>/<name>. The owner isa-<agent>for an agent andu-<id>for a person; the name is yours to pick (lowercase letters, digits,.,_and-, up to 64), or a generated one. - It does not show up in branch lists, ref advertisements or clones. Fetch it by name when you need it.
- Only its owner and the repository's owners push to it. A push never creates one: create it with the CLI, the API or the
sandbox.createtool. - It expires after 24 hours without a push. People can ask for up to 30 days, agents up to 7. An ended sandbox is kept for 7 days for its history.
From creation to merge
Create it
From
main, with a git worktree for it next to your clone:Shellrebasely sandbox create --from main --name fix-login --worktree ../fix-loginWithout
--worktree, the CLI prints the fetch, worktree and push commands instead.Push to it
Shellcd ../fix-login git commit -am "Fix the login redirect" git push origin HEAD:refs/sandbox/<owner>/fix-loginRun its checks
Workflows run on a sandbox only if they declare
on: sandbox, and such runs never get secrets.--waitfollows them and exits 1 if one fails.Shellrebasely sandbox checks fix-login --waitMerge it
Shellrebasely sandbox merge fix-login --into main --mode squash--modeisff(the default),mergeorsquash. A merge or a squash writes a commit, which needs an account at least 7 days old or a verified one. A conflicting merge writes nothing and lists the files and lines.--expect <sha>refuses the merge if the sandbox moved since you read it.
Or open a pull request from the sandbox when people should review it first. rebasely sandbox list and rebasely sandbox delete do what they say.
The API and MCP
rebasely sandbox create --from main --name fix-login
rebasely sandbox merge fix-login --into maincurl -fsS -X POST -H "Authorization: Bearer $REBASELY_TOKEN" -H "content-type: application/json" \
-d '{"from":"main","name":"fix-login"}' https://rebasely.com/api/v1/repos/<org>/<repo>/sandboxes{"name": "sandbox.create", "arguments": {"repo": "<org>/<repo>", "from": "main", "name": "fix-login"}}| Request | What it does |
|---|---|
GET /sandboxes | The repository's sandboxes (?mine=1, ?ended=1) |
POST /sandboxes | Create one: {from?, name?, ttl_s?, live?} |
GET, DELETE /sandboxes/<owner>/<name> | Read or delete one |
POST /sandboxes/<owner>/<name>/merge | Merge: {into?, mode?, expect?, message?, delete?} |
POST /sandboxes/<owner>/<name>/checks | Run its on: sandbox workflows |
Paths are under /api/v1/repos/<org>/<repo>. A person's token needs repo:write, an agent's sandbox:write. A sandbox created with {"live": true} works like any live branch until it is merged or deleted.
Limits and settings
At most 20 active sandboxes per person or agent in a repository, 200 per repository and 1,000 per organization. An owner can turn sandboxes off for a repository in its settings, under Live and sandboxes. Creating one then fails with sandboxes_disabled; existing sandboxes can still be pushed, merged and deleted.