Repository navigation
Add Anthropic key slots api-5 to api-10, the key practice and a no-token health check - #969
Merged
seathatflowsinourveins merged 8 commits intoOct 12, 2026
Merged
Conversation
seathatflowsinourveins
force-pushed
the
claude/api-actions-key-slots-20261010
branch
from
October 11, 2026 21:27
28c99ca to
445c61c
Compare
seathatflowsinourveins
marked this pull request as ready for review
October 11, 2026 21:28
seathatflowsinourveins
force-pushed
the
claude/api-actions-key-slots-20261010
branch
from
October 12, 2026 02:12
5ca54b8 to
295c3e5
Compare
Stored through the credential terminal on the owner's direction (2026-10-10). No admin-key slots: every organization behind the stored keys is an individual account, and the Admin API is unavailable for individual accounts (Anthropic docs, read 2026-10-10). Data-only inventory entries; api-actions' PR adds the docs, evidence and tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The six slots added in the previous commit were not in INJECTABLE_IDS, so both inventory-driven set assertions failed at that commit. ANTHROPIC_IDS now lists all ten Anthropic slots; INJECTABLE_IDS and the same-grammar setter/runner test use it, so every slot is written through the hidden-prompt setter and injected through credential_run.py with synthetic values only. Failing-first: with the e1c88ff inventory the three affected tests fail (failures=14, errors=18: the setter and the runner refuse anthropic-api-5..10 as unknown ids, and both id sets differ); with this branch's inventory they pass. The previous commit changed adoption/credential-inventory.json without its evidence binding, so this commit registers it with the test file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
tools/credentials/anthropic_key_health.py ports the command center's anthropic_key_health.sh to the repository. For each anthropic-api slot in inventory order it runs credential_run.py <slot> --check (starts nothing), and for a stored slot runs the probe child through credential_run.py <slot> --only ANTHROPIC_API_KEY. The key reaches only the child's environment; the request headers go to the child as JSON on stdin, so no argv carries a value. The child sends GET /v1/models and GET /v1/organizations/me to the fixed API host, follows no redirect, reads no body, and prints statuses and the first eight characters of the anthropic-organization-id response header. The report never holds a key, an organization name or a response body. The port drops the script's organization-name read and its admin-key probe. HTTP handling follows tools/credentials/alpaca_rate_limit_probe.py; the header and endpoint are documented in the Claude API overview and the Admin API page (read 2026-10-10). Tests use a fake opener, a fake runner, and the real credential_run.py over a temporary store with a synthetic key; no test makes a network call. Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs/secret-storage.md gains rows for anthropic-api-5 to anthropic-api-10 and a "Key practice (2026-10-10)" section, the repository copy of the command center's record. It covers slot purposes by organization id prefix, one purpose per slot, hidden-prompt storage, per-command use, main-only environment secrets for CI, the health check, tracking, rotation, spend control, and fill-first failover with anthropic-api-3 kept for CI. Owner direction is attributed, not quoted; account names and balances are left out. The no-Admin-API and cache-isolation statements quote Anthropic's Admin API, Usage and Cost API and prompt-caching pages, read 2026-10-10. The gh stdin statement quotes the installed gh 2.102.0 help. The inventory gives anthropic-api-3 its purpose (CI Claude review, the main-only claude-review environment secret) and a rotation step that resets that secret. The notes of anthropic-api-3 and anthropic-api-4 mark "no Anthropic key is stored in GitHub" as superseded under the owner's ruling of 2026-10-10 (PR #968). No other entry changes. The new decision record names the evidence, alternatives, overturn conditions and SOTA sources. As in #930, the harness-defaults correction row now covers every slot, and the five secret-storage line citations in upstream-surface-dispositions.json move by the 122 inserted lines. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The owner revised the fill-first order at about 15:12Z on 2026-10-10 (relayed by the command center). The order is now anthropic-api-4, anthropic-api-3, anthropic-api-5, anthropic-api, anthropic-api-2, then anthropic-api-6 to anthropic-api-10 as stored. anthropic-api-3 serves the CI Claude review first and local quality work second; it is no longer kept out of the order. Its key remains the main-only claude-review environment secret. The key practice section, the practice table (anthropic-api-5 now follows anthropic-api-3), the credentials table row, the inventory label and notes of anthropic-api-3, and the decision record follow the revision. The decision record also adds an overturn condition for CI credit drawn down by local work, and corrects the CPython citation range to L623-L656. The five secret-storage line citations in upstream-surface-dispositions.json follow the doc's line count. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two paragraphs of the key practice section carried uneven line breaks from earlier edits; the text is unchanged. The rewrap removes one line, so the five secret-storage line citations in upstream-surface-dispositions.json move up by one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The command center refreshed its record to the 15:12Z fill-first order; the decision cites the new sha256. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The co-op's GPT read at 445c61c (2 P2): - slots() now applies scripts/credential_status.py's inventory check, as the credential runner does, and refuses an anthropic-api entry in another shape or an inventory with none: exit 1 before any slot is checked, naming counts and inventory ids only. Before, entries: [] or an entry with no variables gave an empty report and exit 0. - probe_slot() fails a child that exited nonzero or was killed (CompletedProcess.returncode, CPython 3.13.16 Lib/subprocess.py:484) before reading its output, and a line that reports an error is probe_failed whatever status it printed. Before, a 200 line followed by exit 7, a signal, or an error passed with exit 0. - docs/secret-storage.md says so; the catalog's five citations of its later lines move by the four lines added. Co-Authored-By: Claude Opus 5.5 <[email protected]>
seathatflowsinourveins
force-pushed
the
claude/api-actions-key-slots-20261010
branch
from
October 12, 2026 04:13
295c3e5 to
5c5bff1
Compare
seathatflowsinourveins
deleted the
claude/api-actions-key-slots-20261010
branch
October 12, 2026 04:45
This was referenced Oct 12, 2026
seathatflowsinourveins
added a commit
that referenced
this pull request
Oct 12, 2026
The command center's read of #969 at 28c99ca passed with three quality notes. The commit that answered them (ea7f3638, 2026-10-10) stayed on a local follow-up branch and never reached the merged PR. This is that commit, ported to current main: - anthropic-api-6 holds a second key of anthropic-api-5's account, so it adds no credit; the slot table and the next-key step say so (next: anthropic-api-7, from a new account). Checked 2026-10-12 with credential_run.py --check: anthropic-api-6 stored, anthropic-api-7 missing. - anthropic_key_health.py reports a 429 that carries retry-after as rate_limited and exits 0 for it, so a daily timer does not alarm on throttling. A 429 without retry-after is the tier's spend cap (Anthropic's errors and rate-limits pages: no retry-after, usage paused until the next month), reported as spend_capped, and it fails, as do every other non-2xx answer and main's probe_failed. Only the header's presence is kept. The tests fail on main's tool (3 failures, 1 error). The third note, a planned CI fallback to anthropic-api-4, lapsed when Claude review inside GitHub was retired (#981); the record says so. The decision cites the command center's refreshed key-practice record (sha256 ee25fc91..., unchanged). Five dispositions locators into docs/secret-storage.md move by five lines; the files are re-registered. Co-Authored-By: Claude Opus 5.5 <[email protected]>
seathatflowsinourveins
added a commit
that referenced
this pull request
Oct 13, 2026
The command center's read of #969 at 28c99ca passed with three quality notes. The commit that answered them (ea7f3638, 2026-10-10) stayed on a local follow-up branch and never reached the merged PR. This is that commit, ported to current main: - anthropic-api-6 holds a second key of anthropic-api-5's account, so it adds no credit; the slot table and the next-key step say so (next: anthropic-api-7, from a new account). Checked 2026-10-12 with credential_run.py --check: anthropic-api-6 stored, anthropic-api-7 missing. - anthropic_key_health.py reports a 429 that carries retry-after as rate_limited and exits 0 for it, so a daily timer does not alarm on throttling. A 429 without retry-after is the tier's spend cap (Anthropic's errors and rate-limits pages: no retry-after, usage paused until the next month), reported as spend_capped, and it fails, as do every other non-2xx answer and main's probe_failed. Only the header's presence is kept. The tests fail on main's tool (3 failures, 1 error). The third note, a planned CI fallback to anthropic-api-4, lapsed when Claude review inside GitHub was retired (#981); the record says so. The decision cites the command center's refreshed key-practice record (sha256 ee25fc91..., unchanged). Five dispositions locators into docs/secret-storage.md move by five lines; the files are re-registered. Co-Authored-By: Claude Opus 5.5 <[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.
Scope
anthropic-api-5toanthropic-api-10(the command center's local commit, cherry-picked), records the 2026-10-10 key practice indocs/secret-storage.md, and addstools/credentials/anthropic_key_health.py, a no-token health check per slot. It follows Add two optional direct Anthropic Console key stores #930's pattern.8b1ef0c37, with 8 commits. Three rebases:e1c88ff3donto8c95a50d1(the command center's triage): onlymanifests/evidence.jsonconflicted; main's copy was taken and each commit re-registered.86fa38442: besidesmanifests/evidence.json, two conflicts, each resolved as the command center approved ("go 969").tests/test_credential_run.py'sINJECTABLE_IDSis the union of this PR'sANTHROPIC_IDSform (all ten) and main'salpaca-paper-c(Credential inventory: alpaca-paper-c slot for paper account C; the guard reads a one-letter pointer suffix #1014). The catalog's fivedocs/secret-storage.mdcitations are re-derived from the rebased document as the line that names each key;tests.test_upstream_surface_watchpasses at each of the 8 rebased commits. This PR's own changed lines in the inventory,docs/harness-defaults.md,docs/secret-storage.mdand the health tool are unchanged by the rebase.8b1ef0c37(the command center's ask before landing): onlymanifests/evidence.jsonconflicted; main's side was taken and each commit re-registered. Without the manifest, the patch-ids of all 8 commits and of the whole range are identical to295c3e51's. The two "go 969" resolutions are unchanged:tests/test_credential_run.pyanddocs/secret-storage.mdare identical to295c3e51's, and this PR's changed lines in the catalog are identical too (main's Resolve the upstream-surface backlog to Claude Code 2.1.296 and Codex rust-v0.162.1 #950 changed other lines of it).lane:foundation.adoption/credential-inventory.json,docs/secret-storage.md,docs/decisions/2026-10-10-anthropic-key-slots-and-practice.md(new),docs/harness-defaults.md,catalogs/foundation/upstream-surface-dispositions.json(citation lines moved),tools/credentials/anthropic_key_health.py(new),tests/test_anthropic_key_health.py(new),tests/test_credential_run.py,manifests/evidence.json.Key practice, from the owner's directions of 2026-10-10 (relayed by the command center, paraphrased):
open_credential_terminal.sh's hidden-input window, and injected per command bycredential_run.py.main-restricted environment secrets.Inventory:
anthropic-api-4.anthropic-api-3gets its purpose (CI review first, then local quality work) and its rotation now includes re-setting theclaude-reviewsecret.anthropic-api-3andanthropic-api-4are marked superseded by the API-key ruling (Authenticate CI Claude review with an API key in a main-only environment #968).Health tool:
credential_run.py. Request headers go to the child on stdin from an allowlist, and the child follows no redirects and reads no response body.anthropic-organization-idresponse header). It never shows a key or an org name.After the GPT read at
445c61c1(CHANGES_REQUESTED, two P2s), one commit,5c5bff1eat the head (written as5ca54b8c, then rebased as295c3e51at 02:12Z and as5c5bff1eat 04:13Z; the tool and its tests are byte-identical):entries: [], or ananthropic-apientry with no variables, exited 0. The tool now appliesscripts/credential_status.py'sinventory_errorsfirst, as the credential runner'sload_inventorydoes. Ananthropic-apientry in another shape, or noanthropic-apientry, is refused too. Each exits 1 before any slot is checked, naming only counts and inventory ids.probe_exit_<n>, orprobe_signal_<n>for a negative code: CPython 3.13.16Lib/subprocess.py:484, "The exit code of the process, negative for signals"). A line reporting an error, at the top level or forGET /v1/models, isprobe_failedwhatever status it printed.docs/secret-storage.mdand the decision record describe the change. The catalog's five citations of latersecret-storage.mdlines move by the four lines added.Follow-ups (not in this change):
295c3e51(PASS on the code; its P3s):probe_failed, notunreachable: the child prints a request error with no status, and any models error fails the probe.docs/secret-storage.md:158-159andvalidity()'s docstring still listunreachable(now produced only by a line with neither a status nor an error). Either fail only a status that comes with an error, keepingunreachable, or update the vocabulary. The exit status is unchanged.probe_exit_1where it saidunexpected_RuntimeError. The probe still fails.probe_exit_137, notprobe_signal_9: the credential runner returns 128+N for a signalled command, soprobe_signal_<n>appears only when the runner itself is signalled.445c61c1in the record: state which assertions fail first.docs/secret-storage.md:2767citestests/test_credential_run.py:67,280-309; the two-lineANTHROPIC_IDSinsertion moved those targets to:69and:282-311.Lib/subprocess.py:484(it is cited in the fix section only; added below).blueprints/runtime-workers/openhands/resolver/patch_policy.py:137citesdocs/secret-storage.md:199-200forcore.hooksPath, already wrong at the base.28c99ca9(PASS_WITH_P3); the local follow-up branchclaude/api-actions-key-slots-followup-20261010(ea7f3638) carries the first, second and fourth, to open as its own PR after this lands:anthropic-api-6described as empty indocs/secret-storage.mdand rule 11 (the record was fixed at 16:04Z);anthropic-api-4on credit exhaustion;build_opener.445c61c1:docs/harness-defaults.mdand the manifest: normalize them when those records are next maintained.295c3e51(its P2, a stale base line in an earlier capture of this body, was already fixed by the 02:49Z edit; its P3s):missing (not found)and ends with a signal or an unexpected code becomesnot stored, and the tool exits 0. Accept a missing store only with the runner's expected return code, and add a regression for a missing line followed by exit 7 or a signal.scripts/credential_status.py:109andtools/credentials/credential_run.py:167,172at86fa38442, next to the fail-first evidence.Order with #968: this PR's docs describe the
claude-reviewenvironment secret that #968 introduces. Land #968 first.SOTA sources
/v1/organizations/meunder "Accessing organization info".anthropic-organization-id.Lib/urllib/request.py#L623-L656: a redirect copies the request headers to the new URL, which is why the probe follows none.Lib/subprocess.py:484(python/cpython@cbc944f4, and the installed file, sha2563418c49f…): "returncode: The exit code of the process, negative for signals." (the probe's return-code check).80cc49d53), the slot pattern;tools/credentials/alpaca_rate_limit_probe.py(no redirect, no body read), the HTTP-probe pattern.Evidence-class table
synthetictests.test_credential_run(94). With the test change on main's inventory:FAILED (failures=14, errors=18); with the new inventory: OKsynthetictests.test_anthropic_key_health(20 at5ca54b8c), including the real runner with a generated key; four deliberate weakenings of the tool are each caught by a testsynthetic445c61c1(8 failures) and pass at5ca54b8c; nine weakened copies of the fix each fail themLocal commands run
At
445c61c16(the first rebase, on8c95a50d1):The builder also ran test_canary_proof, test_codex_worker_lane, test_credential_boot_receipt, test_host_requests, test_new_wsl_definitive_defaults and test_currency_due; all OK.
At
5ca54b8c(the fix commit before the 02:12Z rebase; the tool and its tests are byte-identical at295c3e51):At the head
295c3e51(2026-10-12, on86fa38442):At the head
5c5bff1e(2026-10-12 04:13Z, on8b1ef0c37; the registry-only rebase of295c3e51):Decision record
docs/decisions/2026-10-10-anthropic-key-slots-and-practice.md.🤖 Generated with Claude Code