OpenCode Console Lets GitHub Actions Call AI Models Without Storing Keys
OpenCode Console now accepts short-lived OIDC tokens from CI runners, letting workflows call models without storing long-lived API keys as secrets.
Takeaways
- OpenCode Console now supports keyless authentication for calling models from CI.
- Any OIDC-capable environment can federate instead of storing long-lived
oc_sk_...API tokens. - Replaces the prior pattern of passing provider keys as CI secrets in
opencode run. - Directly reduces blast radius after the recent Console breach exposing stored provider credentials.
- Trust policies can scope access by repo, branch, workflow, and environment claims.
- Still requires an API key for non-OIDC environments like laptops or bare VMs.
OpenCode Console now accepts federated OpenID Connect identities from CI systems and other workloads that issue OIDC tokens. GitHub Actions, GitLab CI, and compatible runners can call models without storing a long-lived oc_sk_... key in a repository or secret manager.
Console sits between the automation job and model providers, so the keyless label applies specifically to runner authentication. Console may still hold upstream provider credentials used to reach services such as Anthropic, OpenAI, or cloud-hosted models.
| Area | Operational effect |
|---|---|
| Credential storage | The runner carries no durable Console secret. |
| Lifetime | The exchanged credential expires after a short session. |
| Authorization | Trust policies can evaluate repository, workflow, branch, and environment claims. |
| Audit | Requests can be attributed to a workflow identity and run. |
| Revocation | Administrators can disable a trust policy without rotating a shared key across repositories. |
One token, one run
- The CI platform issues a signed JSON Web Token to the job. Its claims can identify the organization, repository, workflow, branch, environment, and intended audience.
- Console verifies the signature using the issuer’s published JSON Web Key Set, checks the token’s audience and expiration, and compares its claims with a configured trust policy.
- Console returns a scoped, short-lived credential for the permitted workspace and resources.
- The job supplies that credential to
opencode run --standaloneor a direct Console API request. The credential expires automatically.
The audience claim, commonly named aud, identifies the service allowed to accept the token. The subject claim, commonly named sub, identifies the workload. Tight validation of both claims prevents a valid token issued for another repository or service from gaining access.
Existing jobs commonly follow the CLI guide by loading an API key from a CI secret before invoking OpenCode. Federation moves that bootstrap step to the CI platform’s identity service, removing the reusable Console key from the runner.
Shared keys blur the trail
Static keys remain valid until expiration or revocation, which gives an attacker more time to use a credential copied from logs, build artifacts, compromised runners, or permissive pull-request workflows. A key shared across several repositories also carries the combined permissions of every job that uses it.
Shared credentials weaken incident attribution. When Console, developer machines, and CI jobs use the same key, request logs identify the key but may not identify the system that leaked it. Revocation can also interrupt every workload tied to that credential.
A third-party incident report described exposure of stored credentials for several model providers and cloud platforms. Federation limits reusable Console keys in CI. Stored upstream credentials remain a separate security layer that requires access controls, rotation, monitoring, and incident response.
A stolen federated token remains usable until it expires. Short lifetimes, narrow audiences, and strict claim matching reduce its useful window and scope.
Claims draw the perimeter
Console trust policies determine which issuer and workload claims receive access. Broad organization-level rules simplify administration but allow more workflows to request credentials. Repository, workflow, branch, and environment restrictions create a smaller permission boundary.
| Control | Recommended scope | Purpose |
|---|---|---|
| Issuer | Exact CI provider URL | Accepts tokens from the intended identity provider. |
| Audience | Console’s expected value | Rejects tokens minted for another service. |
| Subject | Organization and repository | Limits which project can authenticate. |
| Workflow claims | Named workflow, protected branch, or environment | Restricts access to approved automation paths. |
| Permissions | Required workspace, models, and budget | Contains the effect of a compromised job. |
| Lifetime | Shortest practical session | Reduces the window for token reuse. |
OIDC authenticates a job’s identity while authorization policies contain what untrusted pull-request code can do. Teams should test trust rules against forked pull requests, tags, unprotected branches, and renamed environments before removing the old key.
Where keyless works
GitHub Actions, GitLab CI, CircleCI, Buildkite, and major cloud platforms can issue OIDC tokens to workloads. GitHub Actions requires the job permission id-token: write; GitLab supports job-level id_tokens with a configured audience.
Self-hosted GitHub Actions runners can still obtain GitHub-issued OIDC tokens when network and organization policies permit. Bare virtual-machine cron jobs, local developer machines, and isolated runners without a trusted issuer need a dedicated oc_sk_... key or an approved workload-identity broker.
Pay-as-you-go and Go workspaces can retain a service account as the permission boundary while CI authenticates through federation. The service account continues to define access, and the runner stops carrying its durable secret.
- Pull-request automation: each review job receives a temporary identity tied to its workflow context.
- Preview environments: short-lived deployments can call models without copying secrets into each environment.
- Multi-tenant pipelines: separate workflow identities can receive distinct workspace, model, and spending permissions.
- Audit trails: request records can include repository, workflow, and run claims instead of identifying only a shared key.
Retire keys in stages
- Inventory every repository, runner, and local process using the current Console key.
- Create a trust policy with an exact issuer, audience, repository, and approved workflow context.
- Enable OIDC token issuance in the CI job and exchange the token for a temporary Console credential.
- Grant only the workspace, model, and budget permissions required by that workflow.
- Test default branches, forked pull requests, tags, deployments, and failure paths.
- Remove the static secret from the repository, revoke the old key, and inspect logs for continued use.
- Issue separate, minimally scoped keys to workloads that lack OIDC, with documented owners and rotation schedules.