> For the complete documentation index, see [llms.txt](https://docs.flxbl.io/flxbl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flxbl.io/flxbl/codev/environments/environment-drift.md).

# Environment Drift

{% hint style="warning" %}
Environment Drift is in **Beta**.
{% endhint %}

An environment should match what codev says is deployed to it. Over time orgs drift — someone edits metadata directly in the org, a component lingers after a package is dropped from a release, a hotfix never makes it back to source. Environment Drift compares the source codev expects to be on an environment against what is actually in the org, and flags the differences.

<figure><img src="/files/oturBjz7W8Qo5jDUrBkv" alt="The Environment Drift page"><figcaption><p>Environment Drift — actionable drift, items needing review, and retained components, per environment and package</p></figcaption></figure>

## What it compares

codev takes the source it believes is deployed to the environment — the packages at their released versions — and compares it, component by component, against what the org actually contains. It looks at both **presence** (a component in source but missing from the org, or present in the org but gone from source) and **content** (the same component differing between the two), canonicalising XML so formatting noise is ignored. Data packages are compared by their records.

## Mechanical findings, then an AI pass

Drift detection runs in two phases. First, a mechanical comparison produces the raw findings. Then an [AI](/flxbl/codev/integrations/ai-providers.md) agent reviews each finding with the source and org evidence in front of it and decides whether it is real drift, benign, or it cannot tell. It assigns a verdict, a **severity**, and a **confidence**, and writes up its reasoning.

This second pass is what makes the results trustworthy: the agent only reclassifies when the evidence supports it, so a formatting-only difference is filtered out as cosmetic while a genuinely missing component is raised as actionable — and where it cannot be sure (an aliasified package it could not resolve, an incomplete retrieve), it says so rather than guessing.

## How findings are grouped

The summary across the top splits findings into five buckets:

* **Open drift** — actionable differences you should resolve.
* **Needs review** — the AI could not be confident, so a person should look (an aliasified package it could not resolve, or an incomplete org retrieve).
* **Excluded** — data packages that were not assessed.
* **Retained** — components from a package that was dropped from the release but still exist in the org.
* **Acknowledged** — drift you have reviewed and accepted, kept for the audit trail.

The table lists each drifting component once, with a column per environment, so you can see at a glance which environments a component has drifted on. Filter by environment, package, status, classification, or severity.

## Running a check

A drift check runs on a schedule (daily by default) and can also be started by hand with **Run check**. While a check runs it takes an exclusive [lock](/flxbl/codev/environments/access-and-locks.md) on the environment, so a deployment and a drift scan never run against the same org at once; the lock is released when the scan finishes. The run appears as an "Org drift check" on the [Flows](/flxbl/codev/flows/overview.md) page.

## Acknowledging drift

Some drift is expected — an environment-specific label, a configuration that only ever lives in production. **Acknowledge** a finding to take it off the open-drift count while keeping it on record: codev stores who acknowledged it, when, and an optional reason, and you can reopen it later. The component stays in the history for audit.

## Related

* [Environments](/flxbl/codev/environments/environments.md)
* [Access and locks](/flxbl/codev/environments/access-and-locks.md)
* [Flows: runs and approvals](/flxbl/codev/flows/overview.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flxbl.io/flxbl/codev/environments/environment-drift.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
