DEV Community

Manu Shukla
Manu Shukla

Posted on • Originally published at ecorpit.com

GitHub Copilot SDK (GA 2026): build a custom AI agent in six languages

GitHub Copilot SDK (GA 2026): build a custom AI agent in six languages

Summary. GitHub made the Copilot SDK generally available on June 2, 2026, five months after its January 22, 2026 technical preview. It ships in six languages, Node.js/TypeScript, Python, Go, .NET, Rust and Java, and gives you programmatic access to the same agent runtime behind GitHub Copilot CLI: planning, tool calls, file edits, streaming and multi-turn sessions. The SDK itself costs nothing beyond a Copilot plan (from $10/month for Pro, $19/user/month for Business), and non-subscribers can run it with their own model key. This guide shows what it does, the code to start a session, how it compares to rolling your own agent loop, and what it costs to run in production.

If you have ever wired up an AI agent by hand, you know the tax. You manage context across turns, route between models, register tools, connect Model Context Protocol servers, and reason about permissions and failure modes before you write a line of product logic. GitHub's pitch for the SDK is that it removes that tax by handing you a tested execution loop instead of a blank file.

"Building agentic workflows from scratch is hard," wrote Mario Rodriguez, Chief Product Officer at GitHub, in the launch post. "You have to manage context across turns, orchestrate tools and commands, route between models, integrate MCP servers, and think through permissions, safety boundaries, and failure modes. Even before you reach your actual product logic, you've already built a small platform."

That is the whole argument for the SDK in two sentences. Below is a working engineer's read on what you get, where it fits, and where you should still reach for something else.

What the Copilot SDK actually is

The Copilot SDK exposes the Copilot agentic core, the same one that powers GitHub Copilot CLI, as a library you call from your own code. You are not calling a chat completion endpoint. You are driving an execution loop that plans a task, invokes tools, edits files, runs commands, and streams results across multiple turns.

Concretely, GitHub handles five things you would otherwise build yourself: model management and routing, GitHub authentication, MCP server integration, custom agents and chat sessions, and real-time streaming. You keep control of what the agent is allowed to do and what it builds on top of those pieces.

The runtime is not new code. It is the production-tested loop already shipping inside Copilot CLI, made callable in your language of choice. That distinction matters for reliability: you are reusing a component GitHub runs at scale, not a fresh abstraction released the same week.

The timeline, and the six supported languages

The SDK entered technical preview on January 22, 2026 with support for four languages: Node.js, Python, Go and .NET. General availability on June 2, 2026 added two more, Rust and Java, and marked the API as stable and production-ready after what GitHub described as a coordinated cleanup based on preview feedback.

Each language installs with a single package-manager command.

Language Install command Notes
Node.js / TypeScript npm install @github/copilot-sdk Available since the January 2026 preview
Python pip install github-copilot-sdk Available since the January 2026 preview
Go go get github.com/github/copilot-sdk/go Available since the January 2026 preview
.NET dotnet add package GitHub.Copilot.SDK Available since the January 2026 preview
Rust cargo add github-copilot-sdk New at GA; bundles the Copilot CLI binary by default
Java Maven and Gradle packages New at GA

The Rust package is worth a note: it bundles the Copilot CLI binary by default, so you get the runtime without a separate install step. GitHub's own repository, github/copilot-sdk, ships setup instructions, starter examples and per-language references.

Your first agent: the minimum working example

GitHub's own starter is four lines of TypeScript. You create a client, start it, open a session with a chosen model, and send a prompt.

import { CopilotClient } from "@github/copilot-sdk";

const client = new CopilotClient();
await client.start();
const session = await client.createSession({
    model: "gpt-5",
});

await session.send({ prompt: "Hello, world!" });
Enter fullscreen mode Exit fullscreen mode

That is the entire integration surface for a first call. The createSession call takes the model you want to route to; session.send runs the agent loop and streams back the result. From there you attach your own tools, set permissions, and hook into the lifecycle. GitHub's recommended first project is a single, bounded task, updating files, running a command, or generating a structured output, where the SDK plans and executes while your application supplies the domain-specific tools and constraints.

What you can build on top of it

The SDK's value is in the capabilities layered over that loop. At GA, GitHub documented six.

Custom tools and MCP. You register tools the agent can call autonomously, connect to Model Context Protocol servers, or override built-in tools such as grep and edit_file. This is how you give the agent access to your database, your ticketing system, or an internal API without teaching it anything hard-coded. If you are already running MCP servers, the SDK plugs into them directly, which shortens the path from a working MCP integration to an agent that uses it.

Fine-grained system prompt customization. You can edit individual sections of the Copilot system prompt, identity, tone, tool instructions and safety rules, without rewriting the whole thing. That means you tune behaviour surgically instead of pasting a wall of instructions and hoping.

