> ## Documentation Index
> Fetch the complete documentation index at: https://docs.duraton.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent rules

# Duraton - rules and knowledge for coding agents

This file gives an AI coding agent the core facts about Duraton so it can help build on it. It
contains no secrets.

## What Duraton is

Duraton is where people build and sell AI agents, no code required. Every agent's run is a
step-by-step record: what it did, in order, with an approval gate before the risky actions and
replay for any completed run.

This file is for the **code path**: building or extending an agent in code, with `@duraton/sdk` and
`@duraton/agent-kit`, rather than in the console. A workflow runs as a sequence of steps; each
step's result is recorded, so a crash or retry resumes from the last completed step instead of
starting over or paying for the same model call twice.

## Core nouns

* **Workspace** - the top-level account. A workspace holds one or more projects.
* **Project** - an isolated environment with its own base URL and API keys. Runs, events, and data
  in one project are invisible to another.
* **Workflow** - a named unit of durable work, made of steps.
* **Step** - one recorded unit inside a workflow (an action, a model call, an approval). Its output
  is saved and replayed on retry.
* **Runner** - the process that executes workflows. It runs in the user's own environment with their
  code and their provider keys; Duraton records step metadata but not prompts or responses.
* **Event** - a message that triggers matching workflows. Workflows can also run on a schedule.

## Wiring a runner

A runner needs two environment variables, both found in the Duraton console under the project's
**API Keys / Connect** area:

* `DURATON_URL` - the run base URL the runner sends to, for example `https://run.duraton.dev`.
* `DURATON_API_KEY` - a **secret** key issued in the console under **API Keys** (looks like
  `dtn_live_...`).

Never hard-code the secret key in source. Read it from the environment. Never ask the user to paste
it into chat.

## Driving Duraton over MCP

The Duraton product MCP server exposes the same operations as the REST API as tools: list and
control **runs**, trigger **events**, manage human **approvals**, and inspect **webhooks**. An agent is a first-class user - it can trigger and steer runs,
not just read them. Grant only the access a task needs (read-only vs write).

Two MCP URL forms:

* **Per-project URL** `https://mcp.duraton.ai/YOUR_PROJECT_ID` - pinned to exactly one project.
  Use this for agents, CI, and any repo that always targets the same project. The project id is
  shown in the console.
* **Bare URL** `https://mcp.duraton.ai` - pick a Workspace and Project at sign-in; one active
  project at a time. Use this for interactive work. To drive two projects at once, use two
  per-project URLs.

Both authenticate with OAuth in the browser - no key is stored in config.

## Docs

Search the Duraton docs through the docs MCP at `https://docs.duraton.ai/mcp`, or read them at
`https://docs.duraton.ai`.
