interplane-mv
INTERPLANE: open interoperability protocol between AI models and agent runtimes. Models express intent. Runtimes retain authority.
Brought by drakestapleton
interplane-mv / docs / analysis / ISSUE-57-refusal-exposure.md
| 1 | # Issue 57: refused and held calls and the exposure floor |
| 2 | |
| 3 | Status: RESOLVED by option C (keep fail-closed), decided by the coordinator on 2026-10-07. No behaviour |
| 4 | or fixture change. The rule is now stated in `spec/CORE.md` (non-executed results in the exposure |
| 5 | ledger) and `spec/CROSSVEIL.md` rule 6. Options R and V are tracked in issue #80, to be taken up only |
| 6 | when a host shows a real usability cost. |
| 7 | Evidence is CPU evidence: no model, no GPU. |
| 8 | |
| 9 | ## 1. What happens today |
| 10 | |
| 11 | When the pipeline renders a result back to the model it records it in the trace's input ledger |
| 12 | (Rust `pipeline.rs:1320` calls `record_result` at `:531`, which calls `push_result_input` at `:535`; |
| 13 | Python `crossveil.py:1000` -> `_record_result` `:478` -> `_push_result_input` `:482`). The record's |
| 14 | `content_kind` and `trust` are the result's `provenance`; absent gives `unknown` |
| 15 | (Rust `:540-560`, Python `:490-505`). Host continuations take the same path |
| 16 | (Rust `:1132`, `:1163`; Python `:815`, `:825`). |
| 17 | |
| 18 | Results that were not executed carry null `content_kind` and `trust` by design: CORE.md |
| 19 | "Canonical result payload shape" (`spec/CORE.md:254-259`, "no data was produced, so there is no |
| 20 | content to classify"). Rust builds them in `reached` / `non_exec` (`pipeline.rs:~800-840`) and |
| 21 | `reject` (`:597`); Python in `make_result` and `_rejected` (`crossveil.py:522`). |
| 22 | |
| 23 | The floor is the minimum over the ledger (Rust `exposure_for` `:512`, Python `:460`). `unknown` |
| 24 | ranks as `external_untrusted`; an empty ledger is `external_untrusted` (CROSSVEIL rule 6, |
| 25 | `spec/CROSSVEIL.md:103-118`). So a null label on a refusal becomes `unknown` in the ledger and |
| 26 | lowers the floor to `external_untrusted` for the rest of the trace. Reproduced on the todo example |
| 27 | at main 0ff60f2: c4 shows `floor before: external_untrusted` with only the "held" reply to c3 as |
| 28 | new input. |
| 29 | |
| 30 | The two specs were never reconciled on this point. CORE.md says "null, nothing to classify". |
| 31 | CROSSVEIL rule 6 says every rendered result is recorded, `unknown` when it has no label. The |
| 32 | `unknown` is the generic fail-closed default written for executed results whose adapter said |
| 33 | nothing (rule 2); nothing in the text, the 0.3 plan (`docs/plans/0.3-TRUST-PLAN.md`) or |
| 34 | `bench/PROTOCOL-0.3.md` (gates P and E) discusses refusals. Gate P2 counts only executed results. |
| 35 | There is no separate threat-model document under `docs/`; SECURITY.md states the rule only as |
| 36 | "fail closed on unknown decisions". The intent has to be read from the trust rules. |
| 37 | |
| 38 | ## 2. What the authors intended |
| 39 | |
| 40 | Three stated principles bear on it. |
| 41 | |
| 42 | 1. The floor is "the least trusted level among inputs visible to the model" (rule 6). The ledger |
| 43 | exists so that nothing the model sees escapes it. The continuation text says so directly: a |
| 44 | resolved continuation is recorded "so what the model sees next stays inside its exposure floor" |
| 45 | (`spec/CORE.md:216-218`). Not recording a refusal body contradicts that. |
| 46 | 2. Inability to determine trust is never turned into trust (CROSSVEIL Trust rule 1). |
| 47 | 3. The pipeline does NOT record the model's own text, because doing so "would make the floor of every |
| 48 | multi-turn trace `external_untrusted` by construction and hide real exposure changes" |
| 49 | (`spec/CROSSVEIL.md:143-146`). The floor is meant to move on real new exposure, not by |
| 50 | construction. |
| 51 | |
| 52 | Reading 1 and 2 together with 3: the `unknown` on a refusal was an unintended side effect of two |
| 53 | rules meeting (the default for unlabelled results, and the null label for non-executed ones). It |
| 54 | was unintended when written and is now a decided policy (option C, section 6). But the safe direction (fail closed) is what the authors chose for every gap, and the |
| 55 | fix must not open one. |
| 56 | |
| 57 | ## 3. Can a refusal body carry attacker-influenced text? |
| 58 | |
| 59 | Yes, in four ways. The model-visible body is `{status, error.code, error.message}` (Lenshift |
| 60 | `serialize_result`, `lenshift/src/lib.rs:181`); the embedded `decision` is not rendered. The |
| 61 | `aien_legacy` dialect also puts the model's raw tool name in the wrapper tag |
| 62 | (`lenshift/aien_legacy.py:157`). |
| 63 | |
| 64 | | Source of text | Examples | Author | |
| 65 | |---|---|---| |
| 66 | | fixed pipeline text | `runtime authority raised an error`, `approval cancelled by host`, `too many tool calls in one turn`, `session limit exceeded: <limit>` | pipeline | |
| 67 | | echoed caller text | `no mapping for tool: <name>`, `duplicate request_id: <id>`, `duplicate parameter: <key>`, tool name in the aien_legacy tag | the model, steered by whatever it read | |
| 68 | | adapter text | `policy_denied` and `invalid_arguments` use the decision `reason` verbatim; `approval required: <id>` uses the adapter-minted id (mock: `mock-approval-<request_id>`, which embeds a model-chosen id); `unknown decision value: <value>` echoes an adapter string | the runtime adapter | |
| 69 | | runtime catalog text | `unknown capability: <capability>` | the catalog | |
| 70 | |
| 71 | The Odysseus adapter passes the gate's own reason through (`authority.py:197-212`, redacted and cut |
| 72 | to `_MAX_REASON`); the AIEN adapter passes reasons from AIEN's own primitives (`adapters/aien/src/lib.rs:394` |
| 73 | staging refusals, `:450-459` approval errors formatted as `approval refused: {e:?}` or `e.to_string()`, |
| 74 | `:591-607` the pending reason, `:803-809` the aegis gate reason). Neither checks that the reason is |
| 75 | free of text the model could be steered by. Whether any AIEN or aegis reason quotes arguments or |
| 76 | content is UNVERIFIED (those crates were not read for this note). |
| 77 | |
| 78 | Approval ids differ per adapter. Odysseus mints none (`authority.py:200-212`, `approval=None`), so |
| 79 | its body reads `approval required: ` with an empty id; its reasons go through `_redact` and a length |
| 80 | cut (`:117-118`). AIEN mints `aien-approval:<request_id>:<16 hex of the intent digest>` |
| 81 | (`lib.rs:598`), which embeds the model-chosen request id, so it is not opaque: it is echoed model |
| 82 | text plus a digest prefix. The mock id embeds the request id the same way. |
| 83 | |
| 84 | ## 4. Threat cases |
| 85 | |
| 86 | - T1 Laundering by label. A refusal recorded `trusted_runtime` while its body carries echoed or |
| 87 | adapter text puts untrusted bytes in the ledger under a trusted label. |
| 88 | - T2 Empty ledger becomes trust. The floor of an empty ledger is `external_untrusted` (fail |
| 89 | closed: the host told the ledger nothing). One refusal recorded `trusted_runtime` makes the ledger |
| 90 | non-empty and the floor `trusted_runtime`, higher than `user_supplied`, so the mock effect policy |
| 91 | (floor `user_supplied` or higher authorizes) would authorize effects with no registered input at |
| 92 | all. Demonstrated (scratch run, same pipeline, refusals patched to `trusted_runtime`): |
| 93 | nothing registered -> `trusted_runtime`; user registered -> `user_supplied`; today -> |
| 94 | `external_untrusted` in both. An attacker needs only a refused call (an unknown tool name). |
| 95 | - T3 Adapter echo of fresh content. A reason that quotes something the model has not seen (a |
| 96 | policy file line, a path listing) is new exposure. Not recording it, or recording it trusted, |
| 97 | hides it from the floor. |
| 98 | - T4 Echo of the model's own text (tool name, request id, argument key). No new information: the |
| 99 | model wrote it, so it carries at most the floor the model already had (the same argument as |
| 100 | CROSSVEIL.md:143-146). It cannot lower the floor below the turn's floor. |
| 101 | - T5 Same-turn mixing. A refusal and an untrusted read in one turn: the read must still lower the |
| 102 | floor, whatever the refusal did. |
| 103 | - T6 Held, approved, executed. The held reply, the continuation result and the executed result |
| 104 | must each stay in the ledger; approval must not reset the floor. |
| 105 | - T7 Mixed chains. Refusals interleaved with executed results: the floor may only fall or stay. |
| 106 | - T8 Adapter fault strings (decide raised, mismatched request id, unknown decision value): the |
| 107 | adapter is misbehaving; its text cannot be vouched for. |
| 108 | |
| 109 | Invariants every acceptable policy keeps: (I1) a refusal never raises the floor; (I2) an empty |
| 110 | ledger stays `external_untrusted` after a refusal; (I3) echoed or adapter text keeps its taint; |
| 111 | (I4) later calls are judged on the floor exactly as before; (I5) the existing conformance |
| 112 | verdicts are unchanged unless a change is listed and justified. |
| 113 | |
| 114 | ## 5. Candidate policies |
| 115 | |
| 116 | | Policy | I1 | I2 | I3 | Verdict | |
| 117 | |---|---|---|---|---| |
| 118 | | A. record as `runtime_instruction` + `trusted_runtime` | holds (min) | BREAKS (T2) | BREAKS (T1, T3) | unsafe | |
| 119 | | B. do not record | holds | holds | BREAKS for adapter text (T3): body seen, not in ledger; contradicts CORE.md:216-218 | unsafe for adapter text; safe only for pipeline-fixed text | |
| 120 | | C. keep `unknown` (today) | holds | holds | holds | safe, costs the floor after every refusal | |
| 121 | | R. refinement: record the refusal at the floor of the exposure the call was made under, for fixed and echoed text only | holds | holds (empty ledger gives external) | holds (T4 adds nothing new) | safe; does NOT fix the issue's example, whose held reply carries an adapter-minted id | |
| 122 | | V. R plus an optional adapter flag vouching that its `reason` and ids carry no content the model has not seen | holds | holds | holds if the adapter is honest (T3 becomes an adapter duty) | safe; fixes the example; new optional field | |
| 123 | |
| 124 | R sets a record's trust to the call's own turn floor, never above it. It cannot raise the floor |
| 125 | (min), and it cannot lower it, because the text it covers is the model's own or pipeline-fixed. |
| 126 | V adds one optional boolean-like field on the decision (a MINOR change in 0.x), defaulting to |
| 127 | today's behaviour; an adapter that does not set it is unchanged. |
| 128 | |
| 129 | ## 6. Decision |
| 130 | |
| 131 | Policies A and B are ruled out on security grounds (T2 is a concrete bypass; B hides adapter text). |
| 132 | The remaining choices (C, R, V) are all safe. They differ in cost, not in safety: |
| 133 | |
| 134 | - C: no protocol change; every later effect after a refusal is held. Zero new risk. |
| 135 | - R: protocol revision (CHANGELOG, MINOR bump, fixtures re-pinned where a refusal's record is |
| 136 | asserted, both SDKs). Helps pipeline rejections, not_found and cancels. Does not fix the todo |
| 137 | example. |
| 138 | - V: R plus a new optional decision field and an obligation on adapters. Fixes the todo example. |
| 139 | A wrong vouch only matters when the reason really carries fresh untrusted content, and a vouch can |
| 140 | never raise the floor above the turn floor. |
| 141 | |
| 142 | That was a product call (how much usability is worth a new protocol field and a new adapter duty). |
| 143 | It was made for C. R and V are kept as a revision candidate in |
| 144 | https://github.com/aien-spark/interplane/issues/80 with the trigger "real usability cost observed in a |
| 145 | host". The tests below pin what must hold under C, R and V alike, and pin today's behaviour. |
| 146 | |
| 147 | ## 7. Tests added (no behaviour change) |
| 148 | |
| 149 | `python/tests/test_refusal_exposure.py` (9) and |
| 150 | `rust/crates/interplane-crossveil/tests/refusal_exposure.rs` (9): same scenarios and strings. |
| 151 | Covered: I1, I2, echoed tool name with a later effect still held, an adapter reason carrying |
| 152 | injected text, held then approved then executed, a mixed chain ending in an untrusted read, a |
| 153 | todo-shaped floor sequence on the mock, the current-policy pin, and a table test that pins the |
| 154 | documented rule over 11 outcome rows: denied, requires_approval, not_found, a runtime `invalid` |
| 155 | decision (status `rejected`), an unknown decision value, a `decide` that raised, an `execute` that |
| 156 | raised, executed `error`, executed `timed_out`, and two pre-runtime rejections. Each ends at floor |
| 157 | `external_untrusted`; not-executed rows are recorded `unknown` / `unknown`, executed ones |
| 158 | `tool_result` / `unknown`. |
| 159 | |
| 160 | Red check: with refusals patched to `trusted_runtime` (policy A) 7 of 9 fail in each SDK; the real |
| 161 | code passes all 9. |