Skip to content

[DOCS] Document the ~/.infer/auth.json provider key fallback and precedence order #642

Closed

Description

@inference-gateway-maintainer

Summary

PR inference-gateway/cli#1169 (resolves inference-gateway/cli#1167) adds a userspace fallback for provider API keys: ~/.infer/auth.json, a flat JSON map of provider key env vars (for example ANTHROPIC_API_KEY, OPENAI_API_KEY). Keys resolve per key with first hit winning: system environment, project .env, then ~/.infer/auth.json. The fallback applies to the gateway (container and binary modes) and to A2A agent containers. A missing or unreadable file degrades silently; a malformed file is ignored with a logged warning; permissions broader than 0600 warn.

The CLI repo's own README.md and docs/configuration-reference.md were updated in the PR. This ticket asks for the same coverage in the docs site.

Acceptance Criteria

  • The docs site pages that cover provider keys / .env setup mention ~/.infer/auth.json and the precedence order (system environment > project .env > ~/.infer/auth.json, first hit wins).
  • The recommended file permissions (chmod 600) and the fact that the file is on the sandbox protected paths list (agent tools cannot read or edit it) are mentioned.
  • The graceful-degradation behavior is stated: a missing or unreadable file changes nothing; a malformed file is ignored with a logged warning.
  • Links back to the CLI PR feat(auth): add ~/.infer/auth.json as userspace provider key fallback cli#1169.

Activity

  1. added
    documentation
    on Sep 3, 2026
  2. edenreich commented on Sep 3, 2026

    @edenreich
    Contributor

    @claude Can you document this? use /ponytail:ponytail

  3. added theissue type on Sep 3, 2026
  4. inference-gateway-maintainer commented on Sep 3, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Claude finished @edenreich's task in 2m 7s —— View job • docs/issue-642-20260903-1314 • Create PR ➔


    Documented ~/.infer/auth.json

    cli.md - new ### Provider API keys section under Configuration:

    • Precedence table: system environment > project .env > ~/.infer/auth.json, resolved per key, first hit wins (so sources can mix in one run).
    • Flat JSON map example, gateway container + binary modes, and A2A agent containers.
    • chmod 600 recommended (broader permissions warn), file is on the protected paths list so agent tools cannot read or edit it.
    • Graceful degradation: missing/unreadable = no change; malformed = ignored with a logged warning.
    • Links to inference-gateway/cli#1169.

    Also added an auth.json row to the config-files table, a ~/.infer/auth.json bullet under Protected Paths, and a cross-reference from the .env section of configuration.md.

    Not done: nothing from the acceptance criteria. No generated sections were touched, so no task generate run was needed.

    | Branch

  5. moved this from Todo to In progress in 2026on Sep 3, 2026
  6. moved this from In progress to QA in 2026on Sep 3, 2026
  7. moved this from QA to Done in 2026on Sep 3, 2026
  8. inference-gateway-releaser commented on Sep 22, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.14 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationreleased

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions