> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.zata.prathamchopde.site/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.zata.prathamchopde.site/_mcp/server.

# Compliance mode

A version locked in Compliance mode cannot be overwritten or deleted by anyone until its retain-until date: not by sub-users, not by the account owner and not by Zata support. The lock can be made longer, but never shorter.

> **Warning**
>
> A Compliance lock cannot be undone. Check the number of days twice, and try your setup in [Governance mode](/buckets/object-lock/governance-mode) first.

To set a Compliance lock, choose **Compliance** as the mode in a [default retention](/buckets/object-lock/overview#set-a-default-retention), when you [lock existing versions](/buckets/object-lock/overview#lock-existing-versions) or when you [lock one version](/buckets/object-lock/overview#lock-or-change-one-version). How far ahead you can lock depends on your account: see [How long you can lock files](/buckets/object-lock/overview#how-long-you-can-lock-files).

## What you can and cannot do

| Action                                                            | Allowed?                                                     |
| ----------------------------------------------------------------- | ------------------------------------------------------------ |
| Download the version                                              | Yes                                                          |
| Overwrite the file                                                | Yes, but it creates a new version. The locked version stays. |
| Make the lock longer                                              | Yes                                                          |
| Make the lock shorter or remove it                                | No, nobody can                                               |
| Change the version to Governance                                  | No                                                           |
| Delete the version before the date                                | No, nobody can                                               |
| Put a [legal hold](/buckets/object-lock/legal-hold) on it as well | Yes                                                          |

You can see a version's lock and its end date in **Lock Settings** (turn on **Show Versions**, then open the version's **⋮** menu).

![Version Details showing a COMPLIANCE retention, its expiration date and the days left](/_fern-img/24e9be53cd7a0948a17e2c6a6b2957938f545dd07af6d1440982b06025585c55.webp)

If you try to delete the version, the console shows **Compliance Lock Active** with the end date, and only lets you close the window.

![The Compliance Lock Active window saying the version cannot be deleted until its retention period is over](/_fern-img/a8dbbec33e4be530a0a306a542e9f756896a63b784a74b9dbb67faef671102be.webp)

When the date has passed, the version is no longer locked. You can delete it, or lock it again.

## Lock a file with the AWS CLI

```bash
aws s3api put-object-retention --bucket my-locked-bucket --key myfile.txt \
  --retention "Mode=COMPLIANCE,RetainUntilDate=2026-12-31T00:00:00Z" --profile zata
```

The console limits how far ahead you can lock; commands sent with S3 tools are not limited this way. A lock does not keep data beyond the life of your account: if your plan ends and is not renewed, the data is deleted as described in [Billing](/account/billing), locked or not.