Authority’s three carriers, and why they don’t collapse
Authority changes its form as it travels — from a rule you write, to the act of judging one specific action, to a flat checklist handed to a blunter guard — and each step deliberately throws away something the next step must not be allowed to see. That is why there are three forms where one is tempting. They are not three copies of one thing; they are authority at three stages, and the stages are not interchangeable.
The seductive mistake is to think the combined permission is just a smaller rule. Stack all the active rules, intersect them, and surely you get one tidy rule you can check everything against? You don’t — because whether a given action is allowed depends on things no written rule can hold.
The grant value: the rule you write
This is permission as language: “allow git; let me read my home directory but
not write it.” It is a record of tagged values, the grant value, and it is what
an author writes, what `grant` layers narrow, and what a host
sends another. Two features make it a rule and not yet a decision. It can be
silent, saying nothing about the network, so that several rules can be layered
without each having to mention everything. And it is spellings, not
positions: `cwd src means nothing until some host resolves it, so it
crosses a boundary as data and is decoded where it lands
(a-grant-is-decoded-where-it-lands).
Its decoding is a GrantLayer, which is already a decision about positions;
Capabilities is only a test builder that spells a grant value. Everything
downstream is what becomes of the decoded layer.
The live judgment — not a smaller rule
You might expect “combine the whole stack into one rule” to produce another layer. It can’t, because the real question — is this exact action allowed, right now? — turns on details a written rule does not contain:
- the exact program: a bare name such as
gitmeans whichever filePATHfinds, and a program is judged by the file that will run; a rule about it cannot be boiled down to a list of files without choosing one environment. - who is asking, and from where — the same rule means different concrete things checked inside the locked-down sandbox versus outside it.
- where paths really point — symlinks and
..have to be resolved against the live environment before “inside my project” means anything.
So the combined form is not a tidier rule — it is the act of judging, and an act
is a verb, not a noun. Each authority::guard::check_*(&GrantStack, …) folds
the whole stack of rules and answers one specific request as it arrives. The fold is the guarantee that a verdict was
weighed against all the rules at once, never one rule in isolation — held by
the function bodies, not by a witness type
(witness-collapse).
SandboxProjection — the checklist for a blunter guard
The same authority has to be enforced by two very different things, and they understand different languages (two-enforcers):
- ral itself is the sharp judge — it sees the exact command and arguments, knows where it is running, and rules on each action as it happens. So it never pre-decides; it judges live. The guard returns domain refusals; the shell supplies the stack and interprets those refusals as runtime errors.
- the operating system’s sandbox is the blunt but powerful sentry — it can
physically stop a runaway child program, but it is dim: you must hand it a flat
list of “these locations yes, these no” up front, and it cannot ask
follow-ups or understand “
gitbut onlystatus.”
SandboxProjection is the permission boiled down into that flat list — the
subtle parts (a bare-name veto, a bundled tool’s name) flattened away because the
sentry could never act on them. It carries the same evidence table the guard
judges by, with every allowance as its resolved real position, plus support.
Support is what a launch needs beyond the policy, and it yields to every
exclusion. Carriers (a trusted script’s interpreter) and the dynamic linker
join the projection as allowances where the author wrote none, never ranked
above anything: a support file serves a launch only if it can be both run and
read, so one that an exec or an fs exclusion covers is dropped from both axes.
Support is a function of the launch, not of the policy alone, and is computed
for every confined launch under a restricted fs or exec. It grants running and
reading, never writing. Discovery retains each system-only walk’s Located,
checks the projection’s exclusions on its trace before reading or yielding it,
and reads its #! through that handle under Ungoverned::read. The same
predicate judges linker traces. The parent also reads the launched program’s
interpreter through its judged handle and keeps it beside the image, to word a
failed start; the warrant does not carry it, and a refused exec’s hint uses
the saved interpreter even if the script changes before spawn. The guard consults none: an exclusion of a linker or an
interpreter refuses the programs that start through it, though the policy says
nothing about them, and the kernel’s refusal is worded by the launch
diagnostics. Same authority, two renderings, because there are
two enforcers of unequal sophistication. Neither rendering serves both: hand the
flat list to the sharp judge and you have thrown away its precision; ask the
blunt sentry to understand the subtle rule and it simply can’t
(the two folds stay separate).
The shape of it
Picture a recipe, the cooking, and the photo on the menu. They concern one dish, but you cannot substitute one for another: the recipe can be edited and combined with others, the cooking is an act that needs the actual ingredients in front of you, the photo is a flattened thing for someone who will never step into the kitchen. Authority here is the same — the written rule, the live judgment, the exported checklist — three forms, each forgetting something the next stage must not recover. Merge them and you readmit exactly the confusions the separation rules out.
See also grant, capability-freeze, two-enforcers, witness-collapse, exec-authority-partitioned; realised in capability-enforcement; map capabilities.