Security model
Swarm enforces data access at the Aligner level — the Orchestrator never receives data a user is not authorized to see.
Security levels
Security levels are 1–2 uppercase ASCII letters. The level encodes a hierarchical access policy:
- Single letter (e.g.
A,B,C) — a top-level tier - Two letters (e.g.
BA,ZZ) — a sub-level within the first tier
Access rules
A caller at level XY can access:
- All single-letter tiers less than
Xalphabetically - Sub-levels of
Xup to and includingY
Examples:
| Caller level | Can access |
|---|---|
| A | A |
| B | A, B |
| BA | A, B, BA |
| CA | A, B, C, CA |
| ZZ | Everything |
Enforcement
- The Orchestrator sends the caller's security level with each
POST /retrieverequest to Aligner nodes. - The Aligner filters returned chunks to only include content at or below the caller's level.
- The Aligner signs its response — the Orchestrator cannot modify or bypass the filter.
Assigning levels
Security levels are assigned per-user in the Orchestrator's SWARM_USERS configuration:
SWARM_USERS=alice:pass:ZZ,bob:pass:A,charlie:pass:BA
Format: username:password:security_level
If no level is specified, the user defaults to A.
Labelling files
Use a security manifest in the Aligner to label files and line ranges.
Unlabelled files default to level A and are accessible to all users.