Skip to content

Add two optional direct Anthropic Console key stores - #930

Merged
seathatflowsinourveins merged 1 commit into
mainfrom
codex/ns2604-anthropic-keys-20261009
Oct 9, 2026
Merged

seathatflowsinourveins merged 1 commit into
mainfrom
codex/ns2604-anthropic-keys-20261009

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator

Scope

Add optional anthropic-api-3 and anthropic-api-4 as separate Console-key stores for direct Anthropic consumers. Both reuse the existing hidden-prompt setter and selected-id runner, with ANTHROPIC_API_KEY injected per command. The declarations mirror #889; full feature and batch acceptance remains separate.

  • Base commit: 22e3ef6ffd53b09f3cb335c46f7c696093521274.
  • Lane: lane:foundation.
  • Owned paths: credential inventory; upstream-surface dispositions; the dated additional-key decision; harness-defaults and secret-storage docs; evidence manifest; credential-run tests.

SOTA sources

  • Repository reference #889, aba02ec3456d383bcc2fc72883db098f9be7918a: adoption/credential-inventory.json:222, catalogs/foundation/upstream-surface-dispositions.json:206, docs/decisions/2026-10-08-anthropic-api-second-key.md:12, docs/harness-defaults.md:93, docs/secret-storage.md:24, manifests/evidence.json:5263, tests/test_credential_run.py:39 and :383. The new decision records every mirror citation.
  • Anthropic authentication, fetched 2026-10-09: Console-key creation, SDK environment input and workspace scope.
  • Claude Code environment variables, fetched 2026-10-09: noninteractive key use and interactive approval before overriding subscription sign-in.
  • Existing metadata-driven runner and guard at base 22e3ef6ffd53b09f3cb335c46f7c696093521274: tools/credentials/credential_run.py:151, scripts/hooks/secret_path_guard.py:202 and :229. Existing SECRET_NAMES and store-root rules already cover both entries.

Evidence-class table

Claim Evidence class Command / receipt
All four ids use the existing setter/runner grammar with isolated fake stores, private permissions, selected-variable injection and no echo synthetic tests.test_credential_run, 94/94 passed; generated values in temporary stores
Inventory/docs/evidence readers complete without failures synthetic Twelve module processes rc0; 740 passed of 891 discovered, 151 skipped
Merge-base tests retain two exact-id expectations that the new entries change synthetic CC base_tests_at_head.sh rc1: 94 tests, two failures in one modified existing test file; both expectation changes declared below
Changed-file integrity and scope checks pass local_integration python3 scripts/validate.py, rc0; 70 components, 10940 hashed files, 4 profiles, 239 receipts
Store metadata, source citations, guard coverage and official authentication guidance agree source_review Seven mirrored paths, dated decision and public documentation observed 2026-10-09

Gateway feature-parity failure is a reported coordination input. Account credit, billing, workspace scope and direct feature/Batches acceptance were not tested by this change.

Local commands run

Each module ran under timeout 600, nice/ionice, at concurrency two. All returned rc0; skipped cases are listed as unexecuted.

The designated CC pre-cue script, command-center/cc-tools/base_tests_at_head.sh
(SHA256 249a427f6bae4f413c1d35250d35d5c9e91359f881dc5ad1974a3a38c6a44115,
3247 bytes), ran the merge-base copy of the one modified existing test file
against this head. It returned rc1: 94 baseline tests, two failing ids:

  • tests.test_credential_run.InjectionTests.test_only_the_selected_entrys_own_pointer_variables_stay_in_the_child
  • tests.test_credential_run.InventoryAndGrammarTests.test_every_injected_name_is_masked_or_public

Both base assertions at tests/test_credential_run.py:498 and :2154
require the exact old INJECTABLE_IDS set. The head adds only
anthropic-api-3 and anthropic-api-4 to that expected set, with no removals.
These are the declared expectation changes; current-head credential tests
pass 94/94. The CC accepted pre-cue rc1 as the declared exact-set change
in coordination decision 2026-10-09, about 12:47Z, item 3. The execution result
remains rc1. The designated GPT and CC reads remain before CC landing.

