Skip to content

Exploring Mash with Pilot

Pilot is a Mash host that ships in the mashpy repo at src/pilot/, with a terminal CLI built on Mash's CLI kit. Its pilot agent answers questions about the Mash codebase, and its builder agent builds Mash apps in your sandbox. The companion's routing, the board, workflows, skills and traces from the architecture series are all observable in it.

Start Pilot

A Pilot deployment is Postgres and a Mash host, run with Docker Compose from a checkout of the repo. The host runs each agent as a process inside its container. Through the Docker socket it starts a sandbox per policy, where the agents' code runs, and mounts the checkout read-only into each one at /home/agent/mashpy. Put GEMINI_API_KEY, OPENROUTER_API_KEY, MASH_HOST_SECRET and MASH_API_KEY (each openssl rand -hex 32) in .env, then:

git clone https://github.com/imsid/mashpy.git && cd mashpy
docker compose -f docker-compose.pilot.yml up -d --build

curl -fsSL https://raw.githubusercontent.com/imsid/mashpy/main/install.sh | sh
echo '{}' | mash policy put me --file - --api-base-url http://127.0.0.1:8000
mash connect --api-base-url http://127.0.0.1:8000 --app-id pilot --policy-id me
pilot browse

Run from the checkout, mash connect reads MASH_API_KEY from .env and saves it with the connection, and pilot uses it from there. pilot browse lists the host's agents, the pilot guide and the builder, each through the AgentMetadata it registered with, and the workflows the companion can run. The same metadata is what the companion routes by, as the companion post covered. Every message is an event under the app and the policy mash connect saved, and the code the agents run for it runs in that policy's sandbox. mash sandbox ls lists the sandboxes. When you ask the guide about the published docs or the GitHub repository, it searches them in a Chromium the host starts for you on first use; mash browser view me prints a link to watch it.

pilot repl opens the Mash codebase guide. Pilot's host is pilot.spec:build_host, and every message goes to the built-in companion, which routes it:

Agent Role
companion built in; routes each message to pilot, builder or the changelog workflow
pilot answers questions about Mash from the mounted source, docs and git history
builder builds Mash apps in its own workspace and checks them
> Summarize how HostBuilder registers agents and workflows on a host.
> Trace how an accepted request moves through AgentRuntime, RuntimeStore, and RequestEngine.
> Build me an agent with a knowledge base search tool and human approval for refunds.

The guide answers from the repository with rg and sed, run as shell code through run_code, and its prompt carries a map of where each module and post is documented. When you ask for an app, the companion routes the request to the builder, which follows the build-mash-agent, build-mash-workflow, or build-mash-host skill, writes the app under /home/agent/workspaces/builder/apps/<name> in your sandbox, installs mashpy with uv, and runs the app's tests. It cannot serve the app, because a sandbox has no Docker; copy it out with docker cp. The shell renders the routed request's trace frames live, so you watch the routing happen.

The changelog workflow

pilot-changelog is a two-step workflow that shows the CodeStep → AgentStep shape end to end. The first step is deterministic Python: it reads CHANGELOG.md and slices out the most recent release section(s). The second is one agent run that turns that excerpt into a plain-language summary, reaching into the source with run_code only when an entry is too terse to explain on its own. Ask for the latest changes and the companion routes to it, or run it yourself with /workflow run pilot-changelog, which streams the steps.

Watching it run

After any answer, /trace shows where the time went: the timing breakdown, per-tool stats, and slowest operations from the trace post. For a routed question the companion's request and the routed request are separate traces, so you can see how much latency belonged to the builder. The host also serves the admin dashboard, with the trace drawer and span tree, at http://127.0.0.1:8000/admin.

Reference

CLI command What it does
pilot browse the agents and workflows the companion routes to
pilot repl the host's REPL
REPL command What it does
/agents, /tools the host's agents, and their tools and skills
/trace [N] latency analysis of recent requests
/workflow list\|run\|status inspect or run the host's workflows
/new, /resume a new session, or an earlier one
/help, /clear, /exit shell basics
/feedback <message> record a note or bug report for the session

Pilot's CLI is a thin layer over Repl and MashHostClient: argument parsing and the browse command. Building an Agent CLI walks through building the same thing for your own agent.