copilot-sdk copilot-instructions.md

Repository guidance for the GitHub Copilot SDK, a set of language libraries that connects applications to the Copilot command-line program. It explains the codebase structure, common commands, and tests in this monorepo, a repository containing several related projects.

In plain words
What is it for?
Finding important files, building and testing SDK changes, adding end-to-end tests, and working with the JSON-RPC connection between the SDKs and Copilot CLI.
Why use it?
It gives contributors and coding agents a clear starting point for understanding the repository and working consistently across its language implementations.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/github/copilot-sdk/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/github/copilot-sdk

Made for: GitHub Copilot.

Per session 1,801 This file is loaded in full into every session.
When invoked 1,801 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01801 $0.01801
Opus 5 $0.00901 $0.00901
Sonnet 5 $0.00360 $0.00360
Haiku 4.5 $0.00180 $0.00180

Measured yesterday against content hash cb5d8f000386, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

copilot-sdk copilot-instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/copilot-instructions.md · 74 lines

How it starts

The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GitHub Copilot SDK — Assistant Instructions

Quick purpose: Help contributors and AI coding agents quickly understand this mono-repo and be productive (build, test, add SDK features, add E2E tests). ✅

Big picture 🔧

  • The repo implements language SDKs (Node/TS, Python, Go, .NET, Rust, Java) that speak to the Copilot CLI via JSON‑RPC (see README.md and nodejs/src/client.ts).
  • Typical flow: your App → SDK client → JSON-RPC → Copilot CLI (server mode). The CLI must be installed or you can connect to an external CLI server via the CLI URL option (language-specific casing) (Node: cliUrl, Go: CLIUrl, .NET: CliUrl, Python: cli_url, Java: cliUrl).

Most important files to read first 📚

  • Top-level: README.md (architecture + quick start)
  • Language entry points: nodejs/src/client.ts, python/README.md, go/README.md, dotnet/README.md
  • Java: java/README.md, java/pom.xml, java/sdk/pom.xml, java/copilot-native/pom.xml
  • Test harness & E2E: test/harness/*, Python harness wrapper python/e2e/testharness/proxy.py
  • Schemas & type generation: nodejs/scripts/generate-session-types.ts
  • Session snapshots used by E2E: test/snapshots/ (used by the replay proxy)
  • Docs style guide: .github/instructions/docs-style.instructions.md (used for docs/**)

Developer workflows (commands you’ll use often) ▶️

  • Monorepo helpers: use just tasks from repo root:
    • Install deps: just install (runs npm ci, uv pip install -e, go mod download, dotnet restore)
    • Format all: just format | Lint all: just lint | Test all: just test
  • Per-language:
    • Node: cd nodejs && npm cinpm test (Vitest), npm run generate:session-types to regenerate session-event types
    • Python: cd python && uv pip install -e . --group devuv run pytest (E2E tests use the test harness)
    • Go: cd go && go test ./...
    • .NET: cd dotnet && dotnet test test/GitHub.Copilot.SDK.Test.csproj
    • .NET testing note: Never add InternalsVisibleTo to any project file when writing tests. Tests must only access public APIs.
    • Java: cd java && mvn clean verify (full build + tests), mvn spotless:apply (format code before commit)
    • Java single test: cd java && mvn test -Dtest=CopilotClientTest | single method: mvn test -Dtest=ToolsTest#testToolInvocation
    • Java format check only: mvn spotless:check | Build without tests: mvn clean package -DskipTests
    • Java testing note: Always use mvn verify without -q and without piping through grep. Never add InternalsVisibleTo equivalent — tests must only access public APIs.
  • Use configured LSPs for supported operations like finding references instead of pattern matching, renaming symbols, etc.

Read the full file on GitHub · 74 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 74 lines · 1,801 tokens per session scan A cb5d8f000386

Subscribe to this mod's changes

copilot-sdk copilot-instructions.md is an instructions file published in the GitHub repository github/copilot-sdk (10,441 stars, last pushed 2d ago), licensed MIT. It adds 1,801 tokens to every session, about $0.0090 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

buildNext

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

Instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,040 tokens

langchain AGENTS.md

Instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens