# Data handling

What onshore.sh stores about your organization and your miniVMs, where, and for how long.

Everything below is stored in the EU, on Scaleway. The legal side (controller, processor, your
rights) is in the [Privacy Policy](https://onshore.sh/docs/legal/privacy) and the [DPA](https://onshore.sh/docs/legal/dpa).

## Inside your miniVMs

What your code writes (files, memory, processes, network traffic) stays in the miniVM. We do not
copy it anywhere else, except:

- when you **pause** a miniVM: its disk and memory are saved as a snapshot, encrypted, in object
  storage;
- when you **build a template**: the files you send are deleted within 7 days of the build; the
  recipe (including any environment values written in it) and the resulting image stay with the
  template version;
- during an **abuse investigation**, the evidence needed to confirm and stop the abuse (see the
  [Acceptable Use Policy](https://onshore.sh/docs/legal/acceptable-use)).

Agent runs keep their prompts, messages, results and artifacts inside the miniVM. Our API stores
only their ids, states, counters, labels and event cursors. A run you start with the
`github-pr-comment` sink posts its state and summary as a comment on the pull requests it opened,
in your own repositories: we keep no copy, and the comment lives in your GitHub account.

## How long we keep it

| Data                                                                                          | Kept                                                                                                                                                                                |
| --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A running miniVM                                                                              | Until it is killed or reaches its timeout                                                                                                                                           |
| A paused miniVM (snapshot of its disk and memory)                                             | 30 days after the pause, then it is deleted                                                                                                                                         |
| Metadata of ended miniVMs (template, size, times, end reason, name, labels, metadata you set) | 90 days after the miniVM ended                                                                                                                                                      |
| Resource metrics of a miniVM                                                                  | 7 days                                                                                                                                                                              |
| Agent run records (ids, states, counters, labels)                                             | 90 days after the run ended                                                                                                                                                         |
| Agent run events                                                                              | 30 days                                                                                                                                                                             |
| Egress requests from your miniVMs (requested names and reason, who decided)                   | 30 days                                                                                                                                                                             |
| Secret requests from your miniVMs (the secret's name, the reason, who decided; never a value) | 30 days                                                                                                                                                                             |
| Refused egress names and miniVM events                                                        | 30 days                                                                                                                                                                             |
| Egress changes (who changed which names on which miniVM)                                      | 90 days                                                                                                                                                                             |
| Egress auto-approve rules                                                                     | Until you remove them, or your organization is deleted                                                                                                                              |
| Webhook endpoints (URL and signing secret)                                                    | Until you delete the endpoint, or your organization is deleted                                                                                                                      |
| Webhook deliveries (event, status, attempts, never the body)                                  | 30 days                                                                                                                                                                             |
| Daily AI-account usage counts                                                                 | 90 days                                                                                                                                                                             |
| Template build logs                                                                           | 30 days                                                                                                                                                                             |
| A replaced template version                                                                   | 90 days after it was replaced, once nothing uses it                                                                                                                                 |
| Deletion receipts and usage records                                                           | As long as your organization exists                                                                                                                                                 |
| Billing records (credits, top-ups, invoices)                                                  | 10 years after your organization is deleted, as accounting law requires                                                                                                             |
| AI-account connections (email, plan, encrypted credential)                                    | Until you remove the connection, then 30 days                                                                                                                                       |
| Abuse signals (counters and decisions, never content)                                         | 365 days                                                                                                                                                                            |
| Abuse evidence collected during an investigation                                              | Up to 90 days, longer only when needed for a legal claim or required by law                                                                                                         |
| Security audit records (who did what, ids only, no content)                                   | 90 days                                                                                                                                                                             |
| Anthropic's copy of the alerts it triages                                                     | 30 days (up to 2 years for content its safety systems flag), under its consumer terms. See [Privacy §3.13](https://onshore.sh/docs/legal/privacy#313-the-ai-model-we-use-anthropic) |
| Service logs                                                                                  | 30 days (90 days for the AI-account service). They are designed to hold ids, request types and truncated client IP addresses, never content _(planned)_                             |
| Database backups                                                                              | 7 days                                                                                                                                                                              |

## Deleting things

- **Kill a miniVM** to stop it and delete it: its processes stop, then its disk copy, snapshots,
  network state and limits are removed, and we record a deletion receipt listing each step
  _(planned: the end-to-end test of this has not passed yet)_.
- **Delete a template** to remove its versions once no miniVM uses them.
- **Delete your organization** (write to <support@onshore.sh>) to delete
  every miniVM, template, key, invitation and usage record it holds. What remains: billing records
  (10 years, as the law requires), security audit records without content (up to 90 days), anonymous
  ids, keyed hashes of the email addresses and cards that already received a welcome credit (10 years, to give it once per person and per card), and logs and backups until they expire. Your members'
  user accounts are kept; each member can ask us to delete theirs.

## What you send us when you create a miniVM

The template, resources, metadata and egress allow list you pass when you create a miniVM are stored
with it, for as long as its metadata is kept (see above). Environment variable values are not
stored: they pass through our service and are kept only while the miniVM runs. The values of
[egress credentials](https://onshore.sh/docs/guides/egress#after-a-pause) are kept, while a miniVM is paused, only inside
its encrypted pause snapshot, and deleted with it. Secret files you give a running miniVM (`ons secret provide`) are not
stored by our service: they go straight to the miniVM and live in its memory. Do not put secrets in
metadata or labels. Prefer template secrets or keys injected at egress over environment
variables for credentials.

Markdown version: https://onshore.sh/docs/security/data-handling.md
