# Which invariants prevent identity spoofing from surviving continuous authorization re-evaluation under AAIF **Date of Record:** 2026 November 20 **Scope:** Applies to agents operating under an Agent Authorization & Identity Framework (AAIF) where a signed identity assertion is minted once at session establishment and the authorization decision is re-evaluated on a cadence (per tool call, per token window, or per delegated sub-task). Does not cover static bearer-token systems without re-evaluation, nor human-in-the-loop consent flows. ## Core Distinction The failure is not "a forged credential was accepted." It is subtler: a **legitimately minted identity assertion** is reused by a *different execution context* after the authorization layer has already re-evaluated and re-approved the *original* context. AAIF splits the decision into two artifacts that drift apart: - **The identity assertion** (who the agent claims to be): a signed, time-bounded token minted at session start, carrying issuer, subject, delegation chain, and capability grants. - **The authorization verdict** (what it may do right now): recomputed continuously from live signals — current tool scope, resource sensitivity, behavioral telemetry, delegation depth. The invariant that prevents spoofing from surviving re-evaluation is **binding identity to the live execution context, not to the session**. If the verdict is recomputed against a context fingerprint that the identity assertion does not itself commit to, an attacker (or a confused deputy) can present a valid assertion from context A while the verdict is being evaluated for context B. Re-evaluation then *launders* the spoof: each fresh approval looks clean because it was computed against the wrong subject. ## What Was Observed A delegated sub-agent (`planner.worker-3`) was issued an AAIF assertion at T0 with subject `agent:planner`, delegation chain `[orchestrator → planner → worker-3]`, and a capability set scoped to `read:dataset`. At T0+40s the orchestrator re-scoped the task to `write:dataset`. The authorization layer re-evaluated on the next tool call and approved `write:dataset` — because the *live context fingerprint* it checked (task ID, resource handle, delegation depth) matched the re-scoped task, and the assertion's signature verified. The problem: the assertion's `cnf` (confirmation) claim bound to a session key, not to the task context. A second worker (`worker-7`) that had captured the assertion via a misconfigured shared memory channel presented it during its own tool call. The re-evaluator computed the verdict against `worker-7`'s live context — a `write:dataset` task with matching delegation depth — and approved. Signature valid. Delegation depth valid. Resource handle valid. The subject was wrong, but nothing in the re-evaluation path compared the *asserted* subject to the *executing* subject. The trace: 1. T0 — assertion minted for `worker-3`, `cnf` = session key `K3`, no task binding. 2. T0+40s — task re-scoped; re-evaluator approves `write:dataset` for `worker-3` context. 3. T0+41s — `worker-7` replays assertion; presents `K3` proof-of-possession (leaked via shared memory). 4. T0+41s — re-evaluator recomputes verdict against `worker-7`'s live context; approves. 5. T0+42s — unauthorized write executes under `worker-3`'s asserted identity. The spoof did not defeat the signature check. It defeated the **subject-continuity check** that re-evaluation assumed but never performed. ## Condition of Validity Continuous re-evaluation is only sound when the following invariant holds for every verdict: > `verdict.subject == assertion.subject == executing_context.subject` and the assertion commits to the *task context* (task ID, resource handle, delegation depth) via a claim that the re-evaluator recomputes and compares, not merely the session key. If the assertion binds only to a session key, the invariant degrades to `proof-of-possession == session key`, which is satisfiable by any holder of the key regardless of subject. If the assertion binds to task context but the re-evaluator does not recompute that binding, the invariant is *assumed* rather than *enforced* — the exact gap observed. The condition fails whenever any of the three subject references is derived from a different source than the other two. In practice this happens when: (a) the assertion's `cnf` is session-scoped rather than context-scoped; (b) the re-evaluator trusts the assertion's subject field without cross-checking the executing process identity; (c) delegation re-scoping mutates the task context without re-minting the assertion. ## Decision Boundary The boundary between "re-evaluation strengthens authorization" and "re-evaluation launders spoofing" is whether the re-evaluator performs a **subject-continuity join** on every verdict. Concretely: - **Enforce:** on each re-evaluation, recompute `context_fingerprint = H(task_id, resource_handle, delegation_depth, executing_process_id)` and require it to equal the fingerprint committed in the assertion's `ctx` claim. Reject on mismatch with a distinct error class — not a generic auth failure, because the failure mode (valid signature, wrong subject) must be distinguishable from (invalid signature) for incident response. - **Reject:** any verdict where the assertion's subject is not independently attested by the executing runtime (e.g., process attestation, sandbox identity), even if signature and delegation chain verify. - **Bound the window:** re-mint the assertion on every task re-scope. A re-scoped task with a stale assertion is a spoofing vector by construction, because the old assertion's context binding no longer describes the live execution. The decision boundary is sharp: if the re-evaluator cannot join subject-to-context, it must fail closed. A permissive default ("signature valid, therefore authorized") is precisely the laundering path. ## Operational Effect After enforcing the subject-continuity join, the observed replay at T0+41s fails at step 4 with a context-fingerprint mismatch: `worker-7`'s executing context does not match the `ctx` claim minted for `worker-3`'s task. The verdict is denied, and the denial is logged as a `SubjectContinuityViolation`, distinct from signature failures, so the leaked session key is flagged for rotation rather than treated as a routine auth miss. The operational cost is one additional attestation call per re-evaluation and re-minting on every task re-scope. The benefit is that continuous re-evaluation stops being a laundering surface: each fresh approval is computed against the subject that will actually execute, and identity spoofing cannot survive a single re-evaluation cycle because the join fails before the verdict is issued. The residual risk is attestation latency: if the executing runtime cannot attest within the re-evaluation deadline, the verdict must default to deny, which can stall legitimate sub-agents under load. This is the correct trade — a stalled agent is recoverable; a laundered spoof is not. ```python import hashlib from dataclasses import dataclass class SubjectContinuityViolation(RuntimeError): """Raised when a valid AAIF assertion is presented by a non-matching executing context.""" pass @dataclass(frozen=True) class Assertion: subject: str task_id: str resource_handle: str delegation_depth: int ctx_fingerprint: str # committed at mint time @dataclass(frozen=True) class ExecutingContext: subject: str task_id: str resource_handle: str delegation_depth: int process_id: str def compute_fingerprint(task_id: str, resource_handle: str, depth: int, process_id: str) -> str: payload = f"{task_id}|{resource_handle}|{depth}|{process_id}".encode() return hashlib.sha256(payload).hexdigest() def re_evaluate(assertion: Assertion, ctx: ExecutingContext) -> bool: # Subject-continuity join: assertion subject must equal executing subject. if assertion.subject != ctx.subject: raise SubjectContinuityViolation( f"assertion subject {assertion.subject!r} != executing subject {ctx.subject!r}" ) # Context binding: the fingerprint committed in the assertion must match # the live execution context, not merely the session key. live = compute_fingerprint(ctx.task_id, ctx.resource_handle, ctx.delegation_depth, ctx.process_id) if assertion.ctx_fingerprint != live: raise SubjectContinuityViolation( f"context fingerprint mismatch for subject {ctx.subject!r}: " f"asserted={assertion.ctx_fingerprint[:12]} live={live[:12]}" ) return True def authorize_tool_call(assertion: Assertion, ctx: ExecutingContext, capability: str) -> bool: # Fail closed on any continuity violation; never fall back to signature-only. try: re_evaluate(assertion, ctx) except SubjectContinuityViolation as exc: raise SubjectContinuityViolation( f"denied {capability!r} for {ctx.subject!r}: {exc}" ) from exc return True ```