Skip to content

feat(gamma): add isolated private mTLS billing gateway - #4

Open
pamanseau wants to merge 24 commits into
kubetee-prodfrom
gamma-mtls-release
Open

pamanseau wants to merge 24 commits into
kubetee-prodfrom
gamma-mtls-release

Conversation

@pamanseau

@pamanseau pamanseau commented Nov 12, 2026 •

Copy link
Copy Markdown

Candidate only — no customer gateway deployment

  • Private listener is isolated on port 4001 behind the candidate ClusterIP service, separate from public 4000.
  • Four directional certificates; identity derives only from verified peer DER, not request headers.
  • Worker holds only its dedicated outbound leaf and a separately gated Type 22 seed; never the gateway outbound client or private server key.
  • Claim/rotation/native max_budget API operations use exact-key fencing and measured worker management calls; no direct DB or spend-log writes.
  • PR CI must prove real btcli signing and local image scan; production publication stays restricted to kubetee-prod.

Verification: complete overlay suite in the upstream base image, 74 passed including real btcli signing and mTLS negative cases. Clean pinned worker wheel: 47 passed; signed worker evidence run 43257411203.

  • Worker candidate: ghcr.io/kubetee-ai/gamma-funder:0.1.0-rc.202611121619@sha256:ad7cbb8d9e003bc0c3a96d7c0d85f83e3429694636c23262d1f0728190a61fdc, cosign-verified, in its measured offline draft only.
  • Candidate-only manual CI publication is scoped to this feature branch; ordinary PR/push is build-only. Gateway kubetee-prod remains untouched.

No measured policy, Fleet image, init-data, deployment, KBS upload, chain transaction, or rollout is part of this PR. The subsequent measured release requires a new immutable tag, signed production run, full tag@digest policy and separate activation approval.
LEAF_UNSET:all

Made with Cursor

pamanseau and others added 14 commits November 12, 2026 16:11
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@pamanseau

Copy link
Copy Markdown
Author

Review candidate narrowed at a059cf1. The separate worker cannot request or receive a raw virtual-key credential: it performs only chain reconciliation/native checkpoint CAS. The /internal/v1/gamma/key/issue HTTP endpoint is removed; raw-key output is confined to the measured gateway InProcessIssueClient after funded reconciliation. Test correction enforces the InProcessIssueClient rather than bypassing peer authentication. Final local Docker Desktop suite: 76 passed in 63.92s. Candidate source dispatch: https://github.com/KubeTEE-AI/litellm/actions/runs/43261330274 . Candidate gamma tag only; NO kubetee-prod merge, Fleet image change or rollout. Current production remains 1.108.3-kubetee.3@sha256:b0ca6bb07a084530f6b616ab8b4884315dae3f37594ff3c533553b4a129b57cd, healthy 3/3 and independently TDX verified against live pod litellm-ddfb48f9-s6h45; STREAMING verified. Unactivated preview only; no KBS upload/seed or real Finney action is part of this PR.

pamanseau and others added 5 commits November 12, 2026 18:42
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@pamanseau

Copy link
Copy Markdown
Author

Verified signed review candidate from exact commit 7311c81c4ae4390769532052fa51e6fd1ce35cb5; production kubetee-prod remains untouched.

  • Build/provenance/scan evidence: run 43263325688 — success, 76 passed; upstream-base signature and native aiohttp transport verified.
  • Immutable image: ghcr.io/kubetee-ai/litellm-database:1.108.3-gamma.0.0.7311c81c4a@sha256:bba13650a6b1010995d1d93f1f9a7e3de161af329c8d013f1b8b5a144830b128.
  • Independently verified with cosign verify --certificate-identity-regexp 'https://github.com/KubeTEE-AI/litellm/.github/workflows/build-litellm-overlay.yaml.*' --certificate-oidc-issuer https://token.actions.githubusercontent.com <tag>; signature matches the digest above.
  • Disposable authenticated Redis data/Sentinel fixtures exercise actual Summit host resolution, refresh and isolated transport OAuth.

Tests prove directional mTLS, in-process delivery and SDK transport against stubs, not actual public API streaming, a real spendGamma, or live claim-time key management. This remains a non-deployed candidate; no KBS upload, measured policy update or gateway rollout has occurred.

pamanseau and others added 5 commits November 12, 2026 22:52
…inning

Authenticate every native key operation as the dedicated Gamma service user and team instead of a proxy-admin context, enumerate only that team through the native key list, and serialize credential issue across replicas with a fencing lease.

Ship kubetee_gamma_tls.py in the overlay image and its import check; the private listener imported it but the image did not contain it.

Add an opt-in staging Management API probe (zero budget, blocked keys, team scoped). Native key regeneration is an Enterprise feature and the conditional metadata+max_budget credit stays fail closed, so activation remains gated.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Sentinel identity test asserted db 15, which only matched one manual target and failed against CI's disposable Sentinel on db 12. Read the database, data username and monitor credential from the URI, restore the distinct monitor-credential assertion, and always release the pooled connection.

Co-authored-by: Cursor <cursoragent@cursor.com>
A credit is now one native /key/update carrying the receipt checkpoint and
the new absolute max_budget together, replacing the unconditional
'atomic credit CAS' refusal. max_budget must equal
metadata.gamma.total_settled_units before and after; anything else is
refused before writing. Non-credit checkpoint transitions can no longer
change settled totals or receipts.

The first credit enables the reserved key in the same write. Key delivery no
longer writes the row: a native key update rewrites the whole metadata column
from its own earlier read, so the previous claim-time unblock could roll back
a concurrent credit. A funded key that is blocked is treated as an operator
block and is not handed out.

Native spend is LiteLLM's float usage meter and is no longer a precondition
or an exactness check for checkpoints, credits or key delivery.

Co-authored-by: Cursor <cursoragent@cursor.com>
…is licensed

LiteLLM's native /key/regenerate is Enterprise-gated for every caller,
master key included (staging probe 2026-11-12). The regenerate challenge
action, POST /v1/gamma/key/regenerate and the management issue path now
return 501 key_rotation_not_available before any challenge is consumed,
lease taken or worker called. KUBETEE_GAMMA_KEY_ROTATION=
native-enterprise-regenerate restores the unchanged native path.

Co-authored-by: Cursor <cursoragent@cursor.com>
max_budget is the only money field the Gamma path writes; spend stays
LiteLLM's own usage meter. Also drop an unused worker-hostname read: SNI is
always the worker URL host.

Co-authored-by: Cursor <cursoragent@cursor.com>

This branch has not been deployed

No deployments
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