Module Passed / discovered Skipped rc
tests.test_credential_tools 34/34 0 0
tests.test_credential_status 48/48 0 0
tests.test_credential_boot_receipt 21/21 0 0
tests.test_credential_run 94/94 0 0
tests.test_canary_proof 9/143 134 0
tests.test_secret_path_guard 88/90 2 0
tests.test_new_wsl_definitive_defaults 127/130 3 0
tests.test_codex_worker_lane 111/123 12 0
tests.test_host_requests 49/49 0 0
tests.test_evidence_manifest 5/5 0 0
tests.test_validate 68/68 0 0
tests.test_catalog_freshness_propose 86/86 0 0
nice -n 10 ionice -c2 -n7 timeout 600 python3 -m unittest tests.test_credential_tools
nice -n 10 ionice -c2 -n7 timeout 600 python3 -m unittest tests.test_credential_status
nice -n 10 ionice -c2 -n7 timeout 600 python3 -m unittest tests.test_credential_boot_receipt
nice -n 10 ionice -c2 -n7 timeout 600 python3 -m unittest tests.test_credential_run
nice -n 10 ionice -c2 -n7 timeout 600 python3 -m unittest tests.test_canary_proof
nice -n 10 ionice -c2 -n7 timeout 600 python3 -m unittest tests.test_secret_path_guard
nice -n 10 ionice -c2 -n7 timeout 600 python3 -m unittest tests.test_new_wsl_definitive_defaults
nice -n 10 ionice -c2 -n7 timeout 600 python3 -m unittest tests.test_codex_worker_lane
nice -n 10 ionice -c2 -n7 timeout 600 python3 -m unittest tests.test_host_requests
nice -n 10 ionice -c2 -n7 timeout 600 python3 -m unittest tests.test_evidence_manifest
nice -n 10 ionice -c2 -n7 timeout 600 python3 -m unittest tests.test_validate
nice -n 10 ionice -c2 -n7 timeout 600 python3 -m unittest tests.test_catalog_freshness_propose
nice -n 10 ionice -c2 -n7 python3 scripts/validate.py
# rc0: 70 components, 10940 hashed files, 4 profiles, 239 receipts
nice -n 10 ionice -c2 -n7 bash ~/.local/state/native-agent-stack/coordination/command-center/cc-tools/base_tests_at_head.sh ~/code/native-agent-stack 22e3ef6ffd53b09f3cb335c46f7c696093521274 ea4f1f6a65638d3ab588ee379f029f4518737890 unittest
# rc1: two declared exact-id expectation changes; accepted by the CC on 2026-10-09, about 12:47Z, item 3
git diff --cached --check
# rc0

Decision record

docs/decisions/2026-10-09-anthropic-api-additional-keys.md records the reference implementation, alternatives, evidence boundaries and conditions for reconsideration.

Host evidence

No evidence/hosts/ files or host-receipt platform status changes. Credential contents are entered by the owner through the CC's hidden prompt and stay outside the repository. Both new entries are optional. The CC's coordination decision on 2026-10-09, about 12:47Z, item 3 supersedes the dated decision record's earlier publication prerequisite: publication proceeds without waiting for anthropic-api-4, which may be stored before or after landing. Agents do not verify credential values.

  • python3 scripts/host_receipts.py validate passes for every new/changed receipt. N/A: no host receipt changed.
  • Independent review is recorded (scripts/host_receipts.py review) or explicitly requested in this PR. Designated co-op and CC reads requested for this draft.
  • No platform_status change is made from a host receipt alone.

Checklist

  • New/changed GitHub Actions are pinned to a full commit SHA with a version comment. N/A: no workflow changed.
  • New/changed workflows declare top-level permissions: {} and grant each job only what it needs. N/A: no workflow changed.
  • No secrets are printed, logged or committed; both new entries are optional and owner-operated.
  • No new paid hosting, subscription or billing surface was introduced; the existing Anthropic API credential class is reused.
  • Peer-owned untracked files and worktrees were preserved.

@seathatflowsinourveins seathatflowsinourveins added the lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers label Oct 9, 2026
@seathatflowsinourveins
seathatflowsinourveins force-pushed the codex/ns2604-anthropic-keys-20261009 branch from ea4f1f6 to 2d6c1cd Compare October 9, 2026 14:17
@seathatflowsinourveins
seathatflowsinourveins marked this pull request as ready for review October 9, 2026 14:31
@seathatflowsinourveins
seathatflowsinourveins merged commit 80cc49d into main Oct 9, 2026
36 checks passed
@seathatflowsinourveins
seathatflowsinourveins deleted the codex/ns2604-anthropic-keys-20261009 branch October 9, 2026 14:31
seathatflowsinourveins added a commit that referenced this pull request Oct 11, 2026
…mbers

CI (validate-shard-5, run 38164637938, at a2410e2) failed
tests.test_upstream_surface_watch
DispositionCitationTests.test_every_cited_line_names_the_key five times. The two
runbook lines this PR adds moved docs/secret-storage.md lines 1713, 1715 and
1726 to 1715, 1717 and 1728, and catalogs/foundation/upstream-surface-dispositions.json
cites those lines by number. The five sources are rebound, as #930 did for its
rows; the module passes again (114 tests, skipped 6).

