Skip to content

add sandboxes: computers agents ask for, kept while they are away - #189

Merged
hkonsti merged 3 commits into
mainfrom
hkonsti/sandboxes
Nov 5, 2026
Merged

hkonsti merged 3 commits into
mainfrom
hkonsti/sandboxes

Conversation

@hkonsti

@hkonsti hkonsti commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #187, which it needs for @proxy/backends.

Sandboxes live in Personal Agent Proxy itself, as the vault does. Every organization and member gets a Sandboxes connection the first time they could use one: where the organization has the sandboxes experiment and the server a sandbox backend (SANDBOX_BACKEND). Three actions: see, use (make, wake, run commands; high risk) and delete; the member's own connection gives agents the first two by default, the organization's nothing until its owner turns it on.

  • The sandboxes are the collection: listed, opened, made with a name, put to sleep, woken and deleted as records, each with its state, the task using it and when it was last used. The console is the one native tool, sandbox_exec, with command, stdin, cwd and timeout (60 s unless given, at most 120); files are read and written through it. A sandbox asleep is woken by its next command.
  • One task at a time (native/sandbox/lease.ts): the first command a task runs in a sandbox takes it; it stays that task's while the task is under way and is free again once it is finished or left open by the existing twenty-minute rule; a sub-task of the holder works on it too; another task's command is refused with the holder named, in words the agent can act on.
  • The machine is the backend's (machines.ts): every move of a row is fenced on the state it leaves, so two calls never both ask the backend. A sweeper puts sandboxes to sleep after 30 minutes without a command.
  • Agents that may use sandboxes get a paragraph in their instructions. The agent pages list an integration's own tools as they list a custom server's.
  • The web app has a Sandboxes page under connections, with a row on the connections page beside the vault's; the docs a page under connections.
  • Schema: the Sandbox table (migration v043_add_sandboxes). NAMED_AFTER_ORGANIZATION carries the Sandboxes connections through a rename as it does the vaults.

Checked end to end on a local stack against the internal service on agentOS (personalagentproxy/internal#26): a demo agent through the gate made a sandbox, ran git, wrote a file through stdin, slept and woke it by its next command, had a timeout keep partial output, saw a second task refused with the holder named, and was refused delete, which is off by default. Suites: api 1165, web 293, integrations, contracts, backends, map; docs build.

Not in this PR: sleep and wake from the web page (the human side has no record-command route yet), retention of free sandboxes, forking.


Open workspace in Conductor

Base automatically changed from hkonsti/sandbox-backends to main November 5, 2026 00:05
Sandboxes live in Personal Agent Proxy itself, as the vault does: a Sandboxes connection of the
organization's and of each member's own, made the first time they could be used, where the
organization has the experiment and the server a sandbox backend. The sandboxes are the
collection, listed, made with a name, put to sleep, woken and deleted as records; the console,
sandbox_exec, is the integration's one tool of its own, with stdin, cwd and a timeout, and files
are read and written through it. A sandbox is one task's at a time (native/sandbox/lease.ts):
taken by the first command a task runs in it, free again once the task is finished or left open,
and a sub-task of the holder works on it too; another task's command is refused with the holder
named. Its machine is the backend's (machines.ts): woken by its next command, put to sleep by the
sweeper after 30 minutes without one, and every move of a row fenced on the state it leaves.
Agents that may use sandboxes are told what they are and how to work in them; the web app lists
them with their state, the task using each and when it was last used, and deletes one; the docs
have a page.

The catalog gains the sandbox integration, the schema the Sandbox table, and the experiment
`sandboxes`.
Whether the server has a sandbox backend was said twice, as SANDBOX_BACKEND and as the service's
address; the address says it by itself now, dev the one value that is no address, for the
development-only backend on this machine.
@hkonsti
hkonsti merged commit 96e4538 into main Nov 5, 2026
3 checks passed
@hkonsti
hkonsti deleted the hkonsti/sandboxes branch November 5, 2026 01:10
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.

1 participant