Security boundaries
Status: Ready
Truth label: Limited
Audience: Fleet operator, System designer
Reader outcome: State exactly which boundaries this system enforces, which it only labels, and what each deployment step widens.
Last verified: 2026-09-13
Full guides: Security model
The design assumption
AGENTASIAN is designed for one trusted operator, trusted repositories, and machines you own. It is not a public multi-tenant service, and the current controls do not prove confidential client isolation.
That is the honest frame for everything below.
Credentials
Four credentials exist, and they authorize different things.
| Credential | Header | Protects |
|---|---|---|
Fleet bearer, AA_API_TOKEN | Authorization: Bearer | Every non-health request when set. Without it, only loopback clients are accepted |
| Worker token | X-Worker-Token | Credentialed worker routes. Returned once when Central first registers the worker identity |
| Run token | X-Run-Token | Lease renewal and terminal result delivery. Bound to one task and fence, returned only in the claim response |
Operator token, AA_OPERATOR_TOKEN | X-Operator-Token | Only searches that request scope=all |
OPTIONS and /health are public.
The operator token protects the all-scope search and nothing else. It does not protect checkpoint, project, task, document, or knowledge-promotion routes.
Implemented controls
| Control | What it does |
|---|---|
| Network perimeter | Services bind loopback by default. Without a token, non-loopback clients are rejected even if bound to a LAN address |
| Browser origins | AA_ALLOWED_ORIGINS is an exact origin list |
| Project path control | Remote registration is confined to SE_MANAGER_ALLOWED_PROJECT_ROOTS, or to SE_MANAGER_PROJECTS_DIR when that list is blank and a token is set |
| Worker identity | Central mints a per-worker credential and stores only its hash |
| Run integrity | A run token bound to one fence rejects late results from stale attempts |
| Execution authority | A per-machine maximum permission clamps what a task may request |
| Provider credentials | Key-returning endpoints stay disabled unless AA_ALLOW_KEY_DISTRIBUTION=true |
| Retrieval trust | Repository control files are trusted instructions. Retrieved history and knowledge are labeled untrusted evidence |
| Attachment roots | AA_ATTACHMENT_ROOTS bounds which directories chat attachments may be read from |
Named gaps
State these plainly rather than discovering them later.
Safe permission is not an operating system sandbox
Safe maps to an engine mode: plan mode for Claude, a read-only sandbox for Codex. It is a best-effort limit on the coding CLI. A verification command still executes repository code in the project directory.
Do not run hostile repositories or hostile tests on a worker.
Client scope is not tenant isolation
client_id assigns a confidentiality scope, and scoped HTTP search records
returned and denied counts. That audit measures denials seen by that one
filter. It cannot detect retrieval paths that bypass the filter.
Keep a session inside one client scope, but do not use sessions as a confidentiality boundary. Do not use the system for multiple confidential clients until the audit findings are resolved.
The fleet bearer is not role separation
One token authorizes every non-health route. A holder can create tasks, approve checkpoints, read traces, and search memory. There is no operator role distinct from a worker role at the perimeter.
Attachments and ingestion read server-side files
Knowledge can be ingested from a server-side path, and chat attachments are
read by the Brain process. With AA_ATTACHMENT_ROOTS unset, the act of picking
is the only gate, so a token holder can read any file the Brain process can
read. Do not expose the Brain API to an untrusted client.
Traces are sensitive
Task traces contain the full task result inside the outcome object. Treat the trace API and raw trace artifacts as secrets, despite older documentation describing traces as fully sanitized.
A voice pack is prompt authority
Pack content becomes system-level instruction. Treat an imported pack as code you are about to run, not as data you are about to read. Review imported profiles, lenses, samples, and style rules before applying them.
The worker inherits the whole environment
The worker loads the repository .env and copies that environment into CLI and
verification child processes. A shared .env therefore places the operator
token and any provider keys on the worker. Until process-specific secrets and
child environment filtering exist, keep unrelated keys out of a worker
environment that will run untrusted repositories.
Backups are partial
The current archive omits decisions, scope audit records, candidate resolution state, worker credentials, worker outboxes, and every external content root. Worker credential files, outboxes, raw traces, and backups are all secrets. See Running the stack.
Ten operating rules
- Keep APIs on loopback unless remote workers require LAN access.
- Never expose ports 3000, 8080, or 8081 to the public internet.
- Use a long random fleet bearer for LAN access.
- Restrict firewall rules to trusted private hosts.
- Keep provider key distribution disabled.
- Store client work only in a correctly scoped project.
- Do not run hostile repositories or tests on a worker.
- Do not assume
safeprovides operating system isolation. - Treat worker credential files, outboxes, raw traces, and backups as secrets.
- Do not use the system for multiple confidential clients until the audit P0 findings are resolved.
Deployment checklist
Single host
- Leave
AA_BIND_HOSTat loopback. - Leave
AA_API_TOKENempty. Loopback-only is the boundary. - Use a disposable test repository until the whole path works end to end.
Trusted LAN
- Set
AA_BIND_HOST=0.0.0.0and a long randomAA_API_TOKENtogether. Never one without the other. - Set
AA_ALLOWED_ORIGINSto the exact Cortex origin you browse from. - Set
SE_MANAGER_ALLOWED_PROJECT_ROOTSto the smallest workable list. - Set
AA_ATTACHMENT_ROOTS. - Add firewall rules scoped to trusted private hosts.
- Use a dedicated browser profile on a trusted machine.
Before any wider exposure
Read the named gaps above and treat each one as a blocking item, not a footnote.
Incident starting points
| Suspicion | First actions |
|---|---|
| Fleet token exposure | Rotate AA_API_TOKEN on every service, worker, and browser. Restrict binding to loopback while you rotate |
| Worker token exposure | Delete that worker registration, remove its credential file, restart the worker to re-enroll |
| Cross-client retrieval | Stop dispatching, review the scope audit counts, and inspect the affected task's retrieval evidence before resuming |
Related lessons
- The local-first API boundary
- Worker credentials and run tokens
- Provider key distribution is opt-in
- Project root allowlisting
- Safe mode is not an OS sandbox
- Protect raw trace artifacts
- The operator service authority gap
- Client scope is not tenant isolation
- Threat model the agent worker
- Trusted LAN security checks