Overview
The Workspace Files API exposes filesystem operations on the computer that runs the Allternit runtime. It resolves paths against the home folder (supporting the~ shorthand), then checks every path against a scope before it reads or writes anything. What a request may reach depends on where it came from: the Desktop app on the same computer, or another device through the relay. See Path scoping.
Base URL
Authentication
Requests are authorized through the platform auth middleware. The route also accepts a desktop-bootstrap header as a lenient fallback so Electron desktop sessions can operate without requiring the middleware to populate anAuthUser extension. Authentication says who is asking; path scoping decides which paths that request can reach.
Endpoints
Path resolution
Paths are resolved against the home folder of the computer running the runtime:~/Allternit/Inboxresolves to theAllternit/Inboxfolder in the home folder./absolute/pathis used as written, then checked against the scope.relative/pathresolves torelative/pathinside the home folder.
- A path with a
..part is refused, wherever the..appears. - Symbolic links are followed to where they really point. For a file that does not exist yet (a write or
mkdirtarget), the deepest folder that does exist is resolved and the rest of the path is added to it. A link that points at nothing is refused. /files/deleteresolves the folder that holds the target but not the target itself, so deleting a link removes the link, never what it points at.- Folders match whole path parts only: a rule for
~/Allternitdoes not cover~/AllternitX. - Responses carry the canonical path, so
pathfields may differ from what you sent (for example, the real letter case of a folder on a case-insensitive disk).
Path scoping
Every request is either local or relayed.- Local: the Desktop app on the same computer, reaching the runtime over loopback with no relay or proxy header.
- Relayed: any request replayed by the cloud relay (it carries
x-allternit-relayed), any request with a forwarding header (x-forwarded-for,forwarded,x-real-ipand similar), and any request from a non-loopback address. Requests from ai.allternit.com, the m.allternit.com PWA, and the iOS and Android apps to a computer are relayed.
Relayed requests
The relay carries the signed-in owner, so a relayed request keeps the features the web app, the PWA and the iOS app use, and nothing more:
|
FOLDER/.allternit/shared-context.md, anywhere in the home folder (a code project’s shared notes) | Read and write this exact file. Nothing else in that .allternit folder or in the project opens. |
| A file an agent wrote on this computer (see Agent-written files) | Read only |
Anything else answers 403, for example other files in a code project folder such as ~/Desktop/my-app/package.json.
Agent-written files
When an agent’s tool (write, edit, apply_patch, notebook, workspace-edit in Gizzi Code) writes a file, Gizzi Code reports the path to the runtime on the same computer with POST /files/bot-writes and a JSON body of {"path": "...", "session_id": "..."}. The runtime keeps the canonical path in a ledger in its data folder (at most 5,000 paths, each kept 30 days). A relayed request may then read that exact file, so a bot thread’s file cards open on the web and phone. It can never write or delete it.
- Only a local request can add a path. A relayed request to
/files/bot-writesanswers403with reasonlocal_only. - Secret locations are never recorded and stay refused.
- The record is the path, so a file changed after the agent wrote it is still readable. A path no agent wrote is not.
- Gizzi Code sends reports only when its API base is this computer (
127.0.0.1,localhostor::1). A missing report keeps the file closed to other devices. The runtime does not create the~/Allternitfolders; a write inside them creates the parent folders it needs.
Local requests
A local request can reach the whole home folder except the secret locations below. Paths outside the home folder (such as/etc or /tmp) are refused. The Desktop app still reads and writes skills, plugins, commands and MCP folders such as ~/.claude/skills.
Secret locations
These are refused for every caller, matched without regard to letter case (so~/.SSH is refused too):
- SSH, GPG and password stores:
~/.ssh,~/.gnupg,~/.password-store - macOS Keychains:
~/Library/Keychains - Cloud and developer credentials:
~/.aws,~/.azure,~/.kube,~/.config/gcloud,~/.config/gh,~/.config/stripe,~/.docker/config.json,~/.netrc,~/.npmrc,~/.pypirc,~/.git-credentials - Agent CLI sign-ins:
~/.claude/.credentials.json,~/.codex/auth.json,~/.gizzi/credentials.json,~/.local/share/gizzi-code/auth.json,~/.local/share/gizzi-code/fabric-lease.key,~/.local/share/tailscale - Allternit keys and private state:
~/.allternit/phone-gateway.json,~/.allternit/subscriptions,~/.allternit/incus-client,~/.allternit/factory/fabric,~/.allternit/factory/registry.json,~/.allternit/session-caretaker,~/.allternit/system-one, and any~/.allternitentry whose name contains.env - The Allternit data folders: the folder named by
ALLTERNIT_DATA_DIR, the platform data folder’sallternitand@allternitfolders (on macOS,~/Library/Application Support/allternitand~/Library/Application Support/@allternit)
Names and races
- Names are compared in Unicode NFC and without regard to letter case, the way APFS compares them, so an NFD spelling of a protected name is refused too.
- Reads and writes open the file without following a symbolic link at the end of the path. They then check where the open file really is (on macOS and Linux) and refuse the request if that is outside the scope. A folder swapped for a link between the check and the open is caught this way. A write opens the file before emptying it, so a refused write never cuts a file short. Listing,
exists,mkdiranddeletecheck the path but don’t re-check after the action. On Windows only the check before the open applies.
Computer file transfer
The computer routes that move files to and from a cloud computer or VM (/computers/COMPUTER_ID/files/upload and /computers/COMPUTER_ID/files/download) check the path on that computer by its text: it must be absolute, must not contain .., and must not point into any of the secret locations above (for example /home/user/.ssh/authorized_keys or /root/.aws/credentials), and /etc/shadow, /etc/gshadow and /etc/sudoers are refused. Both routes go through the same confirmation policy as other computer control actions (computer.file_read and computer.file_write). The same check runs for the bot desktop file routes, because it lives in the shared upload and download code. Transfer uploads (/computers/COMPUTER_ID/transfer/file) always land in a folder the runtime chooses, and answer 403 if that folder resolves into a secret location.
List files
Query parameters
Response
entries array rather than an error.
Read a text file
Response
Read a raw file
Content-Type header.
Check existence
JSON variant (always returns 200):Response
200 OK if the path exists, otherwise 404 Not Found. Both variants answer 403 for a path outside the caller’s scope.
Create a directory
Response
Delete a file or directory
Response
Write a file
Response
Supported MIME types
The/files/raw endpoint detects the following common types from the file extension:
Error codes
Related pages
- Files — upload and reference files for LLM requests
- Agent Workspaces — workspace directories and paths
- ACI — computer-interface filesystem actions