Hooks. The hook system lets you intercept agent behaviour at specific points: pre and post tool use, session start, MCP tool calls, and permission requests. Hooks are where governance lives. You approve or deny a tool call, log every action, or inject a policy check before the agent touches anything sensitive.

Flexible authentication and BYOK. The SDK supports GitHub OAuth, GitHub Apps, environment tokens, and bring-your-own-key for OpenAI, Microsoft Foundry, Anthropic and other providers. BYOK is the reason a team with no Copilot seats can still use the runtime, and the reason a regulated team can route inference to a provider it has already cleared.

OpenTelemetry tracing. The SDK propagates W3C trace context across CLI startup, JSON-RPC calls, session operations and tool execution. If you run OpenTelemetry for LLM and agent tracing, agent spans land in the same backend as the rest of your stack, so you can see latency and failures per tool call instead of guessing.

Cloud and remote sessions. You can create cloud-backed sessions that carry repository metadata, or enable remote session URLs on demand, which matters when the agent needs repo context or you want a session reachable outside a single process.

Since the preview, GitHub also added multi-client workflows, where different clients contribute tools and permissions to the same session, plus slash commands and interactive input prompts across every SDK, and better diagnostics for slow or failing connections.

Copilot SDK, Copilot CLI, or your own framework?

The SDK is not always the right layer. Here is the decision most teams actually face.

What you need Best fit Why
An agent embedded inside your app or service Copilot SDK Programmatic access to the runtime in your language
An agent in the terminal for day-to-day dev work Copilot CLI The terminal interface went GA on June 23, 2026; no code required
Full control of the planner, memory and model-routing logic Your own framework Frameworks such as LangGraph or a custom loop give you the internals
Fast path to MCP tools and streaming without orchestration code Copilot SDK Tools, MCP, auth and streaming are handled for you
Inference on a model or provider you already run Copilot SDK with BYOK Route to OpenAI, Anthropic or Microsoft Foundry with your key

The honest framing: reach for the SDK when the agent loop is a means to an end and you want to ship the product on top of it. Reach for a production agent framework such as LangGraph or a Microsoft or Pydantic stack when the loop itself is the thing you need to own and customise end to end. The real cost is rarely the first call; it is the tools, the guardrails and the observability around it.

What it costs to run

The SDK carries no separate licence fee. It is available to every Copilot subscriber, including the free tier, and to non-subscribers through BYOK, where you pay your own model provider instead of GitHub. The cost question is therefore really a Copilot-plan and token-usage question.

GitHub changed how it bills for AI usage on June 1, 2026. It retired Premium Request Units and moved to GitHub AI Credits billed per token, while keeping code completions free on every paid plan. Each paid plan includes a monthly credit allowance; usage beyond it draws down credits.

Copilot plan Price (USD, as of July 2026) Included monthly AI credits
Free $0 Limited
Pro $10 / month $15
Pro+ $39 / month $70
Max $100 / month $200
Business $19 / user / month Pooled per organisation
Enterprise $39 / user / month Pooled per organisation

For a team building an internal agent, the practical planning number is not the seat price but the token burn of your workload. An agent that reads large files and calls tools on every turn consumes far more than an autocomplete user, so model the credit draw of a realistic session before you promise a cost per developer. GitHub has published guidance on getting more useful work per token through better context handling and model routing, which is worth reading before you size a deployment.

Security, governance and India-specific considerations

An embedded agent that can edit files and run commands is a capability and a liability. Three controls in the SDK carry most of the governance weight.

First, hooks on permission requests and tool use let you gate every sensitive action. Treat the permission hook as your policy enforcement point: deny by default, allow explicitly, and log the rest. Second, BYOK lets you route inference to a provider and region you have already approved, which matters when data cannot leave a boundary. Third, OpenTelemetry tracing gives you the audit trail, every tool call and session operation, that a security review will ask for.

For Indian teams, two points stand up. If the agent processes personal data, the Digital Personal Data Protection Act, 2023 applies regardless of where the model runs, so your consent, purpose-limitation and data-flow design has to hold even when an agent is in the loop. BYOK helps here: it lets a bank, insurer or health platform keep inference on a cleared provider rather than a default one. And because an SDK agent runs code, the same isolation discipline you would apply to any coding agent that executes in a sandbox applies here: give it a constrained workspace, not your production shell.

Global capability centres in Gurugram, Bengaluru and Hyderabad are a natural first home for this pattern, because they already run internal developer platforms where a Copilot-powered CI/CD assistant or code-review agent pays back quickly without touching customer-facing systems.

What teams are already building

GitHub says the SDK has been used to build CI/CD assistants, internal developer tools and customer-facing AI features since the preview. Its own examples run from the practical to the playful: YouTube chapter generators, custom GUIs for agents, speech-to-command workflows that run desktop apps, summarizing tools, and games you play against an AI. Internally, GitHub built Qubot, a Copilot-powered analytics agent that lets any employee query company data in plain language.

