Code tasks: the agent at a workbench
A design, 2026-11-26 (session s855), for the question the person asked once the agent was built: can the agent do code work — on Pinnacle, or on another Pinnacle? It builds on agent-environment.md ("Developing on the device") and on what is built: verbs with effects, the sealed gatekeeper, the confirmation screen, the taint rule, p2p streams with a service tag.
The answer in one paragraph
Code is not built on Pinnacle: there is no compiler for it there (rustc is
LLVM, which is C++) and there will be no shell. It is built on a
workbench: a small program on a machine that has a toolchain — a midas
node, a workstation — which is a contact of the person's devices and offers
verbs over the p2p layer like any service. The agent never gets a shell. It
gets the workbench's verbs — open a task, read, search, write, run a check,
look at the diff, commit, propose — each with its effect, and the workbench
does them in one git worktree per task, every command it runs in a
sandbox with no network and no view outside that worktree. Inside the
worktree nothing is asked, because nothing there is final: git is the undo.
The one thing that leaves the machine, proposing the work as a branch for
review, is confirmed on the person's screen each time, and never touches
main. A Pinnacle reaches another Pinnacle's services the same way, so
"another Pinnacle" and "a build machine" are one mechanism.
What can go wrong, and what holds
Assume the model is hijacked, as everywhere in the agent. Here the means are richer: a source file, a commit message, an issue text or a vendored crate can carry instructions, and the agent reads all of them.
| What an attacker controls | What it could reach | What holds |
|---|---|---|
| Any verb the gatekeeper lets through, any arguments | Files outside the task; other tasks | Paths are checked by the workbench: relative, no .., no .git, no symlink leading out; one worktree per task, chosen by the workbench |
Any file in the worktree, so build.rs, proc macros, tests: code that runs at build time | The machine's keys (~/.ssh, the Forgejo token), other worktrees, the network | Every job runs sandboxed: the root read-only, writable only the worktree and its target directory, an empty home, no network, no other processes; the environment emptied. No sandbox on the machine: no jobs at all (it fails closed) |
| git itself (hooks, config in the repository) | Code run by git outside the sandbox | Hooks off (core.hooksPath=/dev/null), the workbench's own git config, no include |
| A command line | Anything a shell can | There is none: a job is a name from the machine's own list (check, test, clippy, fmt) with an optional package and test filter, checked as identifiers; the argv is the machine owner's |
| The proposal | main, other people's branches, a public leak of private code | The workbench pushes only agent/<task> to the remote its owner configured, with its own credential, outside the sandbox, after the person allowed it on their screen; it has no verb that pushes elsewhere |
| Time and space | A machine kept busy, a disk filled | Per job: wall-clock and CPU limits, output capped; per task: minutes of jobs; per machine: one job at a time, tasks cleaned after a week or on close |
And what is not claimed: the sandbox is the operating system's (Linux
namespaces through bwrap, macOS's sandbox-exec), so it is as strong as
those; a proposal's content is the person's to review before it lands, as
any branch is. The workbench is not a CI, and does not replace the gate.
The parts
1. Remote services over p2p
A contact's service is reached like a local one, through the p2p service:
- On the device that uses it, a program asks the p2p service for a
channel to
<service>on a contact (a new request besideEXEC); the p2p service opens a stream taggedverbs:<service>and carries messages both ways, each framed by its length. The program speaksrecords::verbson the channel as it would to a local service:describeandcalldo not know the difference. The terminal writes it+workbench@Bench(the service, the contact). - On the device that offers it, the p2p service takes a stream tagged
verbs:<name>only from a contact the person allowed for that service (Settings → Remote access, per contact and service), connects to the local service<name>and carries the messages. A service offered to contacts is one the person chose to offer; nothing is offered by default. - The answer of a remote service is untrusted by default for the taint rule: it comes from another machine, whatever its description says.
2. The workbench
A program of its own (workbench/), Rust with std only, for Linux and
macOS, which runs the p2p layer as a Pinnacle device does (the p2p crate
is pure, so it runs on a host as it runs in Pinnacle) under an identity of
its own, and serves one service, workbench. Its owner configures, in one
file: the repositories it may work in (by name, a local clone each), the
remote and credential a proposal goes to, the jobs and their argv, the
limits, and the contact keys allowed to use it.
Its verbs, with their effects:
| Verb | Effect | Undone by |
|---|---|---|
repos | reads | |
open repo, base | own: a worktree and branch agent/<task> from base | close |
files path, read path, from, lines, search pattern, path | reads; untrusted (the repository is many people's text) | |
write path, text; edit path, old, new | own (the worktree) | write with what was there, or remove |
run job, package, filter | own (the worktree's target directory); answers at once with a job | |
job id, wait | reads; untrusted (a build's output is the repository's) | |
diff | reads | |
commit message | own (the task's branch) | uncommit |
propose title | out: the branch pushed for review | |
close | own: the worktree removed, the branch kept |
A task id is the gatekeeper's task, so asking twice is answered once.
3. Jobs, sandboxed
A job is cargo <job> --offline --locked with the package and filter the
call named, in the worktree, with CARGO_TARGET_DIR a directory of the
task's. On Linux it runs under bwrap: / read-only, the worktree and
target read-write, a fresh /tmp and an empty $HOME with the toolchain and
the crate registry bound read-only into it, every namespace unshared (so no
network), --die-with-parent, --new-session, and rlimits on CPU time,
memory and processes; on macOS under sandbox-exec with a profile that
denies the network and writes outside the worktree, target and temp, and
reads of the home's secrets. The environment is emptied but for PATH,
HOME, CARGO_HOME and RUSTUP_HOME. Output beyond 1 MiB is cut, a job
past its wall-clock limit is killed with its process group.
Dependencies are fetched by the machine's owner, not the agent: a job is
offline, so a Cargo.lock the agent changes to a crate the machine does not
have fails to build rather than downloading it.
4. Stability
- Nothing waits long on a message. A verb answers within seconds;
runanswers with a job id, andjobwaits at most a minute for its end. A build of ten minutes is tenjobcalls, each short. - A task outlives its connection. Worktrees and jobs are on the machine's disk under the task's id; a stream that breaks (a train tunnel) heals within five minutes, and a gatekeeper that starts again with the same task id finds its worktree and its jobs where they were. The workbench keeps its state in files, so a restart loses a running job, not a task.
- Bounded everywhere: one job at a time on a machine, queued beyond; minutes of jobs per task; a week before an idle task's worktree goes (its branch stays).
- Reachability: the workbench needs an address the device can reach —
a public one (a VPS), the same network, or one behind an ordinary NAT,
which the p2p layer's introducers punch through. Behind a symmetric NAT
(some carriers and firewalls) it needs a relay, not built yet. The device
finds the DHT through the peers in its
/settings/peers.
5. What the person sees
agent +workbench@Bench Fix the warning in crates/geo and propose it runs
in the terminal like any task: each verb a line, the jobs' progress, the
diff at the end. One question comes, on the confirmation screen: "Bench:
propose — agent/17 to jeroen/cartopolis, after reading text from
workbench__read that is not yours to trust?" with the task's diff a tap
away. The branch then waits for review as any other; landing it is the
person's, through the hub as today.
What is given up
A shell on the workbench, for the agent: whatever a job list does not name,
the agent cannot run, so a task that needs a new tool needs its owner to add
a job. Downloading at build time. Pushing anywhere but agent/<task>. And
the workbench is not Pinnacle software: it runs on Linux and macOS, with
their git, cargo and sandbox, because that is where the toolchain is.
As built (2026-11-26, session s855)
Parts 1 to 3 are built; cargo xtask workbench-demo runs them end to end
(a workbench on the host, the device its contact, the agent opening a
task, writing the fix, running the tests sandboxed, committing, and
proposing on the person's word; the branch is then in the remote).
- Remote services are the p2p service's bridges:
REMOTEonsystem-p2pgives a channel to a contact's service, carried over a stream taggedverbs:<name>, a message a frame, no handles. The other device connects it only for a contact its person offered its services to (Settings → Remote access, "May use its services"), never to asystem-…service. The terminal writes+workbench@Bench; the verbs command takesp2p@Botoo. - A contact's service is untrusted for the taint rule, whatever its
description says: the gatekeeper marks every answer from a
name@contactgrant. jobwith a wait does not hold the workbench: the call is held aside and answered from the loop once the job ends or the wait is over, so one device's build never stalls another's verbs or the p2p layer.- Jobs: bubblewrap on Linux,
sandbox-execon macOS; neither, no jobs. A job's temporary files are in its task's target, not the user's temporary folder: on macOS that folder is shared with everything the user runs, and the workbench's own test caught a job writing there. The test (a_job_is_contained, in the gate) runs a shell in the sandbox that must write in its task, must not write outside it, and must not reach a port on the machine. Rlimits are not set yet (std has nosetrlimit, and the rule is no outside crates); the wall clock and the output bound are. - Grants come first on the command line:
agent +workbench@Bench @a.txt the task …; from the task's first word on, a+or@is its own text (the demo's1 + 1was once read as a grant). - A task's id is the workbench's, counted from 1, and every verb but
reposandopennames it; a task is its opener's (by contact key).
Order
- Remote services over p2p, device to device, with the per-contact grant
and the terminal's
+service@contact. - The workbench with repositories, worktrees and the file verbs,
diff,commitandpropose; its self-check fromcargo xtaskon the host. - Jobs, sandboxed, and failing closed where no sandbox is.
- The demo with a real model. (Done 2026-11-26:
cargo xtask workbench-demo real, the key inANTHROPIC_API_KEY, run as a midas bot on a Mac so the hub's bot secret reaches it. Told the task in words,claude-sonnet-5opened a task, read the test and the code, fixed the code with anedit, ran the tests in the sandbox and waited for them, committed, and proposed on the person's allow: 8 actions, 62 KB sent to the model.)