Repository navigation
docs: design record for the external decision hook - #59
Merged
Merged
Conversation
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]>
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.
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
timeoutMsandonErrorare 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.hook_denied), because whether policy or the inspector refused a call points at different systems and often different teams.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