The pattern under all of these is the same. Pick one bounded job, give the agent exactly the tools it needs for that job, wrap it in hooks, and ship it. The SDK is deliberately unopinionated about the product; that is the point of shipping it as a runtime rather than an app.

When to use it, and when not to

Use the Copilot SDK when you want to embed a proven agent loop inside software you are already building, when you want MCP tools and streaming without writing orchestration, or when BYOK lets you satisfy a procurement or compliance constraint. It is the shortest path from idea to a working, governed agent for most teams that live inside the GitHub ecosystem.

Skip it when the agent loop is your product and you need to own the planner, the memory model and the routing logic down to the internals; a dedicated framework will serve you better. Skip it, too, for a pure terminal workflow, where Copilot CLI already does the job without any code. Match the layer to the problem and the SDK earns its place; treat it as a hammer for every nail and you will fight it.

FAQ

What is the GitHub Copilot SDK?

It is a library that gives you programmatic access to the same agent runtime behind GitHub Copilot CLI, covering planning, tool calls, file edits, streaming and multi-turn sessions. You embed that loop in your own application instead of building context management, tool orchestration and model routing yourself from scratch.

When did the Copilot SDK become generally available?

The SDK reached general availability on June 2, 2026, five months after its January 22, 2026 technical preview. GA marked the API as stable and production-ready after a cleanup based on preview feedback, and added Rust and Java to the four languages, Node.js, Python, Go and .NET, that shipped in preview.

Which programming languages does the Copilot SDK support?

Six at GA: Node.js and TypeScript, Python, Go, .NET, Rust and Java. Node.js, Python, Go and .NET were available in the January 2026 preview. Rust and Java were added on June 2, 2026, and the Rust package bundles the Copilot CLI binary by default so no separate install is needed.

How much does the Copilot SDK cost?

The SDK has no separate fee. It is included for every Copilot subscriber, including the free tier, and non-subscribers can use it with their own model key. Copilot plans run from $10 per month for Pro and $19 per user per month for Business, as of July 2026, with usage billed in GitHub AI Credits.

Can I use my own model with the Copilot SDK?

Yes. The SDK supports bring-your-own-key for OpenAI, Microsoft Foundry, Anthropic and other providers, alongside GitHub OAuth, GitHub Apps and environment tokens. BYOK lets a team with no Copilot seats run the runtime, and lets a regulated team route inference to a provider and region it has already approved for its data.

How is the SDK different from Copilot CLI?

Copilot CLI is a terminal application for day-to-day development, generally available since June 23, 2026. The SDK exposes the same underlying agent loop as a library, so you can embed it in a GUI, a service, or an internal tool. Use the CLI in the terminal; use the SDK inside software you are building.

How do I add custom tools or MCP servers?

Through the SDK you register tools the agent can invoke autonomously, connect to Model Context Protocol servers, or override built-in tools such as grep and edit_file. Hooks let you intercept tool calls and permission requests, so you approve, deny or log each action before the agent touches anything sensitive in your environment.

Is the Copilot SDK safe to run in production?

GitHub marked the API stable and production-ready at GA on June 2, 2026, and it reuses the runtime that already powers Copilot CLI. Safety in practice depends on you: gate actions with permission hooks, isolate the agent's workspace, route inference through approved providers with BYOK, and trace every call with OpenTelemetry.

How eCorpIT can help

eCorpIT is a senior-led technology organisation in Gurugram, founded in 2021, that helps teams design and ship AI agents into real products. We scope a bounded first use case, wire the Copilot SDK or an appropriate framework to your tools and MCP servers, and put the hooks, permissions and OpenTelemetry tracing in place so the agent is governed from day one. If you are planning an internal developer assistant or a customer-facing agent, see our work on enterprise AI agent development and MCP server development and integration, or contact us to talk through a first build.

References

  1. GitHub Changelog, "Copilot SDK is now generally available", June 2, 2026.
  2. Mario Rodriguez, GitHub Blog, "Build an agent into any app with the GitHub Copilot SDK", January 22, 2026.
  3. GitHub, github/copilot-sdk repository.
  4. GitHub Docs, Copilot SDK.
  5. GitHub Changelog, "Copilot CLI: New terminal interface is generally available", June 23, 2026.
  6. GitHub Changelog, "GitHub Copilot app support for BYOK", June 23, 2026.
  7. Joe Binder, GitHub Blog, "Getting more from each token: how Copilot improves context handling and model routing".
  8. GitHub, Copilot plans and pricing.
  9. Enterprise DNA, "GitHub Copilot ends flat pricing June 1: what changes", 2026.
  10. InfoWorld, "GitHub Copilot SDK allows developers to build Copilot agents into apps", 2026.
  11. Help Net Security, "GitHub Copilot app launches as desktop home for AI coding agents", June 8, 2026.
  12. GitHub Blog, "How we built an internal data analytics agent".

Last updated: July 24, 2026.

Top comments (0)