The four primitives
This page explains what Managoat's four objects are, and why there are four of them. For the fields on each one, read the API reference. To build something with them, start with the guided tour.
The problem the four primitives divide up
To run a coding agent on a machine that is not yours, you must decide four things. Each of the four changes on its own schedule.
What the machine holds changes rarely. Python 3.12, a checkout of your repo, a setup script. You decide it once for a team, then leave it alone for months.
Which credentials the agent runs with changes constantly. A staging database URL today, a customer's API key tomorrow, a rotated token an hour from now.
How the agent behaves changes sometimes. Which model, which runtime, which skills, which MCP servers, and what its system prompt says.
What it does right now changes every few seconds.
Put all four in one object, and each credential rotation edits the machine image. Each prompt edits the credentials. Managoat divides them into four objects on purpose, and that division is the product.
| Primitive | Answers | Changes |
|---|---|---|
| Environment | what the machine holds | rarely |
| Vault | which credentials the run uses | constantly |
| Agent | how the agent behaves | sometimes |
| Conversation | what it does now | continuously |
How they compose
An Agent names an Environment. A Conversation runs an Agent. That Conversation can name a different Environment, and it can attach a Vault for that one run.
Three of the four are templates. They are rows that you write once and use many times. The fourth, the Conversation, is a run on a machine. The machine is the heavy work, and Managoat does it for you.
__github_token__; the sandbox reaches the internet only through the broker, which attaches the value. A secret with no binding enters the sandbox as an environment variable.A Conversation starts. At that moment Managoat merges the Environment's secrets with the Vault's secrets. The Vault wins on a key collision. That one rule is what makes the division into four usable and not merely tidy. About vaults sets it out.
What happens next depends on the secret. Every sandbox reaches the internet
through the egress broker. A bound secret does not enter the sandbox: the
sandbox gets a placeholder, such as __github_token__, and the broker puts the
real value on each request to the bound host. A secret with no binding enters
the sandbox as an environment variable.
Where a secret comes from follows one secret through
both paths.
Why an API for this, when you can run an agent in a sandbox by hand? Because the templates outlive the run. The machine, the secrets and the agent are rows you can list, diff, share and launch from code. Because the identity and the machine are separate, so one Environment can run as you, as a bot user, or as a customer. And because a run is a thing with an id, a status, a transcript and an event stream. A webhook, a cron job or another agent can start one and follow it.
Substitution
Each string value in an Agent config takes a ${VAR} reference. Managoat
resolves it from the merged environment and vault secrets at spawn time.
| Syntax | Result |
|---|---|
${VAR} |
The value of VAR from the merged map |
$$ |
A literal $ |
Substitution is recursive, so it works inside maps and lists. It is also fail-complete. Managoat reports each absent variable at once, and not one for each attempt.
What Managoat does not have
There is no fifth primitive. Three things look like one and are not.
A long-lived agent is not an object. It is a Conversation that you keep,
by its id or by a channel_id of your own.
A sandbox is not an object you create. Managoat gives you one when a Conversation starts, one for each Conversation, and it ends with that Conversation. You can list sandboxes and read one. Read About sandboxes and the Sandboxes section of the API reference.
A workspace is a machine you keep. You create it from an Environment and a Vault, and then launch any number of Conversations into it, each in its own folder. It is something you create and delete, but it configures nothing: its Environment and Vault are two of the four, and the Agents that run there are a third. It changes only where a run happens. Every Conversation launched without one gets a workspace of its own, which is the sandbox above. Conversations in one workspace can read and influence each other, so it is also a choice to give up isolation. Read About workspaces.
Where to go next
- Learn as you build. The guided tour uses all four to open a pull request, in about forty lines.
- Understand one primitive. Environment, Vault, Agent, Conversation.
- Understand the machinery. Where a secret comes from follows a value from the master key to the process. About sandboxes covers the machine a run happens on. Architecture follows a prompt from the API call to the first token.
- Look something up. The API reference has each field. Conversation states has the state table. The glossary has the overloaded words.