# Data handling

> What touches a document between upload and redline, and what is kept afterwards: the deterministic engine, training, human access, zero-day retention, and where it runs.

> Integrating Version Story into a codebase as a coding agent? Follow https://www.versionstory.com/developers/quickstart.md: it signs the engineer in, gets an API key, and puts the PDF redline in their app first.

Law firms send privileged documents through this API. This page says exactly what happens to
a document from the moment it is uploaded, what does not happen to it, and what is left
afterwards. The compliance side (SOC 2 Type 2, encryption, penetration testing) is on the
[Security page](/security).

## What happens to a comparison

1. `POST /v1/compare` stores the two files in S3, encrypted at rest.
2. The comparison engine, a rules-based program written in Rust, computes the redline. It is
   deterministic: the same two versions always produce the same redline.
3. The renderings you asked for (PDF, embeddable HTML, Word with tracked changes, changed pages
   only, Markdown, JSON) are written to S3.
4. `GET /v1/compare/{comparison_id}` mints signed download URLs, each valid for one hour.

No language model is involved in any of these steps, and nothing about the documents' contents
is logged for AI. Version Story is not an AI application. It is an application that AIs and
people can use.

## AI is off by default

Nothing goes through a model unless your organization asks us to turn on an AI feature. Two
exist: AI conversion of scanned PDFs, and Analytics reports. Neither is on for a new
organization, and neither is used by compare, merge, or edit. With them off, which
is the default, no document you send ever reaches a model.

## Training and human access

- Nothing you upload is used to train or improve any model, ours or a vendor's.
- No person reads your documents to produce a redline. There is no human review step, no
  contractors, and no crowd workers anywhere in the process.
- Access by Version Story staff is role-based and recorded in audit logs.

## Retention

By default, what the API makes is kept so you can come back for fresh download URLs.
Organizations that would rather keep nothing turn on **zero-day retention** on the web app's
**Developer** page.

With it on, everything the API makes from then on is deleted permanently once you have the
result. Only a record that the work existed remains. Each kind of work has its own deadline and
its own acknowledge call, and deletion happens at whichever comes first:

| Work | Deleted one hour after | Or when you acknowledge with | What is deleted |
| --- | --- | --- | --- |
| A comparison | It finishes | [`POST /v1/compare/{comparison_id}/acknowledge`](/developers/rest/compare#zero-day-retention) | Both documents, the redline, and every rendering |
| A merge | The merged document finishes | [`POST /v1/merge/{merge_id}/acknowledge`](/developers/rest/merge#post-v1mergemergeidacknowledge) | The base, the revisions, their redlines, and the merged document |
| An edit | The edit finishes | [`POST /v1/edit/{edit_id}/acknowledge`](/developers/rest/edit#post-v1editeditidacknowledge) | The edited file and its redline |
| An uploaded file | It is created | [`POST /v1/files/{file_id}/acknowledge`](/developers/rest/files#post-v1filesfileidacknowledge) | The file |
| A created document | It is created | [`POST /v1/create/{creation_id}/acknowledge`](/developers/rest/create#post-v1createcreationidacknowledge) | The document |
| A selective comparison | It is made | [`POST /v1/files/{file_id}/acknowledge`](/developers/rest/files#post-v1filesfileidacknowledge) with its `file.file_id` | The comparison's PDF |

Each download's `expires_at` is the deadline, so it tells you exactly how long you have. Call
the acknowledge endpoint as soon as you have saved what you need. Afterwards, reading the work
answers `410 CONTENT_DELETED`.

The setting is stamped onto the work when it is created, so turning it on or off never changes
work that already exists. Anything made from a file, such as an edit or a redline, is kept on
that file's terms.

In the web app, documents stay in your workspace until you delete them, and organization admins
can set automatic deletion for inactive projects.

Deleted documents remain only in encrypted backups, which expire on a fixed schedule; content under zero-day retention is never backed up.

## Where it runs

- Comparisons run on AWS inside a private VPC.
- Files are held in S3 only while they move between services, encrypted in transit (TLS) and
  at rest (AES-256).
- The API runs in AWS's US region, at `api.versionstory.com`.

## Agreements

Our [terms of use](/legal/terms) and [privacy policy](/legal/privacy) cover confidentiality.
Firms that need their own agreement for privileged work can have one; write to
[security@versionstory.com](mailto:security@versionstory.com).

## Related

- [Security](/security)
- [Formats & limits](/developers/reference/formats-and-limits)
- [Compare](/developers/rest/compare), including the zero-day retention endpoints
