lgr.yaml

lgr.yaml

lgr.yaml describes an agent. The plugin and lgr import write one from what the folder already has, and lgr deploy reads it. A folder uploaded in the console uses its lgr.yaml when it has one. Paths are relative to the file.

name: support-bot
harness: codex
model:
  name: tensorblock/gpt-6.1-sol
instructions: ./AGENTS.md
skills: ./.claude/skills/        # or a list of skill folders or names
files: [scripts, data, requirements.txt]
setup: pip install --user -r requirements.txt
mcp_servers:
  - name: linear
    url: https://mcp.linear.app/mcp
    secret: LINEAR_TOKEN
  - name: crm
    command: python3
    args: [scripts/crm_mcp.py]
    env: { CRM_TOKEN: "${CRM_TOKEN}" }
secrets: [LINEAR_TOKEN, CRM_TOKEN]
egress:
  allow: [api.zendesk.com, "*.githubusercontent.com"]
limits:
  max_minutes: 30
improvement:
  mode: manual
  success: Every answer quotes the policy that applies and links the ticket.

Only name is required.

Fields

FieldMeaning
nameThe agent's name in the project. Deploying the same name again adds a version.
harnesscodex, claude-code, hermes or deepseek (lagrange is coming soon), or { command, args } for your own harness. Without one, the agent gets the platform's default harness and keeps it until a deploy names another.
modelname is the main model, such as tensorblock/gpt-6.1-sol. Without it, the harness's default platform model is used. A name without the tensorblock/ prefix means the platform model of that name.
instructionsA file (./AGENTS.md, ./CLAUDE.md) or the instructions as text.
skillsA folder of skills (each a folder with a SKILL.md), or a list of skill folders or names. The harness loads them where it normally looks for skills.
filesFiles and folders copied into the run's working directory: scripts, data, dependency files, local MCP servers. Only listed files are uploaded, and .env files in them are always left out. Never list other files that hold keys.
setupA command or list of commands run in the working directory before the harness starts, such as pip install --user -r requirements.txt. A failing command fails the run with its output.
mcp_serversMCP servers the agent can use; see below.
secretsNames of project secrets passed to the run as environment variables.
egress.allowHosts the agent may reach while it works; see below.
limitsmax_minutes, max_cost_usd and max_turns per run.
improvement.modeoff stops LagrangeCloud from proposing improvements on its own.
improvement.successWhat a good run of the agent does, in a sentence or two. Quality fixes and replay judges read it.
stepsRuns the agent as a workflow of steps, each with its own instructions and model; see below.

MCP servers

A server either runs somewhere else and is reached by URL, or runs inside the sandbox as a command.

mcp_servers:
  # Hosted: the secret is sent as a bearer token.
  - name: linear
    url: https://mcp.linear.app/mcp
    secret: LINEAR_TOKEN
  # Hosted, signed in with OAuth: the secret holds the access token.
  - name: notion
    url: https://mcp.notion.com/mcp
    secret: NOTION_TOKEN
    oauth: true
  # Hosted, with a key in another header: ${NAME} is filled from project secrets.
  - name: weather
    url: https://mcp.example-weather.com/mcp
    headers: { X-API-Key: "${WEATHER_API_KEY}" }
  # In the sandbox: ${NAME} in env is filled from project secrets.
  - name: github
    command: npx
    args: ["-y", "@modelcontextprotocol/server-github"]
    env: { GITHUB_PERSONAL_ACCESS_TOKEN: "${GITHUB_TOKEN}" }

The sandbox is Linux with Node.js 22, Python 3.11 (python3), Python 3.12 (python3.12) and uv, plus git, the GitHub CLI (gh), the AWS CLI, gcloud, curl, jq, ripgrep, sqlite3, psql, mysql, redis-cli, ffmpeg and poppler's pdftotext. Install other tools under setup (npm install -g, pip install --user, or a download into ~/.local/bin).

lgr deploy reads the agent's instructions, skills and files for what it needs from your machine, and prints the list (the agent's page shows it under Setup):

  • Tools the sandbox lacks, such as vercel, pandoc, terraform or kubectl, are installed by setup.
  • Logins are copied as project secrets: gh (GH_TOKEN), AWS (a 12-hour session made from your login, never your long-lived keys), gcloud (a 1-hour access token), Vercel (VERCEL_TOKEN) and npm (NPM_TOKEN). Each deploy renews them. A login whose secrets you set yourself is left alone, so for an agent on a schedule, set long-lived credentials of a limited account as secrets. Git over ssh to GitHub goes over https with GH_TOKEN.
  • Things on your machine, such as a service on localhost or a file outside the folder, can't work in the cloud and are flagged.

