{"version":"2.1.323","anchor":"profilecredential-env-propagation-to-background-sessions","canonical_anchor":"profilecredential-env-propagation-to-background-sessions","heading":"Changes to which environment credentials sessions pick up","tier":"notice","area":"Sessions","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.323\/e\/profilecredential-env-propagation-to-background-sessions","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.323","markdown":"### Changes to which environment credentials sessions pick up\n\nBackground sessions bound to a profile drop inherited API keys and tokens, hosts can push a credential, and env credentials can be ignored in some cases\n\n**Unclear.** Which of these steps depend on the remotely managed switch and which always happen is not clear.\n\n**What**\n\nClaude Code can read credentials from environment variables, named values given to a program when it starts, such as `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN` and `CLAUDE_CODE_OAUTH_TOKEN`. Several places now control more tightly when those are used.\n\n- Background sessions: starting a background session, one that keeps running without a terminal attached, now carries a binding to an auth profile (a named sign-in, see `ANTHROPIC_PROFILE`). Listed credential variables are removed from the new session's environment. With a `profile:` binding, `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN` and `CLAUDE_CODE_OAUTH_TOKEN` are deleted, and `ANTHROPIC_CONFIG_DIR` and `ANTHROPIC_PROFILE` are kept only when they match the binding. This sits behind a remote switch, `tengu_steady_anchor`, which counts as on when it has no value; nothing has been read about that switch. References to `ANTHROPIC_PROFILE` and `ANTHROPIC_CONFIG_DIR` grew sharply in this build.\n\n- Host credential push: a program that embeds Claude Code can now hand a running session a sign-in credential through `update_environment_variables`. A blank value or one that is not allowed is rejected, and the session refreshes before applying it. Before, only an allowed list of variables and the host's choice were accepted. When a credential is supplied, the path that claims a spare session also clears a set of environment variables.\n\n- Ignored env credentials: the code that finds the API key, the auth token and the credential source now returns nothing, or \"none\", when a new check is true. What that check looks at was not traced.\n\n**Why**\n\nIf you use named profiles, background sessions should sign in with the profile they were bound to rather than a key or token left in your environment. In practice, a credential set in your environment may no longer be the one a session uses in these cases.\n\n- Flag `tengu_steady_anchor`: Not enough to say (read for one account on one subscription tier against v2.1.323; this account: no value returned, anonymous baseline: no value returned, compiled default: on) These values were read against a different version of Claude Code, so treat them as the nearest reading available instead of one taken on this release.\n- Area: Sessions\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: yes"}