Skip to content

docs: design record for the external decision hook - #59

Merged
blakebauman merged 1 commit into
mainfrom
docs/design-decision-hook
Aug 13, 2026
Merged

blakebauman merged 1 commit into
mainfrom
docs/design-decision-hook

Conversation

@blakebauman

Copy link
Copy Markdown
Member

Horizon 2, item 9 — the last item the other design records keep deferring to. No code yet; this is the record that has to exist first, because the feature has more pre-commitments than anything else in the tree.

Three design records defer to it by name (server-initiated governance sends "refuse an elicitation asking for a password" here; definition pinning sends judgement here; the content-inspection non-goal has promised it since v1.0). It also does a second job: declining a plugin runtime is only credible if there is one seam where an organization can put its own judgement, and a wire contract can be reviewed, versioned, rate-limited, and run by a different team than the one running the gateway.

The line the feature lives or dies on

The hook decides, and cannot rewrite. No redacted arguments, no filtered results. A hook that could edit traffic would be the transformation non-goal with an extra hop — fold buffering and mutating bodies, behavior through the gateway no longer matching the upstream, and the conformance suite enforcing a fiction. A hook that wants content changed refuses the call and says why.

What the record settles

  • Ingress sits after policy. The hook's allow is necessary but never sufficient, it never sees traffic the gateway already refused, and an organization that turns the hook off is still governed.
  • timeoutMs and onError are required, with no defaults. "Deliberate configuration choice" means refusing to start without one. Both readings are legitimate — compliance wants traffic to stop when inspection stops, availability-first wants the gateway to keep serving — and guessing would be wrong half the time, in a direction the operator discovers during an incident.
  • A hook denial gets its own audit outcome (hook_denied), because whether policy or the inspector refused a call points at different systems and often different teams.
  • A fail-open error is recorded on the event that proceeded. "This call was allowed without inspection" is exactly what a compliance review needs and exactly what a fail-open deployment would otherwise lose.
  • Sending arguments and results to a second endpoint is a data-egress decision, stated in those words. No redaction knob: a partial body is a scanner's blind spot, and choosing what to strip is the content judgement being delegated.
  • A slow hook is more dangerous than a broken one, because fail-open turns it into an invisible bypass — so the timeout abandons the request rather than advising.

Deliberately not in v1

Rewriting, hook chains (that is the plugin hub through the back door — fan-out belongs behind the operator's own endpoint), gRPC or a Go plugin interface, inspecting notifications, and hooking list results (which would multiply the cost by the size of the federation).

One question left open

Whether a denial should be able to tell a caller how to comply rather than return free text — different in kind for whether an agent can retry successfully. That is a wire contract with a compatibility cost, and it wants someone with a real hook in front of them rather than an answer decided in advance.

Docs only. Four implementation phases are scoped at the end of the record.

🤖 Generated with Claude Code

Three design records now defer to this feature by name, and the README's
content-inspection non-goal has promised it since v1.0. It is also what makes
declining a plugin runtime credible: declining is only honest if there is one
seam where an organization can put its own judgement, and a wire contract can
be reviewed, versioned, and run by a different team than the gateway.

The line the feature lives or dies on: the hook decides, and cannot rewrite.
A hook that could edit traffic would be the transformation non-goal with an
extra hop — fold buffering and mutating bodies, behavior through the gateway
no longer matching the upstream, the conformance suite enforcing a fiction. A
hook that wants content changed refuses the call and says why.

What the record settles rather than leaving to implementation. Ingress sits
after policy, so the hook's allow is necessary but never sufficient and its
operator is never handed traffic the gateway already refused. timeoutMs and
onError are both required with no defaults: "deliberate configuration choice"
means refusing to start without one, and guessing between fail-open and
fail-closed would be wrong half the time in a direction an operator discovers
during an incident. A hook denial gets its own audit outcome, because whether
policy or the inspector refused a call points at different systems and often
different teams. And a fail-open error is recorded on the event that
proceeded, since "allowed without inspection" is precisely what a compliance
review needs and what a fail-open deployment would otherwise lose.

Sending arguments and results to a second endpoint is a data-egress decision.
The record says that in those words, and declines to offer a redaction knob:
a partial body is a scanner's blind spot, and choosing what to strip is the
content judgement being delegated.

One question is deliberately left open — whether a denial should be able to
tell a caller how to comply rather than return free text. That is a wire
contract with a compatibility cost, and it wants someone with a real hook in
front of them.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@blakebauman
blakebauman merged commit 33134d1 into main Aug 13, 2026
7 checks passed
@blakebauman
blakebauman deleted the docs/design-decision-hook branch August 13, 2026 19:12
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