MCP servers that run as npx -y or uvx packages work as they are; install other Python servers under setup with pip install --user. A server whose command is a path on your machine has to be listed under files and referenced by its path in the folder.

A server you signed in to through the browser in Codex or Claude Code is imported with oauth: true, and the access token your tool holds is copied as its secret, so the agent works as soon as it is deployed. Before each run the token is checked. Once the service rejects it, runs fail, the agent's schedules pause, the project is emailed, and the agent's page shows Reconnect. Reconnecting signs in through the service's own OAuth, after which the platform refreshes the token itself and starts the schedules again. Services that don't let apps sign in this way, such as GitHub, ask for a token instead (for GitHub, a personal access token).

Servers that run on localhost can't be reached from the cloud. Add a hosted URL, or a command the sandbox runs, on the agent's page under Setup → MCP servers and secrets. Each change there saves a new version.

Secrets

Secrets are stored per project, write-only: nothing shows their values after they are set. Set them under Settings → Secrets, or:

lgr secrets set LINEAR_TOKEN CRM_TOKEN --from-env   # from the environment, .env or your Codex config
echo -n "$VALUE" | lgr secrets set STRIPE_KEY       # from stdin

A deploy warns about secrets the agent lists that the project hasn't set.

Calling LagrangeCloud from a run

Every run gets LGR_API_URL and LGR_API_KEY, so an agent can use lgr or the API to deploy, run or check other agents without any setup. The key acts on the run's own project and stops working when the run ends; it cannot create API keys or caller keys. A project secret named LGR_API_URL or LGR_API_KEY that the agent lists takes their place.

Egress

Without egress, the agent can reach any public host. With egress.allow, it can reach only the hosts listed: example.com matches that host, *.example.com its subdomains. The model API, the agent's hosted MCP servers and LagrangeCloud's own API are always allowed, and setup commands may reach any public host. Blocked connections show up as egress blocked lines in the run's log. Private and loopback addresses are never reachable.

Steps

steps splits an agent's work into 2 to 10 steps that run in order, in one sandbox. Each step is its own harness session with the agent's instructions plus its own, on its own model when it sets one. It gets the task and the previous step's reply, and sees the files earlier steps left in the working directory. The last step's reply is the run's result; a failed step ends the run. A step that needs less, such as listing work items, can run on a smaller model than the steps that need more, and the run's trace shows each step with its model, cost and time.

name: pr-review
instructions: ./AGENTS.md        # shared by every step
model: { name: tensorblock/claude-opus-5-5 }
steps:
  - name: triage
    instructions: ./steps/triage.md
    model: { name: tensorblock/claude-sonnet-5-5 }
  - name: act
    instructions: ./steps/act.md

What a run does

Each run on a fresh sandbox:

  1. SkillsUnpacked where the harness loads them
  2. FilesCopied into the working directory
  3. SetupYour setup commands run there
  4. Saved filesThe files the agent's earlier runs wrote are put back
  5. RunMCP servers and the harness start with the message
  6. ResultThe reply, files and trace come back

Files kept between runs

An agent's runs share one set of saved files. When a run ends, the files it wrote or changed in its working directory are saved, and the agent's next run starts with them: a log it adds to, last week's report, notes on what it has already handled. Nothing needs to be set up.

  • Up to 200 MB per agent. A run that leaves more is not saved (its trace says so) and the next run starts from the files saved before.
  • node_modules, .venv, .git and __pycache__ are not saved; setup rebuilds them. Files outside the working directory are not saved either.
  • A file the agent ships with is saved only once a run changes it. After you deploy a new version, that version's file wins over a saved one of the same name.
  • Runs that overlap each keep their own files; when two change the same file, the one that ends last wins.
  • Setup → Files it keeps between runs on the agent's page lists them, and Clear saved files starts the agent over.

Runs on a profile or an instance keep their own disk instead, and a run on a repository checkout saves nothing.

Instances prepare once per version and keep what they were set up with.