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:

  1. All single-letter tiers less than X alphabetically
  2. Sub-levels of X up to and including Y

Examples:

| Caller level | Can access | |---|---| | A | A | | B | A, B | | BA | A, B, BA | | CA | A, B, C, CA | | ZZ | Everything |

Enforcement

  1. The Orchestrator sends the caller's security level with each POST /retrieve request to Aligner nodes.
  2. The Aligner filters returned chunks to only include content at or below the caller's level.
  3. 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.