|
| 1 | +<!-- SPDX-FileCopyrightText: Sudo Apt Holdings LLC --> |
| 2 | +<!-- SPDX-License-Identifier: Apache-2.0 --> |
| 3 | +# Authorization boundary |
| 4 | + |
| 5 | +What sits inside the accredited boundary when Trinity runs, what sits outside it, and the one thing |
| 6 | +about the standalone configuration an assessor has to understand before anything else in this pack |
| 7 | +is useful. |
| 8 | + |
| 9 | +## The boxes |
| 10 | + |
| 11 | +``` |
| 12 | + ACCREDITED BOUNDARY (yours) |
| 13 | + +--------------------------------------------------------------+ |
| 14 | + | | |
| 15 | + | [ Trinity process ] [ Receipts store ] | |
| 16 | + | BEAM/OTP application hash-linked signed chain | |
| 17 | + | permission gate, effect own SQLite file, own | |
| 18 | + | membrane, session loop connection pool | |
| 19 | + | | |
| 20 | + | [ Customer files ] | |
| 21 | + | the filesystem roots you | |
| 22 | + | grant, and nothing else | |
| 23 | + | | |
| 24 | + +--------------------------------------------------------------+ |
| 25 | + | | |
| 26 | + | prompt + completion | OIDC / OAuth 2.1 |
| 27 | + v v |
| 28 | + [ Model endpoint ] [ Customer IdP ] |
| 29 | + OUTSIDE the boundary OUTSIDE the boundary |
| 30 | +``` |
| 31 | + |
| 32 | +| Box | Inside the boundary? | Path | |
| 33 | +|---|---|---| |
| 34 | +| Trinity process | Yes. Runs on your host, under your accounts | `lib/trinity/application.ex` | |
| 35 | +| Receipts store | Yes. Its own database file, separate from the primary | `lib/trinity/repo/receipts.ex`, `lib/trinity/paths.ex` | |
| 36 | +| Customer files | Yes. Only the roots you grant | `lib/trinity/tools/fs/` | |
| 37 | +| Model endpoint | **No.** Whatever you point it at, wherever it runs | `config/llm.exs:14` (the model list) | |
| 38 | +| Customer IdP | **No.** Yours, and Trinity is a resource server to it | `lib/trinity/mcp/auth/`, `config/runtime.exs:100` | |
| 39 | + |
| 40 | +Trinity holds a single-instance lock on the data directory so two processes cannot share one store: |
| 41 | +`lib/trinity/data_dir/lock.ex`. |
| 42 | + |
| 43 | +## Standalone: judge, actor and scribe |
| 44 | + |
| 45 | +In the default configuration (`TRINITY_AUTHORITY` unset, or `local`) Trinity decides whether an |
| 46 | +effect may happen, performs it, and writes the record of having done so. All three roles are the |
| 47 | +same process. |
| 48 | + |
| 49 | +- The decision is `lib/trinity/permissions/`, through `lib/trinity/authority/local.ex`. |
| 50 | +- The effect crosses one boundary, `lib/trinity/effects.ex`, which re-derives the fingerprint from |
| 51 | + the arguments actually passed before admitting the call. |
| 52 | +- The record is `lib/trinity/receipts/chain_writer.ex`, signed before the row is written. |
| 53 | + |
| 54 | +**What that is worth.** It is strong evidence to a reader who accepts that the host was not |
| 55 | +compromised: the chain is hash-linked and signed, the effect population is closed and published, |
| 56 | +and the verifier runs without the application. It proves the software did what the record says. |
| 57 | + |
| 58 | +**What it is not.** There is no separation of duties. A party who does not already trust the host |
| 59 | +has only the host's word for it, because the same process made the decision and wrote the record of |
| 60 | +the decision. `docs/10-assurance-case.md` states this, and criterion C6 there records that a signing |
| 61 | +key in a file proves the records were not altered by anything lacking read access to that file, and |
| 62 | +proves nothing about custody of the key. |
| 63 | + |
| 64 | +**A signed receipt with an untrusted clock is weaker evidence than one with a trusted clock**, and |
| 65 | +Trinity's clock is the host's own reading: `lib/trinity/receipts/clock.ex`. A deployment that needs |
| 66 | +the time itself to be trustworthy supplies a trusted time source. `docs/09-standards-register.md` |
| 67 | +carries that as a real-world dependency rather than a property of this tree. |
| 68 | + |
| 69 | +## Regulated use requires an external authority |
| 70 | + |
| 71 | +For a boundary where the decision must not be the machine's to make, Trinity supports pointing |
| 72 | +`TRINITY_AUTHORITY` at an adapter that lives outside this repository. When one is in force, Trinity |
| 73 | +keeps **no executor** for the effects that adapter governs, and that absence is asserted by a census |
| 74 | +over the tree rather than by intent (`lib/trinity/authority.ex`, and the census recorded in slice |
| 75 | +027's record). |
| 76 | + |
| 77 | +**Stated precisely, because the loose version of this sentence is wrong.** The seam is in the tree: |
| 78 | +`lib/trinity/authority.ex` is the behaviour, and `lib/trinity/authority/selection.ex` picks an |
| 79 | +implementation once at boot from `TRINITY_AUTHORITY` (ADR-0010). **One implementation ships here, |
| 80 | +and only one:** `Trinity.Authority.Local` (`lib/trinity/authority/local.ex`), which is the sole |
| 81 | +module in the tree that calls a tool's `execute/2` for an effectful tool. Grepping the behaviour |
| 82 | +resolves two files and the second is a test fixture (`test/support/authority/adapters.ex`). |
| 83 | + |
| 84 | +**No adapter other than `Local` ships in this tree.** An external authority adapter is a module in |
| 85 | +another repository, and ADR-0008 (`docs/adr/0008-authority-is-an-adapter.md`) states that no slice |
| 86 | +in this repository builds one. Nothing in `mix.exs` or `mix.lock` depends on one; an assessor can |
| 87 | +confirm that from the dependency list rather than from this page. |
| 88 | + |
| 89 | +An assessor evaluating a regulated deployment is evaluating that adapter as well as this software, |
| 90 | +and this pack says nothing about it. |
| 91 | + |
| 92 | +## What crosses the boundary, and when |
| 93 | + |
| 94 | +| Crossing | Direction | Gate | Path | |
| 95 | +|---|---|---|---| |
| 96 | +| Prompt and completion | Out, then in | Every turn | `lib/trinity/sessions/prompt.ex:45` | |
| 97 | +| Tool effects on files | Inside only | Permission gate, then membrane | `lib/trinity/effects.ex` | |
| 98 | +| Web fetch and search | Out | Permission gate | `lib/trinity/tools/` | |
| 99 | +| MCP server requests | In | OAuth 2.1 resource server | `lib/trinity/mcp/auth.ex` | |
| 100 | +| Receipt forwarding | Out, if configured | Optional authority callback | `lib/trinity/receipts/forwarder.ex` | |
| 101 | + |
| 102 | +A witness or transparency service that would let a third party detect backdated forgery without |
| 103 | +trusting the host is **NOT IN TREE**. |
0 commit comments