In short.
This GitHub Copilot SDK guide helps service and CI developers authenticate automated Copilot requests, but GitHub App tokens require organization enablement and expire after one hour. External services use installation tokens with explicit SDK credentials; organization-owned GitHub Actions workflows use GITHUB_TOKEN with the documented permission and policy. Token replacement requires restarting the SDK client or host runtime, depending on deployment. Prices, SDK versions and end-to-end results are not established, and no examples were executed.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete supplied page at [https://docs.github.com/api/article/body?pathname=/en/copilot/how-tos/copilot-sdk/auth/server-to-server-tokens], including Actions, external services, six language examples, runtime configuration, renewal, billing and troubleshooting. Linked authentication and installation-token-generation pages are excluded. No license notice appears in the supplied page. No commands or examples were executed; organization eligibility, token issuance, runtime compatibility, renewal behavior and billing outcomes remain unverified.
The overview
Identity
GitHub’s Server-to-server authentication page documents credentials for making Copilot requests on behalf of an organization without a signed-in user. It is a focused authentication guide covering GitHub Actions, external services and SDK runtime configuration.
The original source is [https://docs.github.com/api/article/body?pathname=/en/copilot/how-tos/copilot-sdk/auth/server-to-server-tokens].
Assessment
The guide is useful when an automated service needs organization-attributed Copilot access without relying on a developer’s saved credentials. Its strongest details are the distinct permissions for Actions and GitHub Apps, the effects of disabling credential discovery, and the restart requirements for replacement tokens.
It supplies configuration guidance but does not establish a complete working application, organization eligibility or compatibility with a particular SDK release.
Users
The intended readers are developers building background services, CI integrations or GitHub Actions workflows that make Copilot requests. Organization administrators may also need it to identify the relevant enablement, permissions and billing destination.
Beginners receive concrete configuration examples, but GitHub App creation, installation-token generation and SDK installation are not explained fully on this page.
Capabilities
The page explains credential selection, organization permissions, explicit SDK token configuration, token replacement and organization billing. It includes examples for TypeScript, Python, Go, Rust, .NET and Java, plus guidance for in-process FFI and an existing runtime URI.
Troubleshooting covers expired tokens, missing organization enablement, absent permissions, ignored environment credentials, unavailable models and billing attributed to the wrong organization.
Using it
Requirements
Outside GitHub Actions, the documented route requires a GitHub App installed on the intended organization with the Copilot Requests organization permission set to Read-only. The organization must be enabled for Copilot requests from GitHub App installations. Token creation requests the permission organization_copilot_requests with the value read.
For GitHub Actions, the workflow must be in an organization-owned repository. The example grants contents: read and copilot-requests: write, and requires the organization policy Allow use of Copilot CLI billed to the organization. Requested models must also be allowed by organization policy and supported by the bundled runtime. Specific plan and SDK version requirements are unknown.
Mechanism
An installation access token, identified in the guide by its ghs_ prefix, authenticates Copilot requests through the GitHub App installation. Usage is attributed and billed to the organization owning that installation; no signed-in user is required.
For an SDK-managed child runtime or in-process FFI, the guide passes the token through the explicit SDK option. Setting useLoggedInUser to false disables automatic credential discovery, including environment-variable tokens. For an existing runtime URI, the guide instructs setting COPILOT_GITHUB_TOKEN on that runtime process.
Setup
For an external service, create and install the GitHub App with the documented organization permission, generate an installation token with organization_copilot_requests set to read, and supply it through the SDK’s explicit token option. The page links to separate token-generation instructions; those instructions are outside this page.
Installation tokens expire after one hour. Mint a replacement before expiry, then restart the SDK client for a child process or restart the host runtime for an in-process or existing runtime. The page does not provide an automated renewal implementation.
Example
The TypeScript example reads INSTALLATION_TOKEN, rejects a missing value, and creates CopilotClient with RuntimeConnection.forStdio(), gitHubToken set to the token and useLoggedInUser set to false. The Python example uses github_token and use_logged_in_user for the corresponding settings.
The Actions example passes the built-in token to the application as GITHUB_TOKEN after granting copilot-requests: write. These examples configure authentication; they do not show a complete Copilot request or generated response. None was executed.
Assessment & evidence
Limitations
Organization enablement is a prerequisite, and a valid installation token alone does not establish access. Model availability additionally depends on organization policy and runtime support.
The page does not explain SDK installation, provide complete token-minting code, demonstrate automatic renewal or establish how restarts affect active sessions and requests. Authentication success, billing accuracy, performance and generation quality were not assessed.
Reasoning
The documented combination of installation-specific billing and explicit credentials makes this guide relevant to teams separating service access from individual user accounts. Disabling automatic credential discovery addresses the documented risk of falling back to stored user credentials.
An operational implication is that long-running services need a renewal and restart strategy because installation tokens expire after one hour. Whether those restarts interrupt work is unknown, so the page alone cannot establish suitability for uninterrupted service operation.
Alternatives
For organization-owned GitHub Actions workflows, the page recommends the built-in GITHUB_TOKEN. That route needs no GitHub App or stored authentication secret, subject to the stated permission and organization policy.
For services and CI systems outside GitHub Actions, the documented option is a GitHub App installation token. The page links to other authentication methods, but their requirements and tradeoffs are not established within the supplied content.
Evidence
The evidence consists of the complete supplied GitHub documentation page at [https://docs.github.com/api/article/body?pathname=/en/copilot/how-tos/copilot-sdk/auth/server-to-server-tokens]. It includes configuration examples, requirements, billing attribution and an error-to-check troubleshooting table.
These are documented behaviors and requirements. No execution results, successful requests, billing receipts or independent compatibility measurements are supplied.
Access & freshness
Costs
For GitHub App authentication, usage is attributed and billed to the organization that owns the installation. The Actions route requires a policy permitting Copilot CLI use billed to the organization.
Request prices, included allowances, model-specific charges, spending limits and total operating costs are unknown from this page. Using the built-in Actions token does not establish that Copilot usage is free.
Rights
The supplied page contains no license or redistribution terms for its documentation or code examples. Permission to redistribute those materials is unknown from this evidence.
Applicable SDK licensing, service terms and rights concerning generated output are also not established by this page.
Freshness
The available source copy was captured on 24 November 2026. The page supplies no publication date, last-updated date or Copilot SDK release version, so the age of the guidance and its applicability to a particular SDK version are unknown.
Organization policies, feature enablement and bundled runtime support remain dependencies to confirm for an intended deployment.
Actions
Choose the documented credential route for the deployment environment, confirm the organization’s required enablement and model policy, and verify that the installation belongs to the intended billing organization.
For installation tokens, arrange replacement before the one-hour expiry and account for the required client or runtime restart. Before relying on the integration, validate authentication, expiry handling, restart effects and billing attribution in the intended environment. Those outcomes are not established here.
