process.v1 and watcher.v1 gRPC services. It is wire-compatible with sandboxd. sandboxd compatibility lists every intentional difference.
The API is on by default. Turn it off with --agent-sandbox=false, which closes the REST port and removes the two gRPC services.
The protos are copied unchanged from upstream:
proto/process/v1/process.proto and proto/watcher/v1/watcher.proto.
Authentication
With--auth-token-file or --auth-token-sha256 set, every request needs the token except GET /v1/health and GET /readyz. Send either header (as gRPC metadata on gRPC calls):
UNAUTHENTICATED.
REST conventions
- Errors are JSON with
Content-Type: application/json:{"code": "...", "message": "..."}, followed by a newline. Errors lists every code and status. - Success without a body is
204 No Content. This covers everyPUT,DELETEandPOST. - Unknown paths return
404with an empty body. - Unsupported methods return
405with anAllowheader and the plain-text bodymethod not allowed. - Booleans in the query accept
1,t,T,TRUE,true,Trueand0,f,F,FALSE,false,False. An empty value or an absent parameter isfalse. Anything else is400 INVALID_ARGUMENTwith the message<name> "<value>" must be a boolean. - Timeouts. A connection that waits
--http-idle-timeout(default60s) for a request, has writes stuck that long, or stalls an upload that long is closed. Over HTTP/2, a connection with no request open that receives nothing but keepalive pings for that long is closed too. - Query strings are parsed as Go’s
url.ParseQueryparses them: a parameter with a malformed%escape or a;is dropped, and the first of repeated parameters counts.
GET /v1/health
Readiness. Never needs the token. AcceptsGET and HEAD.
GET /v1/metadata
Environment variables of the daemon whose names start with--metadata-env-prefix (default SANDBOX_). axed leaves out names containing TOKEN, SECRET, PASSWORD, PASSWD, CRED, KEY, AUTH, BEARER, PRIVATE or CERT, in any case. Accepts GET and HEAD.
/v1/files/{path}
{path} is everything after /v1/files/, percent-decoded. /v1/files and /v1/files/ name the root. A path that is not valid UTF-8 after decoding is 400. Paths resolve inside --root-dir. axed strips the root from an absolute path under the root, takes any other absolute path relative to the root, and cleans . and .. lexically. A path that climbs above the root is 403 PERMISSION_DENIED. axed follows symlinks only while they stay inside the root.
Methods: GET, HEAD, PUT, DELETE, POST.
File metadata
stat=true and directory listings return entries with these fields:
GET: download, list or stat
Require the path to be this kind. A mismatch is
409 CONFLICT (path is a directory, not a file or path is a file, not a directory). Any other value is 400.With
recursive, how deep to list: 1 is direct children. Unlimited when absent. Has no effect without recursive, but axed still validates it. Zero, negative or non-numeric values are 400.200 with Content-Type: application/octet-stream, Content-Length, Accept-Ranges: bytes and Last-Modified. Conditional and range requests follow Go’s http.ServeContent:
Dates compare at one-second granularity, as
Last-Modified carries no fraction. A file modified exactly at the Unix epoch counts as having no known modification time: it gets no Last-Modified, and If-Modified-Since and If-Unmodified-Since are ignored. HEAD returns the same headers without a body.
A directory returns 200 with a listing. Without recursive it lists direct children. Entries are in lexical order, each directory before its contents. Symlinks show their target’s metadata and are never descended into; broken symlinks and ones that point outside the root are left out. A recursive listing deeper than one level that passes 10,000 entries is 400; limit the depth or list a subdirectory. A listing of direct children is 400 only when the directory holds more than 1,048,576 entries. Any listing is 400 once the names it returns, each a path from the listed directory, add up to more than 32 MiB.
path is the request path with a leading /.
PUT: upload, make a directory, or extract
file of a multipart/form-data body (other parts are skipped). There is no size limit. On success, every form returns 204.
directory creates a directory instead of uploading. file makes a directory at the path a 409 instead of a 400.Permission bits as exactly four octal digits starting with
0, matching ^0[0-7]{3}$, for example 0600. axed applies it exactly and ignores the umask. Default 0644 for files, 0755 for directories and for extract.Unpack the body, a tar or gzipped tar archive, into the directory at
{path}, creating it. Entries may not escape the directory, even through symlinks the archive creates. At most 100,000 entries and 1 GiB of file data, and at most 32 KiB of header, long-name, long-link and PAX records for any one entry. Setuid and setgid bits are dropped from extracted modes. Cannot be combined with append, type or If-None-Match.Create only: fail with
412 FAILED_PRECONDITION (path already exists) if anything exists at the path. Only * is accepted; any other value is 400. Not allowed with type=directory. With append, append is ignored and the upload is create-only.O_TMPFILE (a .axe-tmp-* file on filesystems without it) and links it into place when the body is complete, so the path never holds a partial file, watchers never report the temporary file, and a failed upload leaves nothing. axed creates missing parent directories.
An existing directory with
type=directory succeeds unchanged.
DELETE
POST: move or copy
{path}. Symlinks are transferred as links.
Examples
process.v1.ProcessService
As in sandboxd, processes that a command leaves running when it exits on its own, such asserver &, keep running after Start or Execute returns. They die with the command when the client disconnects from Start first, when a time limit kills it, and when axed shuts down with cgroups. Once the command exits, axed waits up to 5 seconds for output that they keep open, then reports the exit.
Process ids in this API are integers (int32), not axe.v1’s 32-hex-digit string ids. The adapter gives each process started through Start the next unused number, from 1, and reports it in the stream’s init event. WriteStdin, SendSignal and ResizeTTY find a process by that number while axed tracks it, and answer NOT_FOUND otherwise. Processes started through axe.v1 or ateenv, and Execute runs, take no number.
Start
StartResponse events, in order:
The reader is lossless. A slow client holds the process back once retention is full.
Execute
exit_code, stdout and stderr. The time and byte limits are the deployment defaults (--execute-default-*, or the maximums when no default is set). axed caps output at 256 MiB per stream even with no limit configured.
axed kills the process tree if the call is cancelled.
ExecuteWithLimits
WriteStdin
input bytes to the process’s stdin, or closes it with eof. An empty payload does nothing. Output in response arrives on the Start stream.
A second
eof succeeds and does nothing.
SendSignal
SIGNAL_SIGINT, SIGNAL_SIGTERM or SIGNAL_SIGKILL to the process group. SIGNAL_UNSPECIFIED or any other value is INVALID_ARGUMENT. An unknown process is NOT_FOUND.
ResizeTTY
cols by rows. Fails with FAILED_PRECONDITION (failed to resize TTY: ...) when the process has no PTY or has exited. An unknown process is NOT_FOUND.
watcher.v1.FileWatcherService
WatchDir
FileEvent has type, path (relative to the root) and error:
axed batches events in 250 ms windows and delivers them in order. It detects removal of the watched directory from the directory’s own inotify events, not by watching its parent. It does not report temporary files from in-progress uploads. The stream ends when the client disconnects, after a terminal error, or when axed shuts down.

