Skip to content

Claude "Avoid Keychain prompts" can trigger Keychain prompts #1877

Description

@gmkbenjamin

Problem

In CodexBar 0.38.0 (94), enabling the Claude provider setting Avoid Keychain prompts can cause repeated macOS Keychain prompts for the Claude credential. Turning the setting off stops the prompts.

That is inverted from the expected behavior and makes the Claude provider noisy for users who explicitly chose the no-prompt path.

Repro

  1. Use CodexBar 0.38.0 (94) with the Claude provider configured via Claude OAuth.
  2. Open Claude provider settings.
  3. Enable Avoid Keychain prompts.
  4. Let a background refresh run, or refresh Claude usage manually.
  5. Observe a macOS Keychain prompt for the Claude credential.
  6. Disable Avoid Keychain prompts.
  7. Observe that the prompts stop.

Expected behavior

When Avoid Keychain prompts is enabled, Claude OAuth credential reads should use the non-interactive Keychain policy and fail closed when macOS would require user interaction. The setting should not switch to a read path that can show prompts.

Actual behavior

The setting appears to select the experimental /usr/bin/security CLI reader. That reader shells out to security find-generic-password -w, which can still display macOS Keychain prompts. With the setting disabled, the Security.framework path is used instead, where CodexBar can apply its no-UI policy.

Suggested fix

  • Treat stored securityCLIExperimental preferences as legacy and migrate them back to securityFramework.
  • Make Avoid Keychain prompts set the Claude OAuth prompt policy to never rather than selecting the experimental CLI reader.
  • Keep the Claude Keychain prompt policy control visible as the source of truth.
  • Update the setting copy so it describes prompt prevention, not the CLI read strategy.
  • Cover the migration, toggle mapping, and provider descriptor behavior with focused tests that do not touch the real Keychain.

Labeling

Suggested labels from docs/ISSUE_LABELING.md:

  • bug
  • priority:high
  • area:auth-keychain
  • provider:claude

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions