Skip to main content
Version: Next · development

Coding-agent accounts

This page shows you how to connect a coding-agent account (Codex, Claude Code or OpenCode) to Golf, and how administrators share named instance accounts with selected users. Start here before you set usage and model policy.

Account typeWhere to manage it
PersonalAccount settings → Coding agents (/account/agents)
Instance (administrators)Admin portal → Coding agents (/admin/agents)

Account configuration, provider entitlement, repository permission and task execution are separate. Connecting an account does not let an agent run tasks.

Managed coding tasks are not implemented yet

Golf stores and checks agent accounts but does not yet run managed coding tasks with them. See Where agents run. On a Cloudflare-native installation, an agent you run yourself can reach Golf through the remote MCP endpoint with a scoped API token; see Connect a coding agent. For where agent work is heading, see Agentic mode.

Supported harnesses​

HarnessPackaged CLICurrent connection methods
Codex0.160.0Native ChatGPT device login or OpenAI API key
Claude Code2.1.288Native Claude subscription browser/code login or Anthropic API key
OpenCode1.18.34OpenCode Zen, Go, Anthropic or OpenAI API key; distinct connection per provider

OpenCode provider OAuth, Claude Console/cloud/gateway authentication, other providers, Grok and Pi remain unqualified. Golf does not import host account directories or Keychain credentials. API-key configuration does not verify successful inference or subscription validity.

Connect Claude Code​

To sign in with a Claude account:

  1. Choose Connect Claude Code, select Claude account and continue.
  2. Open the native CLI's official authorization link shown in the details dialog and sign in with Claude.
  3. Paste the returned authorization code into Golf and choose Complete sign-in.

Golf waits for native completion and reads native account status; submitting a code alone cannot mark a connection authenticated. The code clears after submission and never appears in inventory, receipts, URLs or browser storage. Cancel login stops the exact current login. The approval deadline is Golf's bounded login deadline, not provider token expiry.

To use an API key instead, select Provider API key and supply an Anthropic key.

Native claude auth status supplies reported email/plan when present. Golf does not invent Claude usage percentages, expiry or reset counters.

Connect OpenCode​

  1. Select OpenCode Zen, OpenCode Go, Anthropic or OpenAI in the provider selector.
  2. Choose Connect OpenCode and supply that provider's API key.

Each selection has its own immutable connection and encrypted cache. Golf uses native opencode auth list to check the configured credential store. OpenCode does not report an account email, subscription plan or model validity through this flow; absent information stays unreported.

The pinned opencode auth login --provider opencode command also prompts for an API key. Go is a separate opencode-go provider: sign into its console, subscribe and obtain its key. These provider flows do not implement browser OAuth. See OpenCode Go.

Connect Codex​

  1. Choose Connect Codex, select ChatGPT account or OpenAI API key, and continue.
  2. For a ChatGPT account, native device login displays the official ChatGPT approval link and temporary code. Approve in your browser while Golf polls.

Cancellation binds the current login ID/version. An API-key input clears after submission. No terminal login or host account import is required.

Check Codex plan and usage​

Connected Codex details offer Refresh plan and usage. Golf shows actual reported windows, remaining/used percentages, reset time/countdown and optional earned banked resets.

  • Unknown fields stay unreported and a known zero stays zero.
  • Reading does not redeem a reset or run inference.
  • API-key connections do not expose ChatGPT plan quotas.
  • A quota endpoint failure does not itself disconnect the account.

Manage connections​

Icon actions have accessible names and hover titles. Connection details opens account metadata in a bounded dialog; settings changes use explicit editors.

  • Rename: owners can rename personal connections without changing identity/login.
  • Reconnect: replaces Golf-owned authentication.
  • Disconnect: after confirmation, removes Golf's cached credentials without revoking the provider account or key.
Uncertain changes

If a change's result is uncertain, inspect the connection before trying again. Golf never automatically resends it.

Details and usage remain private page state and clear on page hide, sign-out or authority loss. Personal accounts belong to the signed-in user. Instance administration cannot browse another user's personal account.

Share an instance account​

Administrators choose a harness/provider when creating a named connection. Its UUID, scope and provider are immutable; use another connection for another provider.

Edit name and access assigns enabled Golf users by immutable identity:

  • New connections grant nobody access.
  • Administrators must explicitly select themselves to use a shared account; management alone does not grant use.
  • Selected users see metadata only, without credentials, approval challenges or user-access lists.
  • These grants do not expand provider seats or model entitlement.

Where agents run​

For Docker Compose, account setup runs inside the Golf service container, which packages all three pinned native CLIs. Every account gets a private temporary HOME and fixed account-only commands. There is no host agent connection or Docker socket in that service. Encrypted PostgreSQL snapshots restore credentials after restart.

For operator development, configure trusted absolute paths with GOLF_CODEX_BINARY, GOLF_CLAUDE_BINARY and GOLF_OPENCODE_BINARY. An empty path disables that adapter.

Managed coding tasks are not implemented yet. The intended executor gives each Docker task a disposable container/workspace, Kubernetes a task Pod/Job and Cloudflare a qualified Sandbox/Containers pool. Optional task Dockerfiles package the pinned CLIs with Git and a nonroot user. Native version launch has been checked, but this does not establish task admission, source/secret/egress isolation, cancellation, publication or paid model use.

warning

Do not share a writable rotating auth cache among replicas.

The Codex local operator runtime is a separate private experiment, not a managed Golf task.

Security boundaries​

  • Native credentials use the existing encrypted connection binding, advisory ownership, current-session/role checks, optimistic versions and post-provider persistence.
  • Approval uses the native CLI's PKCE state. Golf accepts only official Claude login URLs and a bounded private code for the exact pending login.
  • No arbitrary native RPC, shell argument, plugin or model prompt is accepted through the account service.
  • Native account status reports CLI state; automatic remote validation/renewal is not guaranteed.

Schema024 preserves existing Codex IDs and adds immutable harness/provider identity plus one personal connection per user/harness/provider. Legacy CodexAccountService and CODEX_* audit names remain internal compatibility identifiers. Schema022–025 full disaster recovery remains refusal-gated; the earlier qualified schema021 core/local RustFS recovery does not cover managed account state.

Current qualification​

Product/Helm checks pass, all 27 focused browser checks pass, native adapter race checks pass and real-PostgreSQL Codex/additional-harness/migration/startup race checks pass (server 32.355s, database 25.798s). Packaged arm64 native cache isolation/restoration/logout and real Claude authorization-link issuance/cancellation pass.

On local schema024, all four Claude/OpenCode API-key credential caches restored after backend replacement using deliberately invalid keys and were removed afterward. The actual Codex account and administrator session remained intact; both pipeline capabilities stayed ready.

Still needing separate evidence: approved Claude account completion, valid-key inference, distributed renewal and managed tasks.

Current product authority: b36d9b7, managed-agent contract.

Sources: Claude CLI, Claude authentication, OpenCode providers.