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

# Maximum environment lifetime

> Set a maximum age for environments and optionally block restarting expired ones.

Set a maximum age for new environments. Environments that exceed this limit become non-compliant. Useful when:

* Enforcing security policies that require fresh environments (e.g., after a supply chain incident)
* Ensuring developers work with up-to-date base images and dependencies
* Meeting compliance requirements for environment rotation

Two controls available:

* **Maximum lifetime**: How long an environment can exist before it becomes non-compliant
* **Strict enforcement**: Whether non-compliant environments are blocked from restarting

## Configuration

Go to **Settings → Organization → Policies**. Select a duration from the dropdown. Only administrators can change this setting.

Available durations: 1 day, 3 days, 1 week, 2 weeks, 1 month, 3 months, 6 months, or no maximum.

Changes apply to new environments only. Existing environments keep their current lifetime.

### Strict enforcement

When a lifetime is set, you can enable **strict enforcement** to prevent users from restarting non-compliant environments.

<img src="https://mintcdn.com/gitpod-13c83c2b/ldXXainnNG3EEifA/images/docs/flex/organizations/max-environment-lifetime-policy.png?fit=max&auto=format&n=ldXXainnNG3EEifA&q=85&s=011d48e0bb963579fb84932ffb84a0df" alt="Maximum environment lifetime policy with strict enforcement enabled" width="2240" height="960" data-path="images/docs/flex/organizations/max-environment-lifetime-policy.png" />

| Strict enforcement | Behavior                                                                                       |
| ------------------ | ---------------------------------------------------------------------------------------------- |
| **Off** (default)  | Users see a warning when starting a non-compliant environment but can choose to restart anyway |
| **On**             | Non-compliant environments are blocked from restarting. Users must create a new environment.   |

The compliance banner shows how many environments are currently non-compliant and how many will become non-compliant within 24 hours. Click **Review environments** to open the environment inventory filtered to exceeded environments.

## Effect on users

Non-compliant environments display a status banner on the environment details page.

<img src="https://mintcdn.com/gitpod-13c83c2b/ldXXainnNG3EEifA/images/docs/flex/organizations/max-environment-lifetime-status.png?fit=max&auto=format&n=ldXXainnNG3EEifA&q=85&s=a55c618bbaf77226438504359b401049" alt="Non-compliant environment status banner on the details page" width="1924" height="562" data-path="images/docs/flex/organizations/max-environment-lifetime-status.png" />

When an environment exceeds its lifetime and strict enforcement is off, users see a warning with the option to restart anyway or create a new environment.

When strict enforcement is on, users cannot restart a non-compliant environment. The modal shows the policy details and offers creating a new environment. Users can copy the details to share with an administrator for requesting an extension.

<img src="https://mintcdn.com/gitpod-13c83c2b/ldXXainnNG3EEifA/images/docs/flex/organizations/max-environment-lifetime-blocked-modal.png?fit=max&auto=format&n=ldXXainnNG3EEifA&q=85&s=4ebd2ef3c8fcce072d747d32d5f705ee" alt="Environment Lifetime Exceeded modal with strict enforcement" width="1112" height="1164" data-path="images/docs/flex/organizations/max-environment-lifetime-blocked-modal.png" />

## Managing environments

Administrators can review and manage environment lifetimes from **Settings → Environments**.

The inventory shows each environment's lifetime expiry and compliance status. Use the **Exceeded** filter to find non-compliant environments.

<img src="https://mintcdn.com/gitpod-13c83c2b/ldXXainnNG3EEifA/images/docs/flex/organizations/max-environment-lifetime-inventory.png?fit=max&auto=format&n=ldXXainnNG3EEifA&q=85&s=6c2634b63fafe04017719e47a0cf7207" alt="Environment inventory with lifetime column showing exceeded environments" width="4744" height="1266" data-path="images/docs/flex/organizations/max-environment-lifetime-inventory.png" />

To extend an individual environment's lifetime, click the **⋯** menu on an environment row and select **Update lifetime**.

<img src="https://mintcdn.com/gitpod-13c83c2b/ldXXainnNG3EEifA/images/docs/flex/organizations/max-environment-lifetime-update.png?fit=max&auto=format&n=ldXXainnNG3EEifA&q=85&s=ab98bea852af3d0993463df9d2d93ef0" alt="Update environment lifetime modal" width="1418" height="1014" data-path="images/docs/flex/organizations/max-environment-lifetime-update.png" />

You can extend or set a specific expiry date. Bulk updates are also available by selecting multiple environments.

## How it works

When an administrator sets a maximum lifetime:

1. **New environments** receive a lockdown timestamp equal to creation time plus the configured duration
2. **Existing environments** are not affected. They keep their current lifetime (or have none).
3. When an environment passes its lockdown timestamp, it becomes non-compliant
4. Depending on strict enforcement, restarting is either warned or blocked

<Note>The lockdown timestamp is set once at environment creation. Changing the policy duration only affects environments created after the change.</Note>
