Repository navigation
RC1-1: AuthBridge Hop 1 — shared harness→LLM egress gateway (behind SH_AUTHBRIDGE) - #96
Merged
Merged
Conversation
Add deploy/knative/authbridge/ab1-deployment.yaml — the shared harness->LLM reverse-proxy gateway for RC1-1 Hop 1. Runs the AuthBridge authlib INBOUND pipeline (inference-parser -> ibac -> static-inject) in front of https://api.anthropic.com, using the static-policy ibac gate (no_intent_policy: allow, judge_inference: true) and static-inject keyed by key_by: static / key: api.anthropic.com (not the inbound Host). Inert by default: applied only when SH_AUTHBRIDGE=1, not wired into any kustomization base. Add an 'AB1 manifest' describe block to authbridge-manifests.test.ts asserting the Deployment/Service/ConfigMap shape, the container image, and the embedded config's inbound plugin chain order and static-inject key config. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Adds deploy/knative/authbridge/harness-egress-ab1.yaml, a SH_AUTHBRIDGE=1-only tightened egress NetworkPolicy (same name serverless-harness-egress, applied by task 1g on the RC1 path to overwrite the base policy at apply time). It replaces the base's external 0.0.0.0/0:443 rule with an AB1-scoped rule (podSelector app=authbridge-ab1, TCP 8080) and keeps only the 6443 apiserver port (drops 443), realizing Z2's 'harness reaches only AB1'. The base deploy/knative/harness-egress-policy.yaml is left byte-for-byte unchanged so the flag-off default keeps its existing external-LLM egress on an enforcing CNI (OCP). Adds a manifest-shape test describe block asserting: single NetworkPolicy named serverless-harness-egress, same podSelector/policyTypes as the base, an AB1 egress rule on TCP 8080, DNS (53) and apiserver (6443) rules present, and explicitly no rule combining ipBlock 0.0.0.0/0 with port 443. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
…-1 claims - setup-kind.sh (1g): under SH_AUTHBRIDGE=1, require a real ANTHROPIC_API_KEY, create ab1-llm-cred (real key, keyed api.anthropic.com) and llm-credentials (AB1-PLACEHOLDER, base-url=http://authbridge-ab1:8080) so the harness pod is secret-free, then apply ibac-stub.yaml + authbridge/ab1-deployment.yaml + the tightened authbridge/harness-egress-ab1.yaml (overwrites the base NetworkPolicy by name) and wait for both Deployments to roll out. Flag-off path runs the original step-8 logic unchanged inside an else branch. - leaf-smoke.sh (1f): under SH_AUTHBRIDGE=1, add three gated claims after Setup and before Claim 2 — H1-secret-free (harness env holds only the AB1 placeholder + base URL, no sk-ant-/sk-* leak), H1-allow (a leaf only completes if AB1 injected the real key), and H1-deny (flip AB1's no_intent_policy to deny, prove the leaf fails and AB1 rejects before injecting via its logs, then unconditionally revert to allow so Claims 2-8 run in allow mode). Entirely new block; no existing lines touched. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Add || true to the H1-deny probe dispatch so a curl timeout / connection drop under set -euo pipefail cannot abort the script before the unconditional ab1_set_policy allow revert, which would otherwise strand AB1 in no_intent_policy:deny for the rest of this and future runs. Also bail out of ab1_set_policy with return 1 (logging a warning) when the ConfigMap read comes back empty, so a transient empty $cur can no longer overwrite config.yaml with empty content and break AB1 after restart. Both ab1_set_policy call sites gain || true so the new return-1 path cannot itself abort the script under set -e. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
…pefail)
The H1-deny claim never actually flipped AB1 to no_intent_policy: deny:
its ConfigMap read used an invalid jsonpath ({.data["config.yaml"]}),
returning empty so ab1_set_policy bailed. Also make the deny check robust:
prove deny-before-inject via a direct 403 probe (a leaf dispatch raced the
AB1 restart via harness connection pooling), poll with a longer wget timeout,
and neutralize wget's non-zero exit so pipefail doesn't drop a matched 403.
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
…ne 403 match) Whole-branch review nits: the H1-deny comment said 'outbound chain' (the chain is under pipeline.inbound); and the deny probe matched the bare substring '403' — tighten to the SSE status line 'HTTP/x 403' to avoid a false positive from e.g. a Content-Length containing 403. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
pdettori
commented
Jul 13, 2026
pdettori
left a comment
Member
Author
There was a problem hiding this comment.
Summary
(Posting as a COMMENT review — GitHub blocks self-approval; this would otherwise be an APPROVE.)
Clean, well-scoped RC1-1 "Hop 1" AuthBridge gateway. The in-cluster reverse-proxy (authbridge-ab1) holds the real Anthropic key and injects it per-request, so the harness carries only a placeholder + AB1's base URL.
Verified:
- Correctly feature-flagged —
SH_AUTHBRIDGEdefaults to0everywhere (${SH_AUTHBRIDGE:-0}); new manifests are inert (not wired into any kustomization base); the base egress policy stays byte-for-byte unchanged so the flag-off default is preserved. - No egress-policy overwrite conflict on Kind — the "applied after base" comment is forward-looking for the OCP path (task 1g).
setup-kind.shappliesservice.yamldirectly (not via kustomize), so the tightened AB1 variant is the sole egress policy on Kind. kindnet doesn't enforce egress anyway; OCP is the live gate, per the manifest comment. - Referenced pre-existing files (
ibac-stub.yaml,harness-egress-policy.yaml,packages/ibac-stub) all exist on the branch. - Defensive leaf-smoke deny path — probe-based 403 assertion (deny-before-inject proof, since ibac runs before static-inject),
|| truepipefail neutralization for BusyBox wget, and always-revert-to-allow regardless of outcome.
Areas reviewed: Shell, YAML/K8s manifests, CI, TypeScript tests
Agent/IDE config (.claude/.vscode): none
Commits: 8, all signed-off (DCO ✅)
CI status: passing (all 10 checks green)
Two nit-level observations inline — neither blocks merge.
Assisted-By: Claude Code
The AB1 manifests are pinned to namespace: default, but the Hop-1 AuthBridge ops run via -n "$NS". If NS were overridden, those kubectl calls would target the wrong namespace and silently no-op through the || true guards, making the H1 claims fail confusingly. Assert NS=default up front with a clear message. Addresses review nit on rossoctl#96. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
8 tasks
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.
RC1-1 — AuthBridge Hop 1: shared harness→LLM egress gateway (behind
SH_AUTHBRIDGE)Routes the harness's LLM egress through a shared AuthBridge reverse-proxy gateway (AB1) that injects the real Anthropic key, so the harness pod holds only a placeholder. Everything is behind the
SH_AUTHBRIDGEfeature flag (off by default); when off, the setup/leaf-smoke path is byte-for-byte unchanged. No harness runtime code change — this is deploy/config + manifest-shape tests + a live smoke.What's here
deploy/knative/authbridge/ab1-deployment.yaml— AB1Deployment+ ClusterIPService+ configConfigMap. AB1 is a reverse proxy tohttps://api.anthropic.comrunning the inbound chaininference-parser → ibac → static-inject:ibacis the control gate (staticno_intent_policy),static-injectinjects the real key asx-api-keyfrom a mountedab1-llm-credsecret (control runs before injection, so a denied request never gets a key).deploy/knative/authbridge/harness-egress-ab1.yaml— tightened egress NetworkPolicy variant: the harness reaches only AB1 + DNS + Redis + apiserver, no public:443. Same NetworkPolicy name as the base so it overrides on apply; the base policy is untouched (applied only on theSH_AUTHBRIDGEpath).deploy/knative/setup-kind.sh—SH_AUTHBRIDGEwiring: createab1-llm-cred(real key), repoint the harnessllm-credentialsto the placeholder + AB1 base-url, apply the AB1 stack. Flag-off keeps the existing secret logic verbatim.deploy/knative/leaf-smoke.sh—SH_AUTHBRIDGE-gated Hop-1 claims: harness is secret-free, allow-path leaf completes (real key injected at AB1), andno_intent_policy: denyreturns403at ibac before static-inject.:443);packages/ibac-stubadded to the CI per-packagetsclist.Validation
Live on Kind:
SH_AUTHBRIDGE=1 LEAF_LIVE_SMOKE=1 leaf-smoke.sh→ 13/13 PASS (secret-free + allow-path + deny-before-inject + all 9 standard leaf claims).Depends on (AuthBridge image,
kagenti-extensions)The
authbridge-proxyimage needs thestatic-injectplugin (#655) and the reverse-proxy SSE/streaming fidelity fixes (#657, fixes #656). The RC1 image is built from those.Scope
Behind
SH_AUTHBRIDGE(off by default). RC1-2 (Hop 2, per-sandbox forward proxy) and RC1-4 (OCP) follow in subsequent PRs.Assisted-By: Claude Code