The guard's pointer comment and pattern now fit the five lines they had at the
base, so every later line keeps its number and the unpinned citations of the
guard in docs/decisions/2026-10-08-guard-hook-fails-closed.md (lines 5184-5188
and 5208-5213) still hold. The pattern itself is unchanged. SHA256SUMS carries
the new guard hash, and the three changed files are re-registered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
seathatflowsinourveins added a commit that referenced this pull request Oct 11, 2026
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]>
seathatflowsinourveins added a commit that referenced this pull request Oct 11, 2026
…ard reads a one-letter pointer suffix (#1014)

* Credential inventory: alpaca-paper-c slot for paper account C; the guard reads a one-letter pointer suffix

Adds the account-C paper credential slot that the command center allocated on
2026-10-11 for the agent-run paper lane C of us-equities-trading
(session-scopes/paper-agent-native): inventory id alpaca-paper-c, lane
us-equities-paper-c, store <store>/alpaca-paper-c.env, pointer PAPER_ENV_FILE_C,
the variables, optional variables and public variables of alpaca-paper-2, status
optional, and no loader or consumer until the change that activates account C
names one. The owner enters the keys from their own terminal; no store file was
created or read.

Guard: POINTER_VARIABLE took a numeric suffix only, so the word boundary after
PAPER_ENV_FILE failed before `_C` (`_` is a word character: CPython
Doc/library/re.rst, the `\b` and `\w` entries, v3.13.16 at cbc944f4bc59), and a
reader, a redirect, a traced source and a declare -p or %ENV dump after sourcing
"$PAPER_ENV_FILE_C" each passed while the account-1 and account-2 forms were
blocked. The suffix may now also be one uppercase letter, which closes the
recorded `$PAPER_ENV_FILE_B` gap too; a longer suffix (`_AB`) stays a recorded
gap.

Failing first, with the base guard and set_credential.py and the new inventory
row and test rows: tests.test_secret_path_guard rc=1 with 41 failures
(test_inventory_pointer_variables_are_guarded for PAPER_ENV_FILE_C, the ten new
BLOCKED rows in test_blocked_commands, and their 20 rtk-proxy and 10
keyring-exec derivations; each new BLOCKED row returns None from the base
guard), and tests.test_credential_tools rc=1 with 1 failure
(test_account_c_paper_slot_gets_the_same_prefix_hint). Both pass with the change.

Also: KEY_PREFIX_HINT gains alpaca-paper-c: PK, so a live-shaped AK key id is
flagged at entry; the runbook gets the table row and the shell-profile pointer
line; INJECTABLE_IDS and the public-variable classification name the new id; a
status test mirrors account 1; the value-free receipt test plants the new store
file; SHA256SUMS carries the new guard hash; and the changed registered files are
re-registered in manifests/evidence.json.

After merge, a host reinstalls the guard with
tools/adoption/install_claude_profile.py --only guard
(tests.test_secret_path_guard.test_host_profile_copy_is_verbatim fails locally
until then and skips in CI).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Rebind the shifted secret-storage citations; keep the guard's line numbers

CI (validate-shard-5, run 38164637938, at a2410e2) failed
tests.test_upstream_surface_watch
DispositionCitationTests.test_every_cited_line_names_the_key five times. The two
runbook lines this PR adds moved docs/secret-storage.md lines 1713, 1715 and
1726 to 1715, 1717 and 1728, and catalogs/foundation/upstream-surface-dispositions.json
cites those lines by number. The five sources are rebound, as #930 did for its
rows; the module passes again (114 tests, skipped 6).

The guard's pointer comment and pattern now fit the five lines they had at the
base, so every later line keeps its number and the unpinned citations of the
guard in docs/decisions/2026-10-08-guard-hook-fails-closed.md (lines 5184-5188
and 5208-5213) still hold. The pattern itself is unchanged. SHA256SUMS carries
the new guard hash, and the three changed files are re-registered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
seathatflowsinourveins added a commit that referenced this pull request Oct 12, 2026
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]>
seathatflowsinourveins added a commit that referenced this pull request Oct 12, 2026
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]>
seathatflowsinourveins added a commit that referenced this pull request Oct 12, 2026
…ken health check (#969)

* Add Anthropic API key slots anthropic-api-5 to anthropic-api-10

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]>

* Cover anthropic-api-5 to anthropic-api-10 in the runner tests

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]>

* Add a no-token health check for the Anthropic key slots

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]>

* Record the Anthropic key slots and the 2026-10-10 key practice

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]>

* Apply the owner's revised fill-first order and anthropic-api-3's purpose

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]>

* Rewrap two key-practice paragraphs

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]>

* Cite the refreshed key-practice record

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]>

* Check the inventory first, and fail a probe that failed

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]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant