squad-kit 0.11.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,144 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.12.1] — 2026-08-24
11
+
12
+ ### Bug fixes
13
+
14
+ - `squad auth login` ended a **successful** browser login with
15
+ `could not verify the login (unknown)` and a warning that the credential "may
16
+ be invalid or expired". The token was fine. `accountInfo()` resolves from the
17
+ Agent SDK's `initialize` response, and for `CLAUDE_CODE_OAUTH_TOKEN` auth that
18
+ response carries `{tokenSource, apiProvider}` and **never** an account — for a
19
+ valid token exactly as much as for a bogus one. 0.12.0 treated a missing
20
+ account as a failed credential, which flagged every healthy login through the
21
+ primary documented flow.
22
+
23
+ The probe now separates three outcomes instead of two: an account came back
24
+ (verified, shown); a credential *source* came back without an account
25
+ (reported as resolved, with the honest caveat that token validity can only be
26
+ confirmed by an actual planning run); or nothing came back at all (still
27
+ treated as unverified). `squad auth login`'s summary and `squad doctor`'s
28
+ planner credential row both reflect which applies, and neither claims a
29
+ verification the SDK cannot perform.
30
+
31
+ Workspaces that authenticate through the OS credential store are unaffected —
32
+ those do report an account and are still verified as before.
33
+
34
+ ## [0.12.0] — 2026-08-24
35
+
36
+ ### What's new
37
+
38
+ - **Plan on your Claude subscription.** The Anthropic planner can authenticate
39
+ with the Claude login you already have (Pro, Max, or Team/Enterprise) instead
40
+ of an API key. `squad new-plan --api` and the console Generate page both run
41
+ on it. No per-token API bill. OpenAI and Google are unchanged and remain
42
+ API-key only.
43
+ - **`squad auth login | status | logout`.** `login` runs the Anthropic browser
44
+ authorization flow and stores the resulting token in `.squad/secrets.yaml`;
45
+ `--token <value>` consumes a `claude setup-token` value on a headless machine,
46
+ and `--print-only` runs the flow, prints the token, and stores nothing.
47
+ `status` reports the resolved mode, the credential behind it, and the
48
+ signed-in account (`--json` for a stable scripting shape, `--offline` to skip
49
+ the live check). `logout` removes only the token squad-kit stored.
50
+ - **`planner.auth.anthropic`** in `.squad/config.yaml` — `subscription`,
51
+ `api-key`, or `auto`. The merged default is **`auto`**: prefer a detected
52
+ Claude login, fall back to a resolvable API key, otherwise fail naming both
53
+ recovery paths. `squad init` offers the subscription as the first and default
54
+ choice for new workspaces and writes it explicitly.
55
+ - **`planner.anthropicOauthToken`** is a new secrets-only key. `.squad/config.yaml`
56
+ rejects it by name at load time.
57
+ - **Subscription runs withhold the API key.** In subscription mode
58
+ `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` are removed (case-insensitively)
59
+ from the planner subprocess environment. Both outrank the login credential
60
+ inside Claude Code, so an inherited one would silently bill API credits. The
61
+ parent shell is untouched.
62
+ - **No new runtime dependency.** `squad auth login` shells out to the `claude`
63
+ binary that `@anthropic-ai/claude-agent-sdk` already ships through
64
+ `optionalDependencies`. A separate Claude Code install is never required.
65
+ - **Auth-aware `squad doctor`.** New `planner auth mode` (resolved mode, why,
66
+ and the credential — naming any API key it is ignoring) and
67
+ `planner auth vs. runtime` (subscription auth requires the Agent SDK runtime)
68
+ checks. `planner model resolves at provider` and `planner tier vs. model` now
69
+ **skip** on subscription auth: there is no API key to list models with and no
70
+ API rate tier to warn about.
71
+ - **Console auth surface.** An Authentication control on Config (with a
72
+ hard-conflict callout that disables Save), a Claude Account card on Secrets
73
+ with a live "Check again" probe and a masked stored token, an auth badge and
74
+ branched billing copy on Generate, a dedicated recovery callout for
75
+ `auth_unavailable` failures, and an Auth column on the runs index. The console
76
+ guides the login and never performs it — it cannot complete an OAuth callback
77
+ on your behalf.
78
+ - **Run records carry `authMode`**, and the planner stream gained one additive
79
+ `auth_info` event. Older clients ignore unknown event kinds.
80
+ - **Cost copy branches on auth mode.** `printPlannerApiCostNotice()` and the
81
+ limit explanations no longer describe per-token billing on a subscription run.
82
+
83
+ ### Bug fixes
84
+
85
+ - Planner model-list probe (`src/core/probes.ts`): a network-level `fetch`
86
+ rejection (offline, DNS failure, proxy refusal) or a non-JSON response body
87
+ threw out of `fetchProviderModelIds` instead of returning a failure result, so
88
+ `squad doctor`'s `planner model resolves at provider` check surfaced an
89
+ unexpected error rather than a clean diagnosis. Both are now caught and
90
+ reported as `status: 0` with the message, and long error bodies are truncated.
91
+ Shipped to GitHub after v0.11.0 (`d2d67a1`) and missed the 0.11.0 changelog.
92
+
93
+ ### Upgrade notes
94
+
95
+ Zero-config. A `config.yaml` with no `planner.auth` block merges to `auto` and
96
+ keeps loading; every existing `planner.*` key, including `maxOutputTokens`, is
97
+ unaffected. An untouched 0.11.0 API-key workspace resolves to `api-key` and
98
+ behaves identically — **provided the machine has no Claude login**.
99
+
100
+ Under `auto`, a detected Claude login **outranks** a stored API key. So on a
101
+ machine that has both, an upgraded workspace switches to subscription billing.
102
+ Nothing errors, and the change is announced rather than silent: `squad doctor`'s
103
+ `planner auth mode` row reads `subscription (auto — Claude login detected) → …
104
+ · ignoring the API key from .squad/secrets.yaml`. Set
105
+ `planner.auth.anthropic: api-key` to pin the previous behaviour.
106
+
107
+ `squad doctor --fix` deliberately does **not** pin an implicit `auto` to
108
+ `api-key`. `auto` exists so that a Claude login takes over once one appears;
109
+ pinning would silently prevent that forever.
110
+
111
+ ### Notes / limitations
112
+
113
+ - **Usage draws on your Claude plan's limits.** Per Anthropic's
114
+ [Use the Claude Agent SDK with your Claude plan](https://support.claude.com/en/articles/15036540-use-the-claude-agent-sdk-with-your-claude-plan),
115
+ Agent SDK, `claude -p`, and third-party usage consumes the subscription's
116
+ usage limits, and the separately announced monthly SDK credit is not currently
117
+ available. The claim this release makes is **"no per-token API bill"** — not
118
+ free, and not unlimited. Opus planning against a **Pro** plan consumes a usage
119
+ window noticeably faster than against **Max**. Hitting the ceiling means
120
+ waiting for the reset window or switching to an API key.
121
+ - **Enterprise managed-settings `apiKeyHelper` still wins.** squad-kit runs the
122
+ Agent SDK with `settingSources: []`, so user, project, and local settings are
123
+ not read and an ordinary user-level `apiKeyHelper` cannot hijack a
124
+ subscription run. **Policy settings are always merged regardless**, so a
125
+ managed-settings `apiKeyHelper` deployed by MDM is still honoured and still
126
+ outranks the login credential — on a managed device, `auth: subscription` may
127
+ resolve through the organization's helper. This was established by reading the
128
+ credential resolver in the bundled `claude` binary, **not** on a live managed
129
+ device. `squad auth status` reports the `apiKeySource` the SDK actually
130
+ resolved.
131
+ - **`auth: subscription` requires the Agent SDK runtime.** `@ai-sdk/anthropic`
132
+ authenticates with `x-api-key`, and an OAuth credential is not an API key.
133
+ `auth: subscription` with `planner.runtime.anthropic: vercel`, or with a
134
+ non-Anthropic provider, is a hard failure before any network call — never a
135
+ silent downgrade to API billing.
136
+ - **Account details are never persisted.** Email, organization, and plan are
137
+ fetched live for display in `squad auth status`, `squad doctor`, and the
138
+ console. `.squad/runs/` records the resolved **mode** and `apiKeySource` only —
139
+ no token, key, email, or organization. Asserted by a test.
140
+ - **A successful SDK handshake does not prove the credential works.**
141
+ `accountInfo()` resolves from the subprocess's `initialize` response, which
142
+ succeeds whether or not the credential is valid. Subscription auth that
143
+ reports no account **and** no `apiKeySource` is therefore treated as
144
+ unverified rather than signed in.
145
+ - `docs/auth.md` is not shipped inside the npm tarball. It is served at
146
+ <https://squad-kit.com/docs/auth> and lives in the repo under `docs/`.
147
+
10
148
  ## [0.11.0] — 2026-05-04
11
149
 
12
150
  ### What's new
package/README.md CHANGED
@@ -23,6 +23,36 @@
23
23
  └── plans/<feature>/ # NN-story-<id>.md (one per executable plan)
24
24
  ```
25
25
 
26
+ ## What's new in 0.12.0
27
+
28
+ - **Plan on your Claude subscription.** `squad auth login` signs in with your Anthropic account and `squad new-plan --api` runs on your Claude plan — no API key, no per-token API bill. Usage draws on the same limits as Claude and Claude Code. Full guide: [`docs/auth.md`](docs/auth.md) · [on the site](https://squad-kit.com/docs/auth).
29
+ - **`planner.auth.anthropic`** — `subscription` | `api-key` | `auto` (default `auto`). Existing API-key workspaces keep working; `squad doctor` gained `planner auth mode` and `planner auth vs. runtime` so the resolved mode is never a mystery.
30
+ - **Console auth surface** — an Authentication control on Config, a Claude Account card on Secrets, an auth badge on Generate and on every run record.
31
+
32
+ ## What's new in 0.11.0
33
+
34
+ - **Persisted run history** — `--api` runs append to `.squad/runs/<id>.events.jsonl` (thinking text redacted on disk, old files rotated), and the console gained a runs index plus a full run report page.
35
+ - **Richer live telemetry** — tool lifecycle, thinking deltas, and runtime metadata stream to both the CLI and the console; the CLI prints a stage pipeline and budget meters.
36
+
37
+ ## What's new in 0.10.0
38
+
39
+ - **Anthropic planning moved to the Claude Agent SDK** by default so Opus 4.7 can use adaptive thinking and effort. OpenAI and Google stay on the Vercel AI SDK.
40
+ - **Thinking, effort, and runtime are configurable** — `planner.runtime.anthropic`, `planner.providerOptions.anthropic`, and the `--anthropic-runtime` / `--effort` / `--scout-effort` / `--no-thinking` flags.
41
+ - **`squad doctor` checks runtime wiring**, model-vs-runtime fit, and the Agent SDK binary.
42
+
43
+ ## What's new in 0.9.0
44
+
45
+ - **Scout stage** — a cheap-tier model picks the files worth preloading before your plan model drafts, cutting the expensive model's read loop.
46
+ - **LLM-free validation pass** flags missing paths, line ranges past EOF, and simple symbol problems; `--strict-validation` writes `*.partial.md` when it finds something.
47
+
48
+ ## What's new in 0.8.0
49
+
50
+ - **Rate-limit handling you can watch** — the Generate page shows a countdown, auto-retry banner, and rerun control; the planner emits `rate_limit` events distinguishing "retrying" from "aborted".
51
+
52
+ ## What's new in 0.7.0
53
+
54
+ - **GitHub Issues as a tracker** — owner/repo in config, PAT (or `GITHUB_TOKEN`) in secrets, search and import like Jira or Azure. **Linear was removed** as a tracker type in the same release.
55
+
26
56
  ## What's new in 0.6.0
27
57
 
28
58
  - **Console redesign** — Geist-style flat dark UI, Cmd+K command palette, global keyboard shortcuts, portal dialogs, density toggle. Same CLI and `.squad/` on disk; no migration. See [`docs/console.md`](docs/console.md).
@@ -66,7 +96,7 @@ Full list in [`CHANGELOG.md`](CHANGELOG.md).
66
96
  Existing squad-kit users should run two commands, once per repo:
67
97
 
68
98
  ```bash
69
- pnpm add -g squad-kit@0.2.0 # or: npm install -g squad-kit@0.2.0 — or: squad upgrade
99
+ pnpm add -g squad-kit # or: npm install -g squad-kit — or: squad upgrade
70
100
  cd your-project && squad migrate
71
101
  ```
72
102
 
@@ -77,9 +107,9 @@ Full upgrade walkthrough, including what-if scenarios and how to recover customi
77
107
  ## Install
78
108
 
79
109
  ```bash
80
- npm install -g squad-kit@0.2.0
110
+ npm install -g squad-kit
81
111
  # or
82
- pnpm add -g squad-kit@0.2.0
112
+ pnpm add -g squad-kit
83
113
  ```
84
114
 
85
115
  Requires Node 18+.
@@ -104,6 +134,20 @@ No slash commands in your agent? Skip the meta-prompt copy-paste entirely:
104
134
  squad new-plan --api # interactive picker, direct provider call, writes the plan file
105
135
  ```
106
136
 
137
+ ### Plan on your Claude subscription
138
+
139
+ If you already pay for **Claude Pro or Max**, you do not need an Anthropic API key to use the direct planner:
140
+
141
+ ```bash
142
+ squad init # choose Anthropic, then "Use my Claude subscription (browser login)"
143
+ squad auth login # browser sign-in; or just run `claude` and use /login
144
+ squad new-plan --api # plans on your Claude plan
145
+ ```
146
+
147
+ **No API key is needed** on this path. Planning usage draws on your **Claude plan's usage limits** — the same limits Claude and Claude Code consume — so there is no per-token API bill, but a long planning run does consume part of your window. Opus planning against a **Pro** plan drains that window noticeably faster than against **Max**.
148
+
149
+ Already signed in to Claude Code? squad-kit picks that login up automatically. Prefer an API key? Nothing changed — set `planner.auth.anthropic: api-key`. Details, CI setup, precedence, and troubleshooting: [`docs/auth.md`](docs/auth.md) · [on the site](https://squad-kit.com/docs/auth).
150
+
107
151
  Configuration, credential edits, and non-interactive flags: see [`docs/customization.md`](docs/customization.md) and `squad config show`. Full walkthrough: [`docs/getting-started.md`](docs/getting-started.md).
108
152
 
109
153
  ## Commands
@@ -116,6 +160,7 @@ Configuration, credential edits, and non-interactive flags: see [`docs/customiza
116
160
  | `squad status` | Counts, next `NN`, planner and tracker rows (including credential source). |
117
161
  | `squad list [--feature <slug>]` | Table of stories and plan state. |
118
162
  | `squad tracker link [story] [id]` | Attach or update a tracker id on an intake. |
163
+ | `squad auth <login\|status\|logout>` | Sign in to Anthropic with your Claude subscription, inspect the resolved auth, or clear the stored token. `login` takes `--token <v>` (CI) and `--print-only`; `status` takes `--json` and `--offline`. See [`docs/auth.md`](docs/auth.md) · [site](https://squad-kit.com/docs/auth). |
119
164
  | `squad config <show\|set\|unset\|remove-credential> …` | View and edit `.squad/config.yaml` and `.squad/secrets.yaml` interactively. See [`docs/customization.md`](docs/customization.md). |
120
165
  | `squad rm <story\|plan\|feature> [target] [--dry-run] [--trash] [-y]` | Safely delete with cascading overview updates. |
121
166
  | `squad doctor [--fix] [--json]` | Full health check; `--fix` applies non-destructive repairs. |
@@ -129,26 +174,44 @@ Deeper option lists: `squad <command> --help` and the `docs/` pages above.
129
174
 
130
175
  Off by default. Enable during `squad init` (answer **yes** to *Enable automatic plan generation?*) or later with `squad config set planner`. Supported providers: Anthropic, OpenAI, Google.
131
176
 
132
- Credential resolution order:
177
+ ### Credential resolution order
178
+
179
+ **Anthropic — default: your Claude subscription**
133
180
 
134
- 1. Provider env var (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GOOGLE_API_KEY`).
135
- 2. `.squad/secrets.yaml` under `planner.<provider>.apiKey` (or cross-provider `SQUAD_PLANNER_API_KEY`).
181
+ 1. **`planner.auth.anthropic`** in `.squad/config.yaml` — `subscription` | `api-key` | `auto` (merged default: **`auto`**).
182
+ 2. **`subscription`** — the login created by `squad auth login` (or `claude` → `/login`), resolved in this order:
183
+ `CLAUDE_CODE_OAUTH_TOKEN` → `planner.anthropicOauthToken` in `.squad/secrets.yaml` → the OS credential store (macOS Keychain / `~/.claude/.credentials.json`).
184
+ 3. **`api-key`** — `ANTHROPIC_API_KEY` → `SQUAD_PLANNER_API_KEY` → `.squad/secrets.yaml`.
185
+ 4. **`auto`** — a detected Claude login first, otherwise the API key chain, otherwise fail naming both recovery paths.
186
+
187
+ In subscription mode squad-kit **clears `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` from the planner subprocess** (your shell is untouched): both outrank the login credential inside Claude Code, so an inherited one would silently bill API credits instead. If you have a key exported and it is being ignored, that is why.
188
+
189
+ `auth: subscription` requires the Agent SDK runtime — `planner.runtime.anthropic: vercel` is a hard, early failure, never a silent downgrade.
190
+
191
+ **OpenAI / Google — API key only, unchanged**
192
+
193
+ 1. Provider env var (`OPENAI_API_KEY`, `GOOGLE_API_KEY`).
194
+ 2. `.squad/secrets.yaml` under `planner.<provider>` (or cross-provider `SQUAD_PLANNER_API_KEY`).
136
195
  3. Interactive prompt (TTY only).
137
196
  4. Fail with a recovery hint.
138
197
 
198
+ The deep page — both login paths, per-platform credential storage, CI, usage limits, and a troubleshooting table — is [`docs/auth.md`](docs/auth.md), also served at [squad-kit.com/docs/auth](https://squad-kit.com/docs/auth).
199
+
139
200
  Override the default plan-phase model without editing squad-kit:
140
201
 
141
202
  ```yaml
142
203
  planner:
143
204
  enabled: true
144
205
  provider: anthropic
206
+ auth:
207
+ anthropic: subscription # or api-key, or auto (default)
145
208
  cache:
146
209
  enabled: true # default; turn off via squad config set planner
147
210
  modelOverride:
148
211
  anthropic: claude-opus-5-0 # riding a newer provider release early
149
212
  ```
150
213
 
151
- `squad status` marks the planner row `(override)` when a `modelOverride` is active. `squad doctor` probes the provider's `/v1/models` endpoint (no paid completion) and tells you what to do if the id is no longer served.
214
+ `squad status` marks the planner row `(override)` when a `modelOverride` is active, and shows a **planner auth** row with the resolved mode. `squad doctor` probes the provider's `/v1/models` endpoint (no paid completion) and tells you what to do if the id is no longer served — that probe and the API rate-tier check both **skip on subscription auth**, since there is no API key to list models with and no API rate tier to warn about.
152
215
 
153
216
  Slash commands inside your agent (`/squad-plan`) continue to work unchanged — the agent already has your repo in scope. The direct planner is an alternative path, not a replacement. For where keys live, see [Secrets](#secrets) below and [`docs/customization.md`](docs/customization.md).
154
217
 
@@ -174,9 +237,11 @@ squad-kit stores settings in two files:
174
237
  | File | Purpose | Git-tracked? | Editable by hand? |
175
238
  | --- | --- | --- | --- |
176
239
  | `.squad/config.yaml` | Project name, tracker, naming, agents, planner shape. | yes — commit it | yes, but `squad config set` is safer |
177
- | `.squad/secrets.yaml` | Planner + tracker API tokens. | **no** — auto-ignored, `0600` on POSIX | no — use `squad config set` / `squad init` |
240
+ | `.squad/secrets.yaml` | Planner + tracker API tokens, and the Claude OAuth token (`planner.anthropicOauthToken`). | **no** — auto-ignored, `0600` on POSIX | no — use `squad auth login` / `squad config set` / `squad init` |
241
+
242
+ `config.yaml` rejects credential-shaped key names at load time — `apiKey`, `api_key`, `token`, `oauthToken`, `anthropicOauthToken`, `secret`, `credential`, `credentials` — so accidental commits fail loud. Matching is on the **exact lowercased key name**, not a substring: a substring rule would reject the legitimate `planner.maxOutputTokens`. Any future credential-shaped key has to be added to that list by name.
178
243
 
179
- `config.yaml` rejects any key matching `apiKey`, `token`, `secret`, or `credential` at load time, so accidental commits fail loud. Rotate a credential with `squad config set planner` or `squad config set tracker`; remove one with `squad config remove-credential <section>`.
244
+ Rotate a credential with `squad config set planner` or `squad config set tracker`; remove one with `squad config remove-credential <section>`. `squad auth logout` removes only the Claude OAuth token squad-kit stored and never touches your global Claude Code login.
180
245
 
181
246
  ## Why not Spec-Kit?
182
247
 
@@ -184,7 +249,7 @@ Both aim at spec-driven development. They make different bets.
184
249
 
185
250
  | | squad-kit | Spec-Kit |
186
251
  | --- | --- | --- |
187
- | Commands | `init`, `new-story`, `new-plan`, `status`, `doctor`, `migrate`, `upgrade`, `list`, `rm`, `tracker link`, `config` | `constitution`, `specify`, `clarify`, `plan`, `tasks`, `analyze`, `checklist`, `implement` |
252
+ | Commands | `init`, `new-story`, `new-plan`, `status`, `doctor`, `migrate`, `upgrade`, `list`, `rm`, `tracker link`, `auth`, `config` | `constitution`, `specify`, `clarify`, `plan`, `tasks`, `analyze`, `checklist`, `implement` |
188
253
  | `/implement` turn starts with | one plan file (~5–15 KB) | 5–7 command templates + cross-artifact reads (~15–25 KB) |
189
254
  | Model-tier awareness | Built into the philosophy (planner ≠ executor) | Not prescribed |
190
255
  | Generated artifacts per story | `intake.md`, `NN-story-<id>.md`, overview row | `spec.md`, `plan.md`, `data-model.md`, `contracts/`, `research.md`, `quickstart.md`, `tasks.md` |
@@ -202,6 +267,7 @@ See [`docs/philosophy.md`](docs/philosophy.md) for the token math and [`docs/vs-
202
267
  - **Plans are project-coupled.** They reference real file paths. That is the point — do not expect portability between projects.
203
268
  - **Global `NN` can collide on parallel branches.** Rebase-and-renumber is the resolution. Documented in [`docs/customization.md`](docs/customization.md).
204
269
  - **Anthropic Tier 1 + Opus** shares a tight input-token-per-minute bucket. **0.3.0** added prompt caching (on by default) so typical multi-turn plans stay viable; see [Prompt caching](docs/customization.md#prompt-caching) in the customization docs.
270
+ - **Subscription planning is not free planning.** It removes the per-token API bill, not the cost: Agent SDK usage draws on your Claude plan's usage limits. Opus planning on **Pro** will exhaust a window much faster than on **Max**. See [`docs/auth.md`](docs/auth.md).
205
271
 
206
272
  ## Non-goals for 0.2
207
273
 
package/SECURITY.md CHANGED
@@ -37,12 +37,26 @@ squad-kit reads API tokens from (in order):
37
37
  2. **`.squad/secrets.yaml`** — created with mode `0600` on POSIX; always included in `.gitignore` by `squad init`.
38
38
  3. **Interactive prompt** — when the terminal is a TTY and the command needs a credential that is missing.
39
39
 
40
+ ### Anthropic subscription credentials (0.12.0+)
41
+
42
+ The Anthropic planner can authenticate with a Claude subscription instead of an API key. That path resolves, in order: **`CLAUDE_CODE_OAUTH_TOKEN`** → **`planner.anthropicOauthToken` in `.squad/secrets.yaml`** → the **OS credential store** managed by Claude Code.
43
+
44
+ - The OAuth token is a credential and is treated as one: it lives in `.squad/secrets.yaml` only (git-ignored, `0600` on POSIX), is masked everywhere it is displayed, and is rejected by name if it appears in `.squad/config.yaml`.
45
+ - squad-kit **never reads** the OS credential store. It checks only whether an entry **exists** (on macOS via `security find-generic-password -s "Claude Code-credentials"`, never `-w` / `-g`) and leaves the reading to the Claude Agent SDK.
46
+ - In subscription mode, `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` are **removed from the planner subprocess environment** (case-insensitively). Both outrank the subscription credential inside Claude Code, so an inherited one would silently redirect usage to API billing. The parent shell is not modified.
47
+ - `squad auth logout` removes **only** the token squad-kit stored. It never deletes the user's global Claude Code credential.
48
+ - Persisted run records (`.squad/runs/*.json`, `*.events.jsonl`) carry the resolved auth **mode** and `apiKeySource` only — never a token, key, email, or organization. Account details are fetched live for display and never written to disk.
49
+
40
50
  ### Non-goals
41
51
 
42
- - `.squad/config.yaml` must never contain secrets. Loading it with a key matching `apiKey`, `api_key`, `token`, `secret`, `credential`, or `credentials` raises a loud error.
43
- - squad-kit does not integrate with OS keychains in 0.2.0. The secrets file model is intentional: it is inspectable, excluded by ignore rules, and portable.
52
+ - `.squad/config.yaml` must never contain secrets. Loading it with a key whose lowercased name is exactly `apikey`, `api_key`, `token`, `oauthtoken`, `anthropicoauthtoken`, `secret`, `credential`, or `credentials` raises a loud error. Matching is exact rather than substring so that legitimate keys such as `planner.maxOutputTokens` keep loading; new credential-shaped keys must be added to that list by name.
53
+ - squad-kit does not **store** credentials in an OS keychain. It will detect and use a Claude Code login held in one (see above), but its own secrets model remains the `.squad/secrets.yaml` file: inspectable, excluded by ignore rules, and portable.
44
54
  - Credentials are never logged. Tracker error messages redact tokens; planner provider errors do the same.
45
55
 
56
+ ### Known limitation — enterprise managed settings
57
+
58
+ squad-kit runs the Agent SDK with `settingSources: []`, which prevents it from reading user, project, and local settings files. An ordinary user-level `apiKeyHelper` therefore cannot redirect a subscription run. **Policy settings are always merged regardless**, so an enterprise **managed-settings** `apiKeyHelper` deployed by MDM is still honoured and still outranks the login credential. On a managed device, `planner.auth.anthropic: subscription` may resolve through the organization's helper. This was established by reading the credential resolver in the bundled `claude` binary, not by testing on a live managed device. `squad auth status` reports the `apiKeySource` the SDK actually resolved.
59
+
46
60
  ## Scope
47
61
 
48
62
  squad-kit is a local-only CLI. It can call **optional** network APIs (tracker fetch, direct planner) when the user enables those flows and provides credentials. It does not execute user code. Reports in scope include: