Skip to content

Governing subscription-authed Claude Code & Codex

The hardest agent to govern is the one a developer logged into with a personal or company subscription: Claude Code signed in with Pro/Max, or Codex signed in with ChatGPT. The same shape applies to Grok Build, and to any CLI agent that authenticates the person rather than the workload — the mechanisms below are about the shape of that login, not about one vendor. It runs on a laptop, it authenticates with an OAuth credential, and it is exactly the surface a cloud-provider guardrail in the inference path never sees (see the wedge). The tempting “solution” — put a service in front of it that holds the subscription and routes its traffic — is one Olivares AI will not build, because the model providers prohibit it and because it would make our control plane a single point of credential compromise.

This page is the honest account of how we govern these agents without ever brokering the subscription: what we observe, where we enforce, and the one narrow path where a gateway is appropriate (and it is never the subscription’s).

Why brokering the subscription is off the table

Section titled “Why brokering the subscription is off the table”

It is worth being precise about the rule, because a buyer’s counsel will check it. Anthropic’s policy draws two lists that must not be conflated:

  • Who may use OAuth at all — five plans: “OAuth authentication is intended exclusively for purchasers of Claude Free, Pro, Max, Team, and Enterprise subscription plans and is designed to support ordinary use of Claude Code and other native Anthropic applications.”
  • What a third party may not do — route on behalf of users: “Anthropic does not permit third-party developers to offer Claude.ai login or to route requests through Free, Pro, or Max plan credentials on behalf of their users.”

The prohibition explicitly names the consumer plans (Free, Pro, Max). The page does not, conversely, grant anyone permission to route Team or Enterprise seats — it is silent on that, and we do not read silence as a licence. For developers building tooling, Anthropic’s own guidance points away from subscription OAuth entirely: “Developers building products or services that interact with Claude’s capabilities, including those using the Agent SDK, should use API key authentication through Claude Console or a supported cloud provider.” (source; plan-by-terms split: Team/Enterprise/API under Commercial Terms, Free/Pro/Max under Consumer Terms.)

Our Codex connector encodes the identical discipline in code, by design: the automation credential is an OpenAI API key or a workspace access token, never a personal ChatGPT subscription — “proxying it for third-party/programmatic use violates OpenAI’s terms exactly as a consumer Claude subscription does for Anthropic. There is no subscription config field by design” (connectors/codex/codex.go). So the red line is not a marketing promise bolted on afterward; it is the shape of the product.

Three mechanisms, none of them the subscription

Section titled “Three mechanisms, none of them the subscription”

We govern a subscription-authed agent through three independent channels. The first two never touch inference at all; the third touches it only for traffic that authenticates with an API key, never a subscription.

1. Observe — telemetry, usage, and posture

Section titled “1. Observe — telemetry, usage, and posture”

Claude Code emits OpenTelemetry, and an administrator can turn it on for the fleet from the managed tier: “Administrators can configure OpenTelemetry settings for all users through the managed settings file” (Claude Code monitoring). We ingest that gen-ai signal — sessions, tokens, cost, tool activity — and turn it into the access map and posture findings. Crucially, this is minimal-data by construction on Claude Code’s side too: prompt content is “redacted by default” and tool details, tool content, and raw API bodies are each “(default: disabled)” (same source). We consume usage and metadata, not conversations.

For Codex, the same observe channel is the connector’s ingest of the Analytics and Compliance/Audit APIs — usage, adoption, and immutable audit records turned into cost samples and tamper-evident evidence, carrying “never prompt/diff content or key values” (connectors/codex/codex.go).

Ingest OpenTelemetry GenAI · Enterprise OTel for Claude Code

2. Managed settings + hooks — the in-process PEP

Section titled “2. Managed settings + hooks — the in-process PEP”

Observation is not enforcement. The enforcement channel for Claude Code is its managed settings file at the OS-policy tier, which carries a non-overridable PreToolUse hook that calls back to the Olivares decision point before every tool runs. Anthropic documents the property we rely on: “Environment variables defined in the managed settings file have high precedence and cannot be overridden by users”, and managed settings “can be distributed via MDM” (monitoring).

Olivares renders that file (olivares agent managed-settings) with allowManagedHooksOnly so a developer’s own hook can never precede or undercut the governed one, and the per-session endpoint and bearer are injected at launch — not written into the static file. The decision itself is deny-closed at every edge: a tool-call is allowed only when a firm identity resolves, the policy disposition is not deny, the live policy engine does not forbid it, and — for an ask — a human approval is bound to the exact plan hash. An emergency stop (kill switch) outranks everything, including an active break-glass grant.

This is the mechanism the Claude Code hooks PEP page documents operationally, and it is what makes us able to govern the local dev agent, not merely watch it — the second of the three lanes.

3. Gateway for an API key — never for OAuth

Section titled “3. Gateway for an API key — never for OAuth”

There is exactly one path where Olivares sits in the inference request line, and it exists only for callers that do not use Claude Code’s managed-settings channel: raw SDK or curl traffic authenticated with an API key (or a Bedrock/Vertex-equivalent). Claude Code routes such requests with ANTHROPIC_BASE_URL“To route requests through a custom API endpoint, set the ANTHROPIC_BASE_URL environment variable instead” — and authenticates a gateway with a bearer via ANTHROPIC_AUTH_TOKEN, “when routing through an LLM gateway or proxy that authenticates with bearer tokens rather than Anthropic API keys” (Claude Code IAM). Pointed at the Olivares inline inference proxy, that traffic gets a governed pipeline — residency, model access, context-window, DLP, budget, recording — before it is forwarded.

The boundary is absolute: this path carries API-key / bearer traffic, never a subscription’s OAuth credential. It is the enforcement seam for the SDK/curl callers that managed settings cannot reach, and nothing more.

The honesty box: verified-deployed, not unbypassable

Section titled “The honesty box: verified-deployed, not unbypassable”

Claude Code and Codex are not symmetric, and the difference matters. For Codex authenticated by ChatGPT there is no documented equivalent of ANTHROPIC_BASE_URL — OpenAI’s managed-configuration page documents no setting or environment variable to route inference through a custom base URL or gateway (verified by fetch, 2026-06-21; an absence on that page, not a proof none exists elsewhere). So we do not govern Codex by intercepting its inference.

Instead we govern it where OpenAI does give administrators enforced controls. Codex managed configuration lets an enterprise set “Requirements: admin-enforced constraints that users can’t override” that “constrain security-sensitive settings (approval policy, approvers reviewer, automatic review policy, sandbox mode, permission profiles, web search mode, managed hooks, and optionally which MCP servers users can enable)” (same source). Olivares authors and attests those requirements (connectors/codex-managed-config) — approval policy, sandbox mode, the MCP allowlist, redacted telemetry (log_user_prompt = false) — and ingests Codex’s Analytics and Compliance evidence. Governance through configuration and evidence, not through a man-in-the-middle on the model call.

ChannelWhat it doesTouches inference?The credential
ObserveUsage, cost, tool activity → access map + posture; Codex Analytics/Compliance → ledgerNoNone — telemetry only, content redacted by default
Managed settings + hooksDeny-closed PreToolUse PEP on Claude Code, non-overridable via settingsNoThe agent’s own; we never see it
Gateway (API key only)Governed pipeline for raw SDK/curl callers via ANTHROPIC_BASE_URLYesAPI key / bearer — never subscription OAuth
Codex managed-configAdmin-enforced requirements (approval/sandbox/MCP) + evidence ingestNoThe org’s; configuration, not interception