amp

Instructions for using Amp, Sourcegraph’s coding agent, with agentkernel, a service that runs code in isolated sandboxes. It covers setup, MCP tool access, API keys, and sandbox-based use.

In plain words
What is it for?
Installing the Amp integration, starting the agentkernel service, configuring project or global use, and launching Amp with sandbox execution.
Why use it?
It explains how to connect Amp to isolated execution environments so code can run with separation from the main machine or project.

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/amp
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 805 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.00805
Opus 5 $0.00000 $0.00402
Sonnet 5 $0.00000 $0.00161
Haiku 4.5 $0.00000 $0.00081

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

Security

Grade C, and why

amp 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/amp.md · 128 lines

How it starts

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

Amp

Use Amp (by Sourcegraph) with agentkernel for isolated code execution.

Quick Start

Amp supports MCP natively. The agentkernel plugin registers MCP tools that Amp 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 amp

# 3. Launch Amp — it picks up .mcp.json automatically
amp

MCP Integration

Amp 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 amp

For global installation (available in all projects):

agentkernel plugin install amp --global

API Key

Amp uses an Anthropic API key. Get one from console.anthropic.com.

Important: Use a regular API key (sk-ant-api03-...), not an OAuth token.

Sandbox-Based Workflow

You can also run Amp itself inside an isolated sandbox container:

# Create sandbox with Amp pre-installed
agentkernel sandbox create amp-dev --config examples/agents/amp/agentkernel.toml

# Start the sandbox
agentkernel sandbox start amp-dev

# Run Amp with your API key
agentkernel attach amp-dev -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY

# Inside the sandbox:
amp

Configuration

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

[sandbox]
name = "amp-sandbox"

[build]
dockerfile = "Dockerfile"

[agent]
preferred = "amp"
compatibility_mode = "amp"

[resources]
vcpus = 2
memory_mb = 1024

[security]
profile = "moderate"
network = true      # Amp needs network for Anthropic API + Sourcegraph
mount_cwd = true    # Mount project directory

Environment Variables

Variable Default Description
AGENTKERNEL_BASE_URL http://localhost:18888 agentkernel API endpoint
AGENTKERNEL_API_KEY - Optional Bearer token for API auth
ANTHROPIC_API_KEY - Required by Amp for LLM calls

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

Subscribe to this mod's changes

amp 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 805 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.