← Back to Pull requests

RHOAIENG-96081: Core BFF caller identity and credentials on every transport #10796

Closed
unknown closed this pull request without merging on Nov 26, 2026 14:40 UTC
View on GitHub
unknown unknown commented on Nov 19, 2026 13:58 UTC
Author

Builds on #10753 (merged). This branch is rebased onto main, so the diff contains only the 53 caller-auth commits. The shared TLS and runtime prerequisites (pkg/tls, startup validation, the runtime and bootstrap contracts) came in with #10753.

Fixes: https://redhat.atlassian.net/browse/RHOAIENG-96081

RHOAIENG-101218 (caller credentials on xKS, no silent service-account fallback) was closed as a duplicate and folded into RHOAIENG-96081, now "Core BFF caller identity and credentials on every transport"; this PR implements both halves. The final RHAII manifest RBAC (removing the service-account permissions this PR makes unnecessary) is tracked in RHOAIENG-104119.

Problem

On xKS (AKS with Entra ID), the gateway forwards the caller's Entra access token in both Authorization: Bearer and x-forwarded-access-token. Which of the two becomes the contract is not decided. Core BFF reads exactly one configurable header, so whichever one we pick, a gateway that sends only the other gets a 401 on every route.

The Kubernetes proxies had two gaps where a missing or wrong credential could be replaced by something else:

  • A request that reached a proxy without a caller token was forwarded without an Authorization header.

  • The proxies presented the kubeconfig client certificate when one was configured. The API server authenticates a certificate before a bearer token, so the certificate's subject would win over the caller.
  • The proxies also passed Impersonate-Uid and X-Remote- through to the API server.

    The RHAII EA journey on xKS (a non-admin signs in, deploys a model, deletes it) also reaches REST handlers that check the caller first and then let the dashboard service account do the write. The namespace serving-platform mutation is the main one. RHOAIENG-96081 (which absorbed RHOAIENG-101218) needs every supported user-initiated access to use the caller's credentials, and never to fall back to the service account.

    Solution

    One caller identity on every transport (RHOAIENG-96081).

  • A new internal/callerauth extractor is now the only place the caller token is read. InjectRequestIdentity calls it once per request, and REST handlers, the Kubernetes HTTP and WebSocket proxies, the model-serving proxy and the module proxies all use the result. The package does not depend on the Kubernetes package, so the identity provider can be swapped later.

  • A new setting, AUTH_TOKEN_HEADERS / --auth-token-headers, takes an ordered list of headers. The RHAII xKS manifest (manifests/distributions/rhaii/deployment.yaml) and the xKS contract suite use Authorization,x-forwarded-access-token; it replaces the manifest's --auth-token-header=x-forwarded-access-token --auth-token-prefix=. It is documented in distributions/core-bff/AGENTS.md, bff/README.md and docs/runtime-contract.md. When the setting is unset, the existing AUTH_TOKEN_HEADER/AUTH_TOKEN_PREFIX behaviour is unchanged (this is the OpenShift path). A module proxy entry with authorize: true receives the resolved token in every configured credential header (and in x-forwarded-access-token), with the Bearer prefix only in Authorization.

  • Precedence rules:

  • - Authorization must use the Bearer scheme. Other headers carry the bare token.
    - A header that is present but malformed fails the request. It does not fall through to the next header, because the edge may have authenticated exactly that header.
    - A repeated header, or a value with embedded whitespace or a comma, fails.
    - Two different tokens fail closed.
    - No credential returns 401.
    - The rules are in docs/runtime-contract.md, under "Caller credentials".
  • Startup refuses to start when:

  • - a prefix is set next to the list;
    - a header name is invalid or listed twice;
    - the list is set but names no header (, or whitespace only), instead of silently falling back to single-header mode;
    - an identity or session header (Cookie, Impersonate-
    , any X-Remote-, X-Forwarded-User, …) or a header the correlation middleware strips (X-Request-ID, Audit-ID) is configured as a credential header.
    - AUTH_TOKEN_HEADER is trimmed at startup and in the extractor, so a padded value that passes validation also matches requests.
    - The name and forbidden-header checks apply to the legacy AUTH_TOKEN_HEADER too, in both modes: module proxies still forward it, so it is checked even when the list is set. A rejected entry is reported by setting and position, never by value, so a token pasted into either setting by mistake stays out of the startup log. A forbidden prefix match is named by the prefix alone, and the startup log records only whether the legacy header is set and how many token headers are listed.
  • Every configured header is stripped before proxying, redacted in debug logs, allowed by CORS and listed in Vary. Token values never appear in error text.

  • Proxy changes:

  • - The proxies now also strip Impersonate-Uid and the whole X-Remote-
    family, matched case-insensitively (X-Remote-User, X-Remote-Group, X-Remote-Extra-, X-Remote-Uid and any other X-Remote- header).
    - The Kubernetes HTTP and WebSocket proxies return 401 rather than forward a request that has no caller token.
    - The proxies never present a kubeconfig client certificate with a caller credential. Outside DEV_MODE they don't present it at all. In DEV_MODE they present it only for the kubeconfig fallback identity (no credential sent), on a separate transport and connection pool. In-cluster configs carry no certificate, so OpenShift in-cluster behaviour does not change.
  • DEV_MODE falls back to the kubeconfig identity only when no credential was sent. A malformed or conflicting credential gets 401, as in production.

  • In the default make dev-bff profile (disabled auth, DEV_MODE, mock Kubernetes), the Kubernetes proxy runs the fallback identity as the envtest admin, as the mocked REST clients do, instead of impersonating the dev user.
  • Caller credentials for user-initiated access (RHOAIENG-96081, formerly RHOAIENG-101218).

  • repositories.CredentialPolicy sets whose credentials run a user-initiated operation. OpenShift keeps the RHOAI privileged-watcher model: the service account performs the operation after the handler has authorized the caller. On xKS, the caller's own clients perform it. This covers:

  • - the namespace serving-platform mutation;
    - ServingRuntime create;
    - connection-type create, update, patch and delete, including the existence check before each;
    - component removal;
    - cluster settings;
    - OdhDashboardConfig admin read and patch.
    - Dry-run requests follow the same policy.
  • A missing caller identity is a 401 (ErrIdentityUnresolved). No code path leads to the service account.

  • On xKS an RBAC denial reaches the client as the API server's 403/401. The connection-type, component-removal and cluster-settings endpoints normally report failures as 200 {"success": false}, but they no longer fold a denial into that shape.

  • PUT /api/cluster-settings makes several separate writes with no transaction. On xKS it first runs a self access review, with the caller's credentials, for every write it will make (OdhDashboardConfig patch, culler and segment-key ConfigMaps, notebook-controller rollout). It returns 403 before the first write if any is denied, so a partially permitted caller cannot leave a partial change. The writes are planned once and only the planned writes run: if the culler ConfigMap appears or disappears after the review, the planned create or update fails instead of switching to a write that was not reviewed. A ConfigMap write is planned only when it changes the stored value (no delete for an absent culler map, no update for a map that already holds the requested value), so a change to another setting needs no ConfigMap write access. Every ConfigMap operation is bound to the resourceVersion the plan read: a ConfigMap changed, created or deleted since the plan is a conflict rather than success, so an older save cannot overwrite a newer value, and the rollout decision comes from that same read. The segment-key ConfigMap is handled before the culler ConfigMap, so a conflict leaves the culler change for the retry to roll out; when the PVC size changed, the planned rollout still runs after a later conflict. A failed read is an error, never a change that triggers a rollout. When the caller finds no OdhDashboardConfig instance, GET builds the defaults directly, without a service-account read. An access review the authorizer could not evaluate (neither allowed nor denied, with evaluationError) also stops the save before any write, but is reported as 200 {"success": false}, not 403. A tracking opt-in while the OdhDashboardConfig sets disableTracking is refused the same way instead of reporting success for a setting left off.

  • On xKS GET and PUT /api/cluster-settings share one caller-scoped read (defaults only when no instance exists), and the cluster-settings patch is computed from the caller's own read of OdhDashboardConfig, and the update aborts if that read fails. It is never diffed against the defaults that the service-account bootstrap read falls back to. GET /api/cluster-settings returns 403 when the caller may not read the segment-key ConfigMap, instead of reporting tracking as disabled. PATCH /api/config builds its response from the patched object rather than re-reading through the bootstrap path.

  • Visible change on xKS: a caller who may create ServingRuntimes but may not patch the Namespace now gets {"applied": false} from GET /api/namespaces/:name/:context. The service account used to apply the label for them. The deploy flow already tolerates applied: false. Only that denial (any 403 from the API server) is applied: false on xKS; any other failure of the caller's patch (timeout, 5xx, missing namespace) is returned as that error. OpenShift keeps applied: false for every failed patch.

  • The remaining service-account operations on xKS are all reads. They are listed with resource, verbs and purpose in docs/bootstrap-contract.md, under "Service-account permissions":

  • - odhdashboardconfigs get;
    - odhapplications list;
    - connection-type ConfigMaps get and list in the dashboard namespace.
    - On a confirmed xKS platform the service account needs no write verb, and no access to namespaces, servingruntimes, deployments or auths. This list is the input for the final RHAII manifest RBAC in RHOAIENG-104119.

    Contract and compatibility.

  • No OpenAPI change. The 401 responses use the existing Unauthorized envelope.

  • With AUTH_TOKEN_HEADERS unset, OpenShift behaviour does not change. The OpenShift contract suite and the live-cluster run below pin this, including the service account applying the namespace mutation.

  • Open decision: which header the xKS gateway contract settles on. Either choice is a value of AUTH_TOKEN_HEADERS. Rejecting two different tokens assumes the gateway, and kube-rbac-proxy from #10199, put the same token in both headers.
  • Evidence

    Automated (run locally, on the rebased head)

  • go test ./... passes in distributions/core-bff/bff, with ENVTEST_ASSETS from make envtest.

  • golangci-lint run ./... reports 0 issues, and go vet -tags contract ./internal/... is clean.

  • pnpm run test:contract passes both suites in distributions/core-bff:

  • - OpenShift: 14 suites, 291 tests (289 before this change).
    - xKS: 15 suites, 286 tests (271 before this change).
  • New unit tests:

  • - internal/callerauth/credentials_test.go: precedence, every rejection (missing, empty, whitespace-only, non-Bearer, empty bearer, embedded whitespace or comma, repeated, conflicting, malformed-does-not-fall-through) and the legacy single-header behaviour. Every error is asserted to contain no token.
    - internal/api/caller_auth_transport_test.go: drives the real app.Routes() tree.
    - It checks that REST (plain and /core-bff-prefixed), the Kubernetes HTTP proxy, the WebSocket proxy, the model-serving proxy and the module proxy all see the same caller.
    - It checks that each one fails closed on no credential, conflicting credentials, a malformed header, or identity headers alone.
    - It also covers redaction, CORS and Vary with a custom header, client certificates kept only for the DEV_MODE fallback, the DEV_MODE fallback being limited to missing credentials, and a caller resolver that has no service-account fallback.
    - internal/proxy/caller_auth_test.go: caller-supplied impersonation, front-proxy and credential headers never reach the API server, and requests without a caller token are not forwarded. A TLS upstream that records client certificates shows both proxies present the DEV_MODE certificate only for the fallback identity, never with a caller token.
    - internal/repositories/cluster_settings_authz_test.go and internal/api/cluster_settings_caller_test.go: on xKS, every planned cluster-settings write is reviewed; a denied one returns 403 with nothing written; only planned writes run, so a culler ConfigMap that appears after a planned create fails the create and is never updated (TestUpdateClusterSettings_CullerAppearsAfterPreflight_NoUncheckedUpdate, TestClusterSettings_UpdateConfigMaps_ExecutesPlanned
    ); a ConfigMap changed after the plan is a conflict that keeps the newer value (TestClusterSettings_UpdateConfigMaps_CullerChangedAfterPlan_Conflict); unchanged ConfigMaps need no write review (TestClusterSettings_PlanUpdate_UnchangedConfigMapsNeedNoWrite); a retry after a conflict still restarts the controller (TestClusterSettings_SegmentKeyConflict_RetryStillRollsOut, TestClusterSettings_ConflictAfterPVCChange_StillRollsOut); an API-server denial during a write is 403; other failures keep the legacy shape; OpenShift makes no review. The patch is computed from the caller's read even when the service account is forbidden; a caller who cannot read the configuration gets 403 with nothing written; a segment-key denial on GET is 403; the PATCH /api/config response reflects the patch when the service-account read would fall back to defaults.
    - internal/config/validate_test.go and cmd/startup_test.go: the legacy header is checked in list mode; a forbidden prefix match never echoes its suffix; X-Remote-Uid is refused; a blank list fails startup; the startup log shows only tokenHeaderSet and tokenHeaderCount, never a token-shaped header name. caller_auth_test.go also sends X-Remote-Uid, an arbitrary X-Remote-* and a mixed-case variant, and none reaches the API server.
    - internal/repositories/credentials_test.go runs every policy-governed operation, dry-runs included, and checks that:
    - the caller's clients are used and the service account is untouched;
    - a missing credential, a nil resolver or nil clients fail the operation without touching the service account;
    - a forbidden caller gets a Forbidden error even when the service account in the fixture could have done the operation;
    - OpenShift still uses the service account.
    - A mutation check confirms the fallback test is not vacuous: temporarily making clientSource.typed fall back to the service account makes TestCallerPolicy_NoServiceAccountFallback fail.
  • New contract tests: xks/testCoreBffCallerAuth and openshift/testCoreBffCallerAuth use a new mock user, FAKE_SERVING_EDITOR_TOKEN. That user may create ServingRuntimes in test-ns-a but may not patch Namespaces. The same request returns applied: false on xKS and applied: true on OpenShift.
  • Live cluster (OpenShift, ODH 3.6.0)

  • Core BFF from this branch ran locally against the cluster's API server, configured once with the xKS settings and once with the OpenShift settings.

  • scripts/validate-caller-auth.sh (new) does the setup and teardown:

  • - It creates a throwaway namespace and a ServiceAccount that may create ServingRuntimes and list/watch pods there, but holds no cluster-scoped permissions.
    - It runs the checks with that ServiceAccount's token and with a cluster-admin token.
    - It deletes the namespace afterwards, by the UID its create returned (so a namespace recreated under that name is never deleted), and never prints a token. The check against default (M4) is a dry run, so it cannot change default even if existing RBAC admits the caller.
    - A check fails when curl exits nonzero (for example a timeout after a 200 status), before the status or body is compared.
  • Reproduce from distributions/core-bff against any logged-in cluster:
  •   scripts/validate-caller-auth.sh
      

      PLATFORM=OpenShift scripts/validate-caller-auth.sh
      

  • Result: every check passed, 25 with the xKS settings and 21 with the OpenShift settings.

  • - Header precedence: both headers are accepted alone or together; different tokens, Basic with a valid fallback, a rejected token, or identity headers alone all get 401. In OpenShift mode only x-forwarded-access-token is read.
    - Kubernetes HTTP proxy:
    - The ServiceAccount lists pods in its own namespace (200) but cannot list all namespaces (403), so the request runs as the caller and not as the kubeconfig cluster-admin.
    - An Impersonate-User: system:admin / Impersonate-Group: system:masters or X-Remote-User spoof still gets 403.
    - With no credential the proxy returns 401.
    - A dry-run ServingRuntime create returns 201 in the ServiceAccount's own namespace and 403 in default.
    - WebSocket proxy: a watch on the ServiceAccount's own pods upgrades (101); a cluster-wide watch gets 403; no credential gets 401.
    - Namespace mutation, xKS: the ServiceAccount gets {"applied":false} (real and dry-run) and the label is not written. Cluster-admin gets {"applied":true}.
    - Namespace mutation, OpenShift: the same ServiceAccount gets {"applied":true} with the label written by the service account, unchanged from before.
    - Debug log: the ServiceAccount and admin token values appear 0 times.

    <details>
    <summary>xKS-mode output</summary>

    H1   Authorization: Bearer                                      expect 200                got 200                PASS
    H2   x-forwarded-access-token                                   expect 200                got 200                PASS
    H3   both headers, same token                                   expect 200                got 200                PASS
    H4   both headers, different tokens                             expect 401                got 401                PASS
    H5   Basic scheme with a valid fallback (no fall-through)       expect 401                got 401                PASS
    H6   no credential                                              expect 401                got 401                PASS
    H7   token the API server rejects                               expect 401                got 401                PASS
    H8   identity headers without a credential                      expect 401                got 401                PASS
    P1   caller lists pods in its namespace                         expect 200                got 200                PASS
    P2   caller lists all namespaces (not permitted)                expect 403                got 403                PASS
    P3   Impersonate-User/Group spoof is stripped                   expect 403                got 403                PASS
    P4   X-Remote-User spoof is stripped                            expect 403                got 403                PASS
    P5   no credential: the BFF identity must not act               expect 401                got 401                PASS
    P6   caller dry-run creates a ServingRuntime where allowed      expect 201                got 201                PASS
    P7   caller dry-run create where not allowed                    expect 403                got 403                PASS
    W1   caller watches pods in its namespace                       expect 101                got 101                PASS
    W2   caller watches all namespaces (not permitted)              expect 403                got 403                PASS
    W3   no credential                                              expect 401                got 401                PASS
    M1   caller without Namespace patch, dry run                    expect {"applied":false}  got {"applied":false}  PASS
    M2   caller without Namespace patch                             expect {"applied":false}  got {"applied":false}  PASS
    M3     ...and nothing was written                               expect                    got                    PASS
    M4   caller who fails the access review, dry run                expect 403                got 403                PASS
    M5   admin applies the mutation                                 expect {"applied":true}   got {"applied":true}   PASS
    M6   admin resets the platform                                  expect {"applied":true}   got {"applied":true}   PASS
    L1   token values in the debug log                              expect 0                  got 0                  PASS
    

    </details>

    Vanilla Kubernetes (Kind, the RHAII Tilt cluster rhaii-tilt, Kubernetes 1.35, no OpenShift APIs)

  • Setup: make setup-kind from distributions/rhaii/developing, plus the KServe v0.19.0 CRDs only (the KServe controllers and cloud-provider-kind were not needed for these checks).

  • Out of cluster: the branch's BFF built locally, using the Kind kubeconfig as its own identity. That kubeconfig authenticates with a cluster-admin client certificate, so P2, W2 and M1–M3 also show the certificate is dropped for caller requests.
  •   PLATFORM=XKS scripts/validate-caller-auth.sh
      

  • In cluster: the RHAII image built from this branch and run as the rhaii-dashboard Deployment with --platform-type=XKS --auth-token-headers=Authorization,x-forwarded-access-token and no --dev-mode. Its ServiceAccount can list namespaces cluster-wide, so P2 (403) shows no caller request falls back to the pod's own identity.
  •   PLATFORM=XKS BFF_URL=http://localhost:4100 scripts/validate-caller-auth.sh
      

  • Result: every check passed in both runs, 25 out of cluster and 24 in cluster (L1 reads the local log only; for the pod, a scan of its debug log found 0 tokens).

  • The Tilt image build itself (tilt up) fails on main today, independent of this PR: distributions/rhaii/Dockerfile pins golang:1.25 while distributions/core-bff/bff/go.mod requires Go 1.26. I built the image with --build-arg GOLANG_BASE_IMAGE=golang:1.26 for the in-cluster run.
  • With AUTH_METHOD=disabled and DEV_MODE, every request is the kubeconfig fallback identity, so the proxies present the kubeconfig certificate and real-cluster local runs keep working. Without DEV_MODE, disabled auth is mock-only.

  • DEV_MODE certificate fix, live on Kind: --dev-mode with the cluster-admin certificate kubeconfig and a caller token scoped to one namespace, listing all namespaces through /api/k8s. Before the fix (eb3bd5225f) this returned 200, because the request ran as the certificate. With the fix it returns 403. The caller's own pods and the no-credential fallback still return 200.
  • Validated vs. deferred for AKS / Entra

    Validated in this PR, with real API-server tokens and RBAC:

  • Both header modes and their precedence. AUTH_TOKEN_HEADERS=Authorization,x-forwarded-access-token (the RHAII manifest value) was exercised with each header alone, both carrying the same token, and two different tokens (rejected).

  • Caller credentials on every xKS operation, with no service-account fallback. This covers REST, the Kubernetes HTTP and WebSocket proxies, and cluster-settings writes.

  • Denials surfacing as 401/403.

  • These ran on OpenShift (ODH 3.6.0) and on vanilla Kubernetes (Kind), out of cluster and in cluster as a Deployment with no OpenShift APIs.

  • scripts/validate-caller-auth.sh reproduces the run against any cluster.

  • On the current head the script was re-run on a local Kind cluster in xKS mode (kind-xks-10199-bare). Every row passed, including the M7/M8 positive control (a ServiceAccount that may patch only the test Namespace applies the mutation with its own credentials). The ServingRuntime rows were skipped because that cluster has no ServingRuntime CRD, and the admin rows because no admin token was set; no cluster-scoped objects were left behind, and the namespace was removed on exit. After review 6072972056, stubbed-kubectl runs on that cluster checked the namespace cleanup too: an ambiguous namespace create is deleted only after its label is confirmed, a failed label read or a UID-precondition conflict is reported and fails the run, and default keeps its labels after M4. Earlier runs also checked the guards: an occupied PORT exits before touching the cluster, and a BFF that dies on startup ends the run with its log tail and cleans up the namespace. Credentials now reach curl, the WebSocket client and the log scan only through 0600 files, never as process arguments.
  • Deferred, not proven here:

  • The Entra-issued token arriving through the shared Gateway and kube-rbac-proxy (#10199) on AKS.

  • The non-admin model deploy and delete journey behind it.
  • The Entra gateway and kube-rbac-proxy hop is the only piece the runs above don't cover. It is tracked in RHOAIENG-67109 (validate the RHAII production deployment through the shared Gateway on AKS). Broader independently runnable xKS contract coverage is in RHOAIENG-96086.

  • Known follow-up, not in this PR: the redactor for proxy error diagnostics (httpcontract/proxy_redaction.go) recognises the two well-known token headers but not a custom AUTH_TOKEN_HEADERS name. The generic Bearer pattern still catches an echoed token.
  • Known limitations and follow-ups

  • Cluster settings across GET and PUT. The PUT body carries no version, so a form loaded before another admin's save still writes its own values over it (last writer wins, as before this PR). The resourceVersion binding covers concurrent saves inside one request. Fixing it needs versions in the API and the frontend.

  • Upstream text in legacy success: false bodies. Connection types, components and cluster settings keep the pre-existing shape that puts the upstream error text in error.

  • Admission denials count as denials. Any 403 from the API server, including an admission webhook or policy that denies with 403, is treated as a denial (applied: false, or 403 on cluster settings); the status cannot tell them apart.

  • xKS notebook-controller rollout. A culler or PVC change still plans the rollout, so under caller the caller needs patch on that Deployment even where it does not exist (a missing Deployment is now nothing to restart). Gating it on a platform capability is the existing TODO.

  • Per-request rebuilding of the credential header list and of the caller clients (performance only).

  • DEV_MODE with an exec-plugin kubeconfig (for example kubelogin): the Kubernetes proxies have no kubeconfig credential to present for the fallback identity (documented).
  • Rollout patch failure. If the culler ConfigMap write succeeds and the notebook-controller rollout patch itself fails, a retry sees the stored settings and does not restart the controller. The merge base behaves the same, and the OpenAPI states it. A durable fix needs applied-settings state on the Deployment, plus get on deployments; that is a separate change.

  • Remaining partial-write window. The plan is re-checked before the first write. A change in the short window between that check and the ConfigMap writes can still leave the OdhDashboardConfig patched while a conflict is reported. There is no transaction across the OdhDashboardConfig and the ConfigMaps; a retry converges.

  • Empty credential headers outside DEV_MODE (list mode). They are skipped like absent ones, so Authorization: Bearer T plus an empty x-forwarded-access-token is caller T. Under DEV_MODE any sent credential header disables the fallback. Rejecting them in production waits for the xKS gateway header decision.

  • Mock-mode WebSocket identity. With MOCK_K8S_CLIENT, a mapped mock user's WebSocket runs as the envtest identity. Unmapped tokens are refused (401). This affects local mocks only.

  • Proxy error redaction of a custom AUTH_TOKEN_HEADERS name (see Evidence).

  • Review 6046334615 lower-priority items (an encoded trailing slash in the proxy base path, mock module auth, TLS rotation logging, the BFF_URL trailing slash, origin trailing-dot and IPv6 forms, RelaxedServiceNameValidation, two doc fixes), plus review 6059203374's P3s (OpenShift branding when the ClusterVersion instance is missing, bounded waits in ws_identity_test.go), go to a follow-up task.

  • Live gateway. The Entra token through the shared Gateway and kube-rbac-proxy on AKS remains unverified (RHOAIENG-67109).
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: paulovmr Review duration: 10122m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #10796"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%