If your SaaS keeps customer documents in S3, you can now record on each file whether it holds personal data, which retention policy it falls under and which Region it has to live in, without running another database. I would start with one governance annotation per object and one Athena query, and leave permissions and deletions where they are.
What it is
S3 annotations launched in June 2026. They are named blocks of text attached to a specific version of an object. Each object takes up to 1,000 annotations, each between 1 byte and 1 MiB, in whatever format you like: JSON, YAML, XML or plain text. They have their own API to write, read and delete them, without re-uploading the file and without changing its ETag (the fingerprint S3 uses to tell whether the content changed).
Until now you had two places for that context, and both fall short. Object tags are 10 key-value pairs of up to 256 characters. User metadata is fixed at upload and capped at 2 KB. So most teams end up with a side table in DynamoDB or Postgres that says “this PDF is a contract, it has an ID number and it goes in 2033”, and that table drifts the moment someone copies or replicates the file.
On 26 October, the AWS Architecture Blog showed how to use them for data governance: classification, retention, jurisdiction, residency and an inventory of personal data. Three details matter most for a small team:
- They travel with the object.
CopyObjectcopies them by default, and cross-Region replication does too once the role has the annotation permissions. - You can read them while the file sits in Glacier. You check an archived object’s context without restoring it.
- You can query them at scale. If you turn on the S3 Metadata annotation table, S3 keeps an Iceberg table you can query with Athena. It refreshes within about an hour, so it is not real time.
How to use it
- Define a small, versioned schema. One annotation named, say,
governance-context, holding JSON like this (trimmed from the AWS example):
{
"schema_version": "1.0",
"classification": "confidential",
"retention": { "policy": "contracts-7y", "status": "active", "expires_on": "2033-06-01" },
"data_residency": "eu-west-1",
"pii": { "present": true, "categories": ["name", "email", "national_id"] },
"review_required": true
}
- Write it after the upload. You can’t send annotations with
PutObject; they go in a separate call:
aws s3api put-object-annotation \
--bucket my-customer-bucket \
--key tenant-42/contracts/2026-06-01.pdf \
--annotation-name governance-context \
--annotation-payload ./governance.json
To make sure you annotate the version you read, and not one someone overwrote in the meantime, add --object-if-match with the ETag.
-
Backfill what you already have. For existing objects, AWS suggests S3 Batch Operations invoking a Lambda function that writes the annotation. For new ones, an EventBridge rule on upload. In their reference architecture that Lambda calls a Bedrock agent that classifies the document.
-
Ask in SQL. With the annotation table on, the query behind an audit or a GDPR request looks like this:
SELECT object_key, object_version_id
FROM annotation_table
WHERE name = 'governance-context'
AND json_extract_scalar(text_value, '$.pii.present') = 'true'
AND json_extract_scalar(text_value, '$.retention.status') = 'expired';
That returns the files with personal data whose retention has already run out. The real table name depends on your S3 Metadata setup.
Where it stops
This is the part I care about most, because it decides what the feature is for:
- It doesn’t control access. You can’t use an annotation value in an IAM condition. If a policy has to depend on a label, that is still a job for object tags.
- It doesn’t drive lifecycle. Lifecycle rules don’t read annotations. A JSON that says
expireddeletes nothing. - Delete doesn’t mean gone. In a versioned bucket, a DELETE without a version ID adds a delete marker, and the previous version stays, annotations included. For the right to be forgotten you delete version by version.
- There is no history. Overwriting or deleting an annotation can’t be undone. AWS recommends subscribing to the
s3:ObjectAnnotation:Putands3:ObjectAnnotation:Deleteevents, or using the S3 Metadata journal table, to keep a trail. - Object Lock freezes it. While retention is active you can’t write or delete annotations. Annotate before you lock.
- No SSE-C. If you encrypt with customer-provided keys, S3 returns an error.
It also costs extra: annotation storage is billed at S3 Standard rates even when the object is in Glacier, every write and read is a request, and the metadata table and Athena queries are billed separately. Check the S3 pricing page before annotating millions of objects.
My take
I would use it for the personal data inventory of a SaaS that stores customer documents, and not to control who can see them. That is the question that takes longest to answer when an audit arrives or a customer asks for their data: which files hold personal information, whose, and how long you must keep them. Having the answer attached to the file, travelling with its copies and queryable in SQL, removes one table to maintain and one place to get it wrong.
What I wouldn’t do is let an agent decide what gets deleted. The AWS post itself recommends a review_required field and human approval before any irreversible action, and I agree: a model that wrongly tags a contract as expired costs you far more than the time it saves. The agent proposes; a person approves.
For a small team, my order would be: one annotation per object, a schema with schema_version so you can change it later, delete events wired to a log, and one saved Athena query. The rest can wait until someone asks for it.
Sources
- AWS Architecture Blog: Data governance with annotations in Amazon S3
- Amazon S3 documentation: Annotating your objects
- AWS News Blog: Amazon S3 Annotations
If you want to see how I design SaaS on AWS with a small team and many agents, follow me on LinkedIn.
