Deploy a production agent from any model with a single command. This guide covers the full config schema, the deploy step itself, staging vs. production environments, and how to verify your agent is live and behaving correctly.

Prerequisites

  • A Sublayr API key

  • The CLI or SDK installed

  • At least one connected tool (optional, but typical for most agents)

The full config schema

An agent config is a YAML file describing everything about how the agent should run:

Field

Type

Required

Description

name

string

Yes

A unique, human-readable identifier for the agent

model

string

Yes

The primary model to deploy on

fallback

string

No

Model to reroute to if the primary degrades or times out

tools

array

No

Connected tools this agent is allowed to call

approvals

array

No

Conditions that trigger a human approval step before an action executes

budget

string

No

Monthly spend cap, e.g. 500/mo

environment

string

No

staging or production; defaults to staging

Example: a full config

name: refund-agent
model: anthropic/claude
fallback: openai/gpt-4o
tools:
  - stripe
  - postgres
approvals:
  - action: refund
    condition: "amount > 100"
    approver: finance-team
budget: 300/mo
environment: staging
name: refund-agent
model: anthropic/claude
fallback: openai/gpt-4o
tools:
  - stripe
  - postgres
approvals:
  - action: refund
    condition: "amount > 100"
    approver: finance-team
budget: 300/mo
environment: staging
name: refund-agent
model: anthropic/claude
fallback: openai/gpt-4o
tools:
  - stripe
  - postgres
approvals:
  - action: refund
    condition: "amount > 100"
    approver: finance-team
budget: 300/mo
environment: staging

Deploying to staging first

We strongly recommend deploying to staging before production. Staging uses the same runtime and observability as production, but is isolated from real customer data and doesn't count against your production run quota.

sublayr deploy --config agent.yaml --env staging
sublayr deploy --config agent.yaml --env staging
sublayr deploy --config agent.yaml --env staging

Test the agent thoroughly in staging — trigger its typical actions, confirm approvals route correctly, and check traces for anything unexpected.

Promoting to production

Once you're confident, promote the exact same config to production:

sublayr deploy --config agent.yaml --env production
sublayr deploy --config agent.yaml --env production
sublayr deploy --config agent.yaml --env production

This does not require rewriting anything — the same build that ran in staging is promoted as-is, so there's no risk of environment drift between what you tested and what goes live.

Verifying deployment

Check the agent's status:

sublayr agents status agt_4b81
sublayr agents status agt_4b81
sublayr agents status agt_4b81

This returns current status (deploying, live, paused, or failed), uptime, the model and fallback in use, and a summary of the last 10 runs.

Common deployment errors

Error

Cause

Fix

400 invalid_config

Malformed YAML or missing required field

Validate with sublayr validate --config agent.yaml before deploying

401 unauthorized

Missing or invalid API key

Confirm SUBLAYR_API_KEY is set correctly

429 rate_limited

Too many deploys in a short window

Wait and retry, or contact support to raise your limit

Next steps

Once your agent is live, set up traces and alerts under Observability, and configure a rollback plan under Versioning.

Teal gradient background

TRUSTED BY 200+ AI TEAMS

Ship your agents to production.

Book a 30-minute demo, or start in the docs. No infrastructure required.

Teal gradient background

TRUSTED BY 200+ AI TEAMS

Ship your agents to production.

Book a 30-minute demo, or start in the docs. No infrastructure required.

Teal gradient background

TRUSTED BY 200+ AI TEAMS

Ship your agents to production.

Book a 30-minute demo, or start in the docs. No infrastructure required.

Create a free website with Framer, the website builder loved by startups, designers and agencies.