Run Claude Code against one of your sandbox repositories on DigitalOcean Serverless Inference, approve its shell commands as it works, disconnect, and resume the same workspace later.
DigitalOcean Harness Runtime Examplespublic
Last verified 22 Sep 2026
DigitalOcean Harness Runtime combines the functionality of a lightweight microVM, built-in tools like chromium and a coding sandbox needed by agents to do work. The product offers rich lifecycle APIs that persist conversational history and working state across sessions, with pause/resume/fork semantics so that developers can control costs and adapt workflows to the nonlinear quirks of agentic work. See What You Can Build for example use cases.
Each page here is a complete worked example: the environment spec, the commands to run it, and the specific fields to change to make it yours. They are ordered roughly from simplest to most involved, and each one introduces a capability the earlier ones do not.
If you have not started a session before, begin with the Quickstart, which starts an agent with one command and no spec file. These examples pick up where it leaves off, at the point where you want to control the environment rather than accept the defaults.
Every spec here uses a model from the Serverless Inference model catalog, so you can use a single model access key with Claude Code, Codex CLI, and OpenCode alike. The model usage is billed through your DigitalOcean account rather than the provider account. Each spec sets that up with two fields, HARNESS_INFERENCE_MODEL under env and HARNESS_INFERENCE_API_KEY under secrets. To use an Anthropic or OpenAI key instead, replace that pair with the provider’s own variable, as described in Use a Coding Adapter. When using models with your own model API keys, billing is handled directly by the provider at the provider’s rates.
Fire a Harness Runtime session from a GitHub webhook so every pull request gets an unattended first-pass review delivered to Slack.
Run a weekly agent that researches a topic with Action Gateway web search, drafts copy in your brand voice using an inline skill, and commits it to a content repository for review.
Run a locked-down Harness Runtime environment that reads contracts or policy documents, flags clauses against your checklist, and leaves nothing behind when the session ends.
Start a Harness Runtime session from an alerting webhook, let the agent query your own observability MCP server, and deliver a triage summary to Slack before anyone opens a laptop.
Save a Harness Runtime environment once as an Environment Config, start an isolated session per customer from it, and fork a warmed-up checkpoint to run evaluations in parallel.
What Each Example Adds
The examples build on each other. Reading them in order is the fastest way to see the whole surface, but each one stands alone if you only need that case.
| Example | What it introduces |
|---|---|
| Refactor a Repository | The baseline interactive session: repositories, GitHub credentials, a persistent workspace, and approval prompts. |
| Review Pull Requests | Webhook triggers, and the permission rules an unattended run requires. |
| Draft Marketing Content | Inline skills, Action Gateway catalog tools, and scheduled runs. |
| Review Documents | The locked-down pattern: a deny default, a narrow allowlist, and no persistence. |
| Triage Incidents | Attaching an MCP server you host yourself, and the egress entry it needs. |
| Serve Tenants From One Environment | Environment Configs, per-tenant sessions, and forking a warm checkpoint. |
For the fields every spec above uses, see the Environment Spec Reference.