Skip to content

AI keys and budgets change through litellm:keys and litellm:key - #211

Merged
FlexOr2 merged 5 commits into
mainfrom
claude/issue-202-p9c-litellm-keys
Nov 8, 2026
Merged

FlexOr2 merged 5 commits into
mainfrom
claude/issue-202-p9c-litellm-keys

Conversation

@FlexOr2

@FlexOr2 FlexOr2 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

A budget or limit change is one pull request to infrastructure/litellm/keys.yaml plus mise run litellm:keys, and a new app's key is one row there plus mise run litellm:key <app>, which tells LiteLLM the value already in that app's Secret.

  • litellm:keys [--plan] sends only the fields that differ, by the stored hash once exactly one row was counted under the alias, and never reads an app's Secret. --plan exits 0 with no change, 2 with changes and 1 on failure.
  • litellm:key <app> makes the key only when the alias is free, reports unchanged when the stored hash equals the value's sha256, and refuses any other value.
  • A key's value and the master key travel from kubectl's stdout through a shell variable to curl's stdin, never through an argument, a URL or a file, and no output holds a value or its hash.
  • The table's numbers are hal's code defaults. A write on the PC waits for the operator's yes on the numbers --plan shows.

About 285 production lines in four files, against a limit of 100 in three: both commands share one table and one way in, and the item's Done when needs both halves.

Work-Item: #202
Closes #202

Routing: build sonnet-5.5/medium; review opus-5.5/high; gate gpt-6-astra/high; fix sonnet-5.5/medium; land haiku-5.5/low. Blocking: cell cleanup killed its forward → review and gate; failed table read as no change, missing number lifts a limit → review and gate; duplicate deciders → review; vacuous reset assertion, cells not proving their sentence → review and gate; unknown write reported as not made → review and gate; secret in tracing and arguments → gate; trailing newline stripped before validation → gate; revision not tied to the table → gate

🤖 Generated with Claude Code

FlexOr2 and others added 5 commits November 8, 2026 21:13
…'s key

Budgets and limits lived only in hal's config and its one-off key step. The
table infrastructure/litellm/keys.yaml, carried by the ConfigMap litellm-keys,
is now the one source: `mise run litellm:keys [--plan]` sends only the fields
that differ (a pure budget change keeps the period's reset), and
`mise run litellm:key <app>` registers the value already in that app's Secret.
A key's value and the master key travel from kubectl's stdout through shell
variables to curl's stdin and are never printed, put in an argument, a file or
a child's environment; the reply of /key/generate goes to /dev/null.

Rejected: a Job (needs every value in a second Secret), the terraform provider
(generates the value and keeps it in state), a file in the checkout (stale on
an old PC checkout).

Serves #202, slice P9c of #173.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nd keep values out of traces

Both reviews of the first tip found that a table row without a number planned a null that lifts a budget, a failed table
read printed "no change", a write with a lost answer was reported as not made, a trailing newline in a Secret value was
stripped before validation, bash -x printed decoded values, the revision was read apart from the table, and the cell
killed its own port-forward before cleanup used it. The table is checked once in read_table, the failed write is named
apart from the unmade ones, decode keeps the exact bytes, the revision is read before and after the table and refused
when absent or changed, and the cell authorizes through curl's stdin and hands the client Pod its value through a
secretKeyRef. The update keeps the stored hash after exactly one row was counted under the alias.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…es from a mounted Secret

The cell no longer emits add-mask lines, disables tracing, and gives the client Pod curl's header as a file of a Secret so neither arguments nor stored spec hold the value. The fake test builds its own table rows and reads the person budget id from the layer.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ci.yml: main's legal steps and the lane's LiteLLM failed-write step both kept.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 8, 2026

Copy link
Copy Markdown

@FlexOr2
FlexOr2 merged commit bf570f0 into main Nov 8, 2026
14 checks passed
@FlexOr2
FlexOr2 deleted the claude/issue-202-p9c-litellm-keys branch November 8, 2026 22:24
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.

P9c: AI keys and budgets change through litellm:keys and litellm:key

1 participant