copilot

A setup for running GitHub Copilot CLI, GitHub’s command-line coding assistant, with agentkernel, which runs code in isolated sandboxes.

In plain words
What is it for?
Use it to install the Copilot integration, configure it for one project or globally, start agentkernel, and provide the GitHub token Copilot requires.
Why use it?
It connects Copilot CLI to a controlled execution environment, reducing the need to run generated code directly on the host machine.

Agent

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 agents/thrashr888/agentkernel/copilot
Clone the repo
git clone --depth 1 https://github.com/thrashr888/agentkernel
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 856 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00000 $0.00856
Opus 5 $0.00000 $0.00428
Sonnet 5 $0.00000 $0.00171
Haiku 4.5 $0.00000 $0.00086

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

Security

Grade C, and why

copilot scanned grade C with 1 finding 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

&& rm -rf /var/lib/apt/lists/*
docs/agents/copilot.md · 137 lines

How it starts

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

Copilot CLI

Use GitHub Copilot CLI with agentkernel for isolated code execution.

Quick Start

Copilot CLI supports MCP natively. The agentkernel plugin registers MCP tools that Copilot CLI can call to run code in sandboxes.

# 1. Start agentkernel API server (pick one)
brew services start thrashr888/agentkernel/agentkernel   # runs in background, survives reboots
agentkernel serve                 # or run manually in a terminal

# 2. Install the plugin into your project
agentkernel plugin install copilot

# 3. Launch Copilot CLI — it picks up .mcp.json automatically
copilot

MCP Integration

Copilot CLI runs on your machine and calls agentkernel MCP tools to execute code in isolated sandboxes. The plugin merges agentkernel's MCP server into your project's .mcp.json:

agentkernel plugin install copilot

For global installation (available in all projects):

agentkernel plugin install copilot --global

API Key

Copilot CLI requires a GitHub token. Get one from github.com/settings/tokens.

Pass the token when running commands:

# Interactive session
agentkernel attach copilot-dev -e GITHUB_TOKEN=$GITHUB_TOKEN

# One-off command
agentkernel exec copilot-dev -e GITHUB_TOKEN=$GITHUB_TOKEN -- \
  copilot "Explain this code"

Sandbox-Based Workflow

You can also run Copilot CLI itself inside an isolated sandbox container:

# Create sandbox with Copilot CLI pre-installed
agentkernel sandbox create copilot-dev --config examples/agents/copilot/agentkernel.toml

# Start the sandbox
agentkernel sandbox start copilot-dev

# Run Copilot CLI with your token
agentkernel attach copilot-dev -e GITHUB_TOKEN=$GITHUB_TOKEN

# Inside the sandbox:
copilot

Configuration

Example config at examples/agents/copilot/agentkernel.toml:

[sandbox]
name = "copilot-sandbox"

[build]
dockerfile = "Dockerfile"

[agent]
preferred = "copilot"
compatibility_mode = "native"

[resources]
vcpus = 2
memory_mb = 1024

[security]
profile = "moderate"
network = true      # Copilot CLI needs network for GitHub API
mount_cwd = true    # Mount project directory

Read the full file on GitHub · 137 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 · 137 lines · 0 tokens per session scan C da2ef1f20a9a

Subscribe to this mod's changes

copilot is an agent published in the GitHub repository thrashr888/agentkernel (58 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 856 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.