Repository navigation
feat(security): attenuate positron AI observers — confused-deputy clamp - #1733
Merged
Merged
Conversation
A positron session multiplexes two principals over ONE socket: the human at
the surface, and any AI observer that PERCEIVES that surface and acts back
through a CommandEnvelope. They must not share authority. Before this, the
dispatch bridge (ExecutorDispatch) discarded envelope.source and minted a
fixed ws(nil) identity for BOTH — so the instant socket auth exists, an AI
observing a human's screen would ride the human's authority up. That is the
confused-deputy escalation (Instagram-hack shape) positron exists to prevent.
Fix, source-side and load-bearing:
- New CallerSource::PositronObserver { observer_id } + CallerIdentity::
positron_observer constructor (auth_policy.rs). Empty granted_capabilities —
the tier clamp IS the attenuation; that field is only ever for owner-signed
escalation grants, never a deny-list.
- Both source→trust maps in grid_trust_policy.rs gain a PositronObserver arm.
The divergence from Ws lives in resolve_trust: the observer is clamped at a
FIXED Provisional that NEVER consults the trust bridge, so it cannot rise
when the same peer_id is registered Owner. caller_trust gives it the same
AiSafe ceiling statically. Today both are plain Provisional; the moment
socket auth elevates the human's Ws socket, the observer stays put.
- ExecutorDispatch now branches on envelope.source via a pure, total
caller_for_source() helper: Human → ws(nil) (unchanged), Observer →
positron_observer(nil, id). Isolated as a pure mapping so the security
decision is unit-tested without an executor.
The observer keeps the full AiSafe surface (perceive + ai/generate) — it is
capped, not muted. Realizes "ceiling strictly below the human's" without
overclaiming a strictly-lower-today number.
Tracked precondition (task #29, documented in both files, not asserted away):
the PositronObserver *identity* is locally minted, but WHICH identity is
minted is selected by the positron envelope's client-declared `source` field.
The clamp presumes an HONEST source — a compromised observer self-labeling
`source: Human` would be minted Ws. Harmless today (Ws == Provisional); the
clamp is only COMPLETE once the same GH-auth handshake that raises the Ws
ceiling also authenticates the positron principal. Doc corrected from an
inaccurate "unforgeable over the wire" claim per spawned security review.
Tests (one per touched file, each with // what this catches:):
- positron_observer_carries_its_observer_id_and_no_grants (constructor)
- positron_observer_never_rides_the_human_socket_authority_up (THE clamp:
same Owner-registered peer_id → Ws allowed code/shell, observer forbidden,
bridge ignored; observer still allowed ai/generate)
- observer_and_human_sources_map_to_distinct_attenuated_identities (dispatch)
Validated: cargo check + the 3 tests green (metal,accelerate).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
force-pushed
the
feat/positron-observer-attenuation
branch
from
July 3, 2026 04:42
f12a49a to
66b4900
Compare
Contributor
Author
|
Spawned security review: APPROVE-WITH-NITS — no critical findings in the three edited files. Confirmed by the reviewer:
Nit addressed (pushed): my doc claimed the observer source was "unforgeable over the wire." That was inaccurate — the Merging to canary (staging). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A positron session multiplexes two principals over one socket: the human at the surface, and any AI observer that PERCEIVES that surface and acts back through a
CommandEnvelope. They must not share authority.Before this,
ExecutorDispatchdiscardedenvelope.sourceand minted a fixedCallerIdentity::ws(nil)for both — so the instant socket auth exists, an AI observing a human's screen would ride the human's authority up. That is the confused-deputy escalation (the Instagram-hack shape) positron exists to prevent.The fix (source-side, load-bearing)
auth_policy.rs— newCallerSource::PositronObserver { observer_id }+CallerIdentity::positron_observerconstructor. Emptygranted_capabilities— the tier clamp IS the attenuation; that field is only ever for owner-signed escalation grants, never a deny-list.observer_idis audit-only, never affects the ceiling.grid_trust_policy.rs— both source→trust maps gain aPositronObserverarm. The divergence fromWslives inresolve_trust: the observer is clamped at a FIXED Provisional that NEVER consults the trust bridge, so it cannot rise when the samepeer_idis registeredOwner. Today bothWsand observer are plain Provisional; the moment socket auth elevates the human'sWssocket, the observer stays put — the divergence is structural and activates automatically.positron_dispatch.rs—ExecutorDispatchnow branches onenvelope.sourcevia a pure, totalcaller_for_source()helper:Human → ws(nil)(unchanged),Observer → positron_observer(nil, id). Isolated as a pure mapping so the security decision is unit-tested without an executor.The observer keeps the full AiSafe surface (perceive +
ai/generate) — it is capped, not muted. Realizes "ceiling strictly below the human's" without overclaiming a strictly-lower-today number.Tests (one per touched file, each with
// what this catches:)positron_observer_carries_its_observer_id_and_no_grants— constructor keeps the id, no grants.positron_observer_never_rides_the_human_socket_authority_up— THE clamp: same Owner-registeredpeer_id→Wsallowedcode/shell, observer forbidden (bridge ignored); observer still allowedai/generate.observer_and_human_sources_map_to_distinct_attenuated_identities— dispatch maps the two sources to distinct identities.Validation
cargo checkclean + all 3 tests green (--features metal,accelerate). Pre-existing warnings only; no new ones from this change.🤖 Generated with Claude Code