Skip to content

feat: inspect what an upstream asks of the caller - #62

Merged
blakebauman merged 1 commit into
mainfrom
feat/decision-hook-reverse
Aug 13, 2026
Merged

blakebauman merged 1 commit into
mainfrom
feat/decision-hook-reverse

Conversation

@blakebauman

Copy link
Copy Markdown
Member

Phases 3 and 4 of docs/design-decision-hook.md, which completes it. Follows #60 and #61.

The hook's third stage, and the case design-server-initiated.md deferred here by name. Policy decides whether an upstream may elicit at all; serverInitiated decides whether this elicitation is acceptable. "Refuse one that asks the human for an API key" is now a passing test rather than a promise in a design record — the test drives a real upstream whose tool samples benignly and then asks for a credential, and asserts the first goes through and the second never reaches the human.

It is the strongest of the three stages

Stage On denial
ingress prevents the action
egress withholds the disclosure only — the upstream has already acted
serverInitiated prevents, and prevents what egress cannot reach

The client is never asked, so no model tokens are spent and no human sees the prompt.

The upstream's params ride in the envelope's arguments field rather than earning a fourth one: "what is being asked for" is the role arguments already play on the forward path, and an inspector reading an elicitation's message and requested schema is reading the same kind of thing it reads from a tool call.

The docs pass closes three loops

  • security-model.md's reverse-direction section said the content question's answer "is the external decision hook". It now says which stage, and what refusing there actually does.
  • design-server-initiated.md records that its deferral held — the thing it declined to build structurally exists out-of-process, as designed.
  • The README's content-inspection non-goal has promised "an opt-in content-inspection hook (an external policy endpoint on the ingress/egress path)" since v1.0. It finally points at the thing it promised.

Verification

make check including lint, make conformance 40/40, and the elicitation test above. With this, Horizon 2 item 9 is done in all four phases.

🤖 Generated with Claude Code

The hook's third stage, and the case design-server-initiated.md deferred here
by name: policy decides whether an upstream may elicit at all, and this
decides whether *this* elicitation is acceptable. "Refuse one that asks the
human for an API key" is now a passing test rather than a promise made in a
design record.

It is the strongest of the three stages. Ingress prevents an action; egress
only withholds a disclosure, because the upstream has already acted. This one
prevents too, and prevents something egress cannot reach — the client is never
asked, so no model tokens are spent and no human is shown the prompt.

The upstream's params ride in the envelope's arguments field rather than
earning a fourth one: "what is being asked for" is the role arguments already
play on the forward path, and an inspector reading an elicitation's message
and requested schema is reading the same kind of thing it reads from a tool
call.

Docs closed the loop in both directions. security-model's reverse-direction
section said the content question's answer "is the external decision hook" —
it now says which stage and what refusing there does. design-server-initiated
records that its deferral held. And the README's content-inspection non-goal,
which has promised an external policy endpoint since v1.0, finally points at
the thing it promised.

Phases 3 and 4 of docs/design-decision-hook.md, which completes it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@blakebauman
blakebauman merged commit 24317e9 into main Aug 13, 2026
7 checks passed
@blakebauman
blakebauman deleted the feat/decision-hook-reverse branch August 13, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant