
S3 WORM storage is Amazon S3 Object Lock: a write-once-read-many setting that stops an object version from being deleted or overwritten until its retention date passes. In compliance mode, AWS says no user can remove it, not even the root user. That is why backup teams use it against ransomware.
TL;DR:
Updated Oct 28, 2026: definition-first opening, question headings, a labelled diagram of the three protection types, and a new section on how AIOZ Storage handles deletes.
WORM means write once, read many: you can read the data as often as you like, but nobody can change or remove it for a set period. On Amazon S3 the WORM feature is called Object Lock, and AWS says it works with versioning "to prevent locked object versions from being permanently deleted (accidental or intentional) or overwritten."
The words "accidental or intentional" matter. A permissions policy stops honest mistakes, but anyone who controls the account can rewrite it. Object Lock is enforced by S3 itself, so even an attacker with valid admin credentials can't remove a locked version early. If your threat model includes a stolen root key, that difference is the reason to use it.
Object lock isn't a separate switch bolted onto a bucket. AWS puts it plainly: "With S3 Object Lock, S3 Versioning is automatically enabled, and these features work together to prevent locked object versions from being permanently deleted."
The dependency makes sense once you see what gets protected: object lock doesn't stop you from writing a new version of a key. It protects one existing version, which only means something when several versions of a key can sit side by side. If that model is new to you, how S3 object versioning works covers version IDs and delete markers.
Compliance mode leaves no exception. In AWS's words, "A protected object version can't be overwritten or deleted by any user, including the root user in your AWS account." Once it's set, "you cannot change the retention mode, and you cannot shorten the retention period." AWS adds one blunt note: the only way to delete an object under compliance mode before its retention date is to delete the associated AWS account.
Governance mode gives the same day-to-day protection: "users can't overwrite or delete an object version or alter its lock settings unless they have special permissions." The difference is a deliberate escape hatch, since "you can still grant some users permission to alter the retention settings or delete the object if necessary."
So choose by who you need to stop: compliance mode is for rules that must hold against every insider, and regulatory retention is the standard case. Governance mode fits data that needs strong protection plus a documented, permissioned way to fix a mistake.

Object lock has a second, independent mechanism. AWS says "a legal hold remains in place until you explicitly remove it," and "legal holds are independent from retention periods." A retention period is a countdown with a known end date, while a legal hold has no end date until someone with permission lifts it. That suits open-ended situations like active litigation, where you can't know in advance when the protection should stop.
You have to enable Object Lock on a bucket before any object in it can be locked, and versioning must be on too. On a new bucket it takes one flag:
aws s3api create-bucket --bucket my-locked-bucket --object-lock-enabled-for-bucketFor an existing versioned bucket, you enable it with put-object-lock-configuration, which can also set a default retention rule in the same call. AWS's example sets a 50-day compliance default:
aws s3api put-object-lock-configuration --bucket my-locked-bucket \
--object-lock-configuration '{ "ObjectLockEnabled": "Enabled", "Rule": { "DefaultRetention": { "Mode": "COMPLIANCE", "Days": 50 }}}'Read AWS's warning before you run either one: "After you enable Object Lock on a bucket, you can't disable Object Lock or suspend versioning for that bucket." The console makes you acknowledge that enabling it "will permanently allow objects in this bucket to be locked." One more restriction is easy to miss. A bucket with Object Lock can't be the destination for server access logs, so keep your logs in a separate bucket, as S3 server access logging vs CloudTrail explains.
A retention period belongs to one object version, not to a key and not to the whole bucket. That has a few consequences you should plan for:
s3:PutObjectRetention can do this.Setting retention on a specific version looks like this:
aws s3api put-object-retention --bucket my-locked-bucket --key my-image.fs \
--retention '{ "Mode": "GOVERNANCE", "RetainUntilDate": "2027-01-01T00:00:00" }'Fixed retention is the classic type: you give a retain-until date up front. AWS's documentation now describes a second type, variable retention, which defers that decision. You turn on an event hold and set a duration, and the object stays protected while the hold is on. When you release the hold, S3 sets the retain-until date to the release time plus the duration.
While the hold is active, the date keeps moving: AWS describes it as the current time plus the duration. Two safeguards stop anyone from weakening it. Decreasing the duration never sets an earlier date than the current one. You can also add an explicit minimum retain-until date, so the object stays protected until at least then even if the hold ends sooner. Durations run from 1 to 36,500 days, or 1 to 100 years.
AWS's CLI example sets a compliance-mode event hold with a 30-day duration:
aws s3api put-object-retention --bucket my-locked-bucket --key my-document.pdf \
--retention '{"Mode":"COMPLIANCE","EventHold":"ON","EventHoldDuration":{"Days":30}}'To release it later, you send EventHold: OFF in the same call. Variable retention fits deadlines tied to a business event rather than a calendar date, such as contract completion, account closure or a resolved claim. AWS also suggests it for a configurable recovery window against ransomware or accidental deletion.
It depends on how you send the delete, and the result isn't always the error people expect:
| Request | Result |
|---|---|
Permanent DELETE naming a version ID | 403 Forbidden (Access Denied) |
Simple DELETE with no version ID | 200 OK, and S3 inserts a delete marker as the new current version |
PUT of the same key | Succeeds and creates a new version; the protected version stays locked |
The second row surprises most people. AWS says retention periods and legal holds "don't prevent new versions of the object from being created, or delete markers to be added on top of the object." A simple delete hides the object from ordinary listings, but the locked version underneath is untouched, and you can still recover it by version ID. So a locked bucket can look empty to an application that only reads current versions.
To override governance mode, you need two things at once: the s3:BypassGovernanceRetention permission and the x-amz-bypass-governance-retention:true request header. AWS notes that the S3 console sends that header by default, so a user with the permission can delete governance-locked objects straight from the console. Compliance mode has no bypass for any user.
Object Lock operations are separate S3 actions, so you can split who may do what. AWS lists seven:
s3:PutBucketObjectLockConfiguration and s3:GetBucketObjectLockConfiguration for the bucket settings3:PutObjectRetention and s3:GetObjectRetention for retentions3:PutObjectLegalHold and s3:GetObjectLegalHold for legal holdss3:BypassGovernanceRetention for overriding governance modeAWS says legal holds "can be freely placed and removed by any user who has the s3:PutObjectLegalHold permission." Grant that action narrowly, and check the policy evaluation rules that decide how it combines with your other policies.
AWS's own guidance maps each option to a situation:
| If you need... | Use |
|---|---|
| Protection from most users, with a permissioned way for some to make exceptions | Governance mode |
| Nobody, including the root user, able to delete during the period | Compliance mode |
| Immutability with no known end date, such as an upcoming audit or an ongoing project | Legal hold |
| Protection whose end date depends on a future event | Variable retention |
You can combine legal holds and retention. If a retention period expires while a legal hold is on, the object stays protected until the hold is removed, and removing a hold doesn't shorten a retention period that's still running. For regulated environments, AWS notes that S3 Object Lock "has been assessed by Cohasset Associates for use in environments that are subject to SEC 17a-4, CFTC, and FINRA regulations."
Modern ransomware goes after backups as well as production data. A backup that is a separate copy but still writable from a compromised environment can be encrypted or deleted along with the original. That is why the 3-2-1-1-0 backup rule asks for one copy that is offline or immutable.
Compliance mode answers that threat directly. An attacker holding valid root credentials still can't delete or overwrite a locked version before its retention period ends. A permissions-only defense can't promise that, because permissions are exactly what a stolen credential already has.
AIOZ Storage is S3-compatible, but it doesn't offer object lock or versioning today. Object lock depends on versioning, so the missing versioning also rules out object lock. Here is what AIOZ Storage does offer that touches the same problem:
Grants are still permissions, though, so they carry the weakness described above: whoever controls the account can issue a new grant with Delete. A quick way to confirm your copies are still there is the listing command from the AIOZ CLI guide, run with a read-and-list grant:
aws s3 --endpoint-url https://s3.aiozstorage.network ls s3://bucket-nameWhat the docs don't cover yet (all concept, tutorial and SDK pages read Oct 28, 2026):
If a regulation or your ransomware plan needs compliance-mode retention, keep that copy with a provider that documents object lock, and use AIOZ Storage for copies that don't need it. To scope a grant to only the permissions a job needs, follow the Manage Access Grants guide.
What is S3 WORM storage?
It is Amazon S3 Object Lock, a write-once-read-many feature. It blocks a specific object version from being deleted or overwritten for a set retention period, and S3 enforces it rather than a permissions policy.
What's the difference between compliance mode and governance mode?
In compliance mode, no user, including the root account, can delete the version, overwrite it or shorten its retention. Governance mode gives the same daily protection but lets users with s3:BypassGovernanceRetention make exceptions.
Does object lock require versioning?
Yes. AWS enables S3 Versioning automatically with Object Lock, because the lock protects one specific version of an object.
What is a legal hold, and how is it different from a retention period?
A retention period has an end date and expires on its own. A legal hold has no end date and stays until someone with s3:PutObjectLegalHold removes it.
Can I turn off Object Lock after enabling it on a bucket?
No. AWS states that once Object Lock is on, you can't disable it or suspend versioning for that bucket.
What happens if I delete a locked object without a version ID?
S3 returns 200 OK and adds a delete marker as the current version. The locked version underneath stays. A permanent delete that names the version ID returns 403 Forbidden.
Can I extend or shorten an Object Lock retention period?
You can always extend it with a later retain-until date. In compliance mode you can't shorten it or change the mode; in governance mode, users with the bypass permission can, if they send the bypass header.
What is variable retention in S3 Object Lock?
A retention type that uses an event hold and a duration instead of a fixed date. When you release the hold, S3 sets the retain-until date to the release time plus the duration.
Is there any way to delete an object under compliance mode before it expires?
According to AWS, the only way is to delete the associated AWS account.
Does AIOZ Storage support object lock?
No. AIOZ Storage doesn't offer versioning or object lock as of Oct 28, 2026. It protects objects with erasure coding and lets you limit each access grant's permissions, but neither makes data immutable.

Distributed storage keeps data on many independent nodes that act as one system. See how it works, replication vs erasure coding, its types and trade-offs.

Egress fees are charges for data leaving a storage provider's network. See what triggers them, how to estimate them, and what AIOZ Storage's docs say.

An object storage vector database keeps vectors in the storage layer, not a cluster. See how it differs, when to pick it, and where AIOZ Storage fits in.

AIOZ Storage vector database pricing line by line: upload, storage, queries, data searched and data returned, with a worked monthly example you can reuse.

Create a bucket and upload a file on AIOZ Storage in five steps: sign up, set a passphrase, add credits, and upload. Plus what the passphrase cannot recover.

The AIOZ Storage rate limit is 100 requests per second. See what the docs do and don't say, and how to stay under it with boto3 retries and a limiter.