---
title: DigitalOcean Harness Runtime Examples (public)
description: Worked examples of Harness Runtime, each with a complete environment spec and the commands to run it, covering coding, marketing, document review, …
product: Managed Agents
url: https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/
last_updated: "2026-09-22"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# DigitalOcean Harness Runtime Examples (public)

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](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/details/what-you-can-build/index.html.md) 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](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/quickstart/index.html.md), 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](https://docs.digitalocean.com/products/inference/details/models/index.html.md#foundation-models), so you can use a single [model access key](https://docs.digitalocean.com/products/inference/how-to/manage-model-access-keys/index.html.md) 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](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/how-to/create-managed-agent/index.html.md). When using models with your own model API keys, billing is handled directly by the provider at the provider’s rates.

[Refactor a Repository](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/refactor-a-repository/index.html.md): 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.

[Review Pull Requests Automatically](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/review-pull-requests/index.html.md): Fire a Harness Runtime session from a GitHub webhook so every pull request gets an unattended first-pass review delivered to Slack.

[Draft Marketing Content on a Schedule](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/draft-marketing-content/index.html.md): 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.

[Review Documents Against a Policy](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/review-documents/index.html.md): 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.

[Triage Incidents From an Alert](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/triage-incidents/index.html.md): 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.

[Serve Many Tenants From One Environment](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/serve-tenants/index.html.md): 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](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/refactor-a-repository/index.html.md) | The baseline interactive session: repositories, GitHub credentials, a persistent workspace, and approval prompts. |
| [Review Pull Requests](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/review-pull-requests/index.html.md) | Webhook triggers, and the permission rules an unattended run requires. |
| [Draft Marketing Content](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/draft-marketing-content/index.html.md) | Inline skills, Action Gateway catalog tools, and scheduled runs. |
| [Review Documents](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/review-documents/index.html.md) | The locked-down pattern: a deny default, a narrow allowlist, and no persistence. |
| [Triage Incidents](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/triage-incidents/index.html.md) | Attaching an MCP server you host yourself, and the egress entry it needs. |
| [Serve Tenants From One Environment](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/examples/serve-tenants/index.html.md) | Environment Configs, per-tenant sessions, and forking a warm checkpoint. |

For the fields every spec above uses, see the [Environment Spec Reference](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/reference/environment-spec/index.html.md).