# Bring your own agent

Agent Mission Control developer docs > Bring your own agent

> Connect any agent or workflow to AMC by serving a small HTTP contract that AMC calls to start, watch, answer and cancel runs.

**Before you start:** An agent or workflow you can put behind an HTTP endpoint. Read [How agents connect](/developers/how-agents-connect/) first.

Bring your own agent means AMC drives an HTTP service you own. The service can wrap anything: a LangGraph graph, a .NET worker, a script, or another vendor's agent. You register it with the **Flight Director / custom** adapter (`flight-director`), and AMC calls a fixed set of paths under its endpoint URL.

## The endpoints AMC calls

| Method and path | AMC calls it when | Returns |
| --- | --- | --- |
| `GET /health` | You register the agent, or change its endpoint or auth. | Any `2xx` body |
| `POST /runs` | A run starts (manual, schedule, webhook). | A run: `orchestratorRunId`, `status`, `startedAt` |
| `GET /runs/{id}/status` | Every status-sync poll, and whenever someone opens the run. | Run status with every step |
| `GET /runs/{id}/tokens` | Every status-sync poll. | Token totals and `costUsd` |
| `GET /runs/{id}/steps/{stepId}/content` | Someone opens a step. | The step's output and activity log |
| `POST /runs/{id}/cancel` | Someone cancels the run. | The run, normally with status `cancelled` |
| `POST /runs/{id}/messages` | Someone answers your agent's question. | Run status after the answer |
| `GET /runs/{id}/events` | Someone is watching the run live. | A Server-Sent Events stream |

All eight are needed for the full experience. `/messages` matters only if your agent asks people questions, and `/events` only powers the live view: AMC records every run from its poll whether or not the stream works.

> **Note:** AMC does not call `GET /workflows`, `GET /workflows/{id}`, `GET /agent-types` or `GET /runs/{id}/content` today. The amc_sdk package serves them, but you don't need them, and AMC doesn't read run parameters or steps from them: you declare those when you register.

## Wire conventions

- JSON request and response bodies, with the camelCase keys shown in these docs. Extra keys are ignored. A misspelled key reads as empty, with no error.
- Timestamps are ISO 8601 with an offset, for example `2026-10-17T09:30:00+00:00`.
- Any non-`2xx` response is a failure. AMC retries each JSON call once (not `/health` or `/events`), on a transport fault or a non-`2xx` status, before giving up. Make `POST /runs` safe to receive twice.
- Run ids are yours. Make them unique and URL-safe; AMC escapes them into paths.

## Build it

1. Implement the endpoints. In Python, [the amc_sdk package](https://www.agentmissioncontrol.ai/developers/byo-amc-sdk/) serves all of them around one run function. In any other language, start from the [minimal endpoint](https://www.agentmissioncontrol.ai/developers/byo-test-locally/).
2. Decide how AMC authenticates: an API key, or managed identity on an approved https host. See [Endpoint and authentication](https://www.agentmissioncontrol.ai/developers/byo-endpoint-and-auth/).
3. Report progress the way AMC reads it: [run status and steps](https://www.agentmissioncontrol.ai/developers/byo-run-status/), [tokens and cost](https://www.agentmissioncontrol.ai/developers/byo-tokens-and-cost/), and [questions for people](https://www.agentmissioncontrol.ai/developers/byo-human-in-the-loop/).
4. Handle the failure cases in [Errors and timeouts](https://www.agentmissioncontrol.ai/developers/byo-errors-and-timeouts/).
5. [Test it locally](https://www.agentmissioncontrol.ai/developers/byo-test-locally/), deploy it, then register it: choose the **Flight Director / custom** adapter, enter the **Endpoint URL**, declare the [input contract](https://www.agentmissioncontrol.ai/developers/byo-input-contract/) and steps. See [Register your agent](https://www.agentmissioncontrol.ai/developers/register-your-agent/).

## Related

- [The amc_sdk Python package](https://www.agentmissioncontrol.ai/developers/byo-amc-sdk/)
- [Endpoint and authentication](https://www.agentmissioncontrol.ai/developers/byo-endpoint-and-auth/)
- [Start and cancel a run](https://www.agentmissioncontrol.ai/developers/byo-start-a-run/)
- [The integration contract](https://www.agentmissioncontrol.ai/developers/integration-contract/)

---
Source: https://www.agentmissioncontrol.ai/developers/byo-overview/ · Last updated 2026-10-21 · Full index: https://www.agentmissioncontrol.ai/llms.txt
