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

# Detect drift between declared and live environments

> Check that an environment runs the release it should, and find what your checkout declares but never deployed, with env status, env diff and env verify.

Drift is the gap between what an environment should run and what it does run. It has two directions: the platform runs something other than the release you promoted, or your `deploy/kcl/` declares something nobody has deployed yet. Forge answers each with one read-only command, and a third for workloads that something other than forge deploys.

Forge can answer these without logging in to a cluster because every release records the digests it pins and every deploy records the shape it applied ([What gets deployed](https://docs.reliantlabs.io/forge/deploy/what-gets-deployed.md)).

## Before you begin

* A deployed environment. [Deploy a Go API with managed Postgres](https://docs.reliantlabs.io/guides/hosting/deploy-go-api-managed-postgres.md) creates one on Reliant hosting.
* Forge v1.6.1 or later (`reliant forge --version` inside the project).

**1. Check the environment runs its release**

`env status` compares the images the platform serves with the digests of the release the environment is promoted to:

```bash terminal theme={null}
reliant forge env status prod
```

```text theme={null}
Verifying environment prod against release v9.9.1 (1 image(s))
  promoted 2026-11-20T16:59:47Z (promote time, NOT deploy time — that gap is what this command checks)
  source   control-plane observer (forge cannot read a hosted env's cluster)

  MATCH        registry.reliantapi.com/<org-id>/shop/shop
  MATCH        registry.reliantapi.com/<org-id>/shop/shop

2 match, 0 drifted, 0 missing, 0 untagged, 0 unreachable
```

`DRIFTED` means a different image is running than the release pins, and `MISSING` means a pinned image isn't running at all. `UNREACHABLE` with `UserSuspended` is an environment someone [stopped](https://docs.reliantlabs.io/guides/hosting/stop-hosted-environment.md).

**2. Find what your checkout declares but nobody deployed**

`env diff` renders this checkout and compares it, object by object, with the bundle the last deploy recorded. Here someone added a `worker` workload to `deploy/kcl/prod/main.k` and never deployed it:

```bash terminal theme={null}
reliant forge env diff prod
```

```text theme={null}
diff of /home/you/shop against live
  (Helm chart objects are not compared; pass --charts to template them)

prod: ok
  objects: 1 added, 0 removed, 2 changed
    api: config changed
    migrate: config changed
  + workload worker
```

It also reports removed objects, image changes, runtime and cluster moves, secrets newly needed and domain changes. Nothing is built, pushed or contacted. `prod: ok` is the render's status; `error`, `impure` or `stale` means the comparison didn't happen, and is never reported as "no changes". Use `--all` to diff every environment.

> [!NOTE]
>
> A deploy records each workload's release version in its telemetry attributes, and a render of your checkout doesn't carry one. So right after a release deploy, every workload reads `config changed`. Read the added, removed and image lines, and confirm what runs with `env status`.

**3. Fail a CI job on undeployed changes**

`env diff` exits `0` whatever it finds, so read its JSON:

```bash terminal theme={null}
reliant forge env diff prod --json | jq -c '.environments[] | {env, status, added: .diff.workloads_added}'
```

```text theme={null}
{"env":"prod","status":"ok","added":["worker"]}
```

A gate can be `jq -e` over the same document, failing when `status` isn't `ok` or `diff.added` or `diff.removed` is non-empty.

**4. Verify workloads forge doesn't run**

For a workload on [your own cluster](https://docs.reliantlabs.io/guides/hosting/deploy-to-your-own-kubernetes.md) or under [your own deploy tool](https://docs.reliantlabs.io/guides/hosting/keep-helm-fly-cloud-run.md), `env verify` checks the running image and config per workload:

```bash terminal theme={null}
reliant forge env verify prod
```

It exits `0` when every workload matches, `1` on drift, and `2` when something couldn't be checked. Hosted workloads are read by `env status`, so on a hosted environment `env verify` reports them `UNVERIFIED` and names `env status`:

```text theme={null}
WORKLOAD  RUNTIME  IMAGE       CONFIG      RESULT
migrate   hosted   unverified  unverified  UNVERIFIED
api       hosted   unverified  unverified  UNVERIFIED

api:
  image  unverified: forge.OnHosted: the control plane runs it; `forge env status prod` reads it through its observer
```

## What this does not do

* **It doesn't fix drift.** All three commands only read. To converge, deploy: `reliant forge env deploy prod` ships the checkout, and naming the version the environment already runs redeploys it. See [Releases and promotion](https://docs.reliantlabs.io/forge/deploy/releases-and-promotion.md).
* **It doesn't watch.** Nothing runs these checks on a schedule or alerts on drift. Run them by hand or from CI.
* **Helm charts aren't compared by default.** Templating them needs `helm` and the network; pass `--charts` to include them.

## Next steps

> [card] [Keep Helm, Fly.io or Cloud Run](https://docs.reliantlabs.io/guides/hosting/keep-helm-fly-cloud-run.md)
>
> Verify workloads your own tooling deploys.

> [card] [Recover from a bad deploy](https://docs.reliantlabs.io/guides/hosting/recover-from-bad-deploy.md)
>
> Put an environment back on an earlier release.

> [card] [Environments](https://docs.reliantlabs.io/forge/deploy/environments.md)
>
> How each environment binds its workloads.

> [card] [env diff reference](https://docs.reliantlabs.io/reference/cli.md#reliant-forge-env-diff)
>
> Every flag of `env diff`, `env verify` and `env status`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.