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

# Promote to production

> Move an agent from Dry Run through Pilot to Live, and what evidence to check at each gate.

Promotion is a decision, not a default. This guide walks the gates and says what to look at before passing each one.

## Prerequisites

* An agent that has built, conformed, and completed at least one dry run. See [Build your first agent](/guides/build-your-first-agent).
* Real credentials connected for the services it uses. See [Connect a service](/guides/connect-a-service).

<Steps>
  <Step title="Confirm the dry-run evidence">
    ```bash theme={null}
    jstm agent runs failed-payment-digest --mode dry_run
    jstm agent run show failed-payment-digest/runs/3
    ```

    Ask the outcome question, not the execution question. Not "did every story complete?" but "would this have produced the right result?"

    Look for stories that completed but produced nothing, or produced something subtly wrong. A dry run that finishes green while identifying the wrong payments is a failure that looks like a success.
  </Step>

  <Step title="Check readiness once more">
    ```bash theme={null}
    jstm agent readiness failed-payment-digest
    ```

    Dry Run holds side effects back, so it can pass with credentials that would fail against the real service. Readiness checks the dependencies themselves.

    For an extra check against the live service:

    ```bash theme={null}
    jstm connection test stripe --workspace acme-corp/finance
    jstm connection test slack --workspace acme-corp/finance
    ```
  </Step>

  <Step title="Promote to Pilot">
    ```bash theme={null}
    jstm agent pilot failed-payment-digest
    ```

    <Warning>
      Pilot runs with real side effects. The agent will post to Slack and read live Stripe data. The command asks for confirmation.
    </Warning>

    To build and stage in one step, or to pin an exact version:

    ```bash theme={null}
    jstm agent pilot failed-payment-digest --build --version 0.3.0
    ```

    Pilot is deliberately limited — restricted scope, access, volume, or audience. Point it at a test channel, or a single account, before pointing it at everything.
  </Step>

  <Step title="Run under pilot and watch">
    ```bash theme={null}
    jstm agent run failed-payment-digest --input '{"date":"2026-08-03"}' --verbose
    ```

    With the agent staged at Pilot, a plain `run` with no `--mode` runs as pilot. You don't have to repeat the mode.

    Watch this one. A pilot run is the first time the agent changes something outside JoyStream.
  </Step>

  <Step title="Review pilot evidence">
    ```bash theme={null}
    jstm agent runs failed-payment-digest --mode pilot
    jstm ticket list --agent-id failed-payment-digest --mode pilot
    ```

    Give it enough pilot runs to see variation — a day with no failed payments, a day with an unusual one, a day when Stripe is slow. The interesting evidence is in the edge cases, not the happy path.

    Check the tickets for exceptions and escalations. A pilot that never escalated may mean the agent handles everything well, or that it hasn't yet met anything hard.
  </Step>

  <Step title="Promote to Live">
    ```bash theme={null}
    jstm agent live failed-payment-digest
    ```

    This also confirms before proceeding. Add `--yes` to skip the prompt in a script — but only where the decision has already been made by a person.
  </Step>

  <Step title="Set it running">
    Production agents usually run on a schedule or a trigger rather than by hand.

    ```bash theme={null}
    jstm agent installations
    jstm agent schedule set 8c41f2b9-77de-4a30-b0c5-2e1f6a9d4b77 --cron "0 8 * * 1-5" --env live
    ```

    <Warning>
      `--env` defaults to `dry_run` on every `set`. If you later change only the expression, repeat `--env live` or the schedule silently reverts to dry runs.
    </Warning>

    See [Schedule an agent](/guides/schedule-an-agent) and [Trigger an agent](/guides/trigger-an-agent).
  </Step>
</Steps>

## Gating promotion in a script

`jstm agent readiness` exits non-zero when there are blockers, so it composes:

```bash theme={null}
jstm agent readiness failed-payment-digest \
  && jstm agent conform ./failed-payment-digest --fail-on error \
  && jstm agent pilot failed-payment-digest --yes
```

## Rolling back

Promotion is a stage change, not a one-way door. To pull an agent out of production, stage it back down:

```bash theme={null}
jstm agent dry-run failed-payment-digest --no-run
```

`--no-run` stages without firing a run. To stop scheduled execution as well:

```bash theme={null}
jstm agent schedule clear 8c41f2b9-77de-4a30-b0c5-2e1f6a9d4b77
```

To pin a known-good earlier package while you fix a problem:

```bash theme={null}
jstm agent live failed-payment-digest --version 0.2.0 --yes
```

## See also

* [The lifecycle](/concepts/lifecycle) — why the gates exist.
* [Evidence, memory, and metrics](/concepts/evidence-and-memory) — what counts as proof.
