Skip to content

Data handling

Sandboxes store files, processes, and memory while your code runs. This page explains what data they retain, when it's deleted, and what Keln records.

Keln's zero data retention policy applies to prompts and completions on the inference API. It doesn't cover sandboxes, which retain data so your code can run and resume.

What a sandbox stores

A sandbox keeps the files, installed packages, running processes, and memory used by your code throughout its lifetime.

State Data retained Until
running Files, memory, and processes The sandbox stops or is paused.
paused A snapshot of files, memory, and processes You delete the sandbox, or it expires after 30 days with end_reason set to pause_expired.
Saved as an image A copy of the sandbox's disk: every file, including any secrets written to it You delete the image. Keln keeps the copy until no sandbox started from the image is still running.

After resuming, Keln may retain the snapshot from the previous pause until the sandbox stops.

DELETE /v1/sandboxes/{sandbox_id} stops a running or paused sandbox and deletes its contents.

Stopped sandboxes can't be restarted. Use the Files API to retrieve anything you need before deleting one.

What Keln stores

Data Purpose Retention
Sandbox record: ID, template, size, state, timestamps, metadata, network, and ports Supports GET /v1/sandboxes/{sandbox_id}, including after the sandbox stops. Retained after the sandbox stops.
Sandbox env, encrypted Makes environment variables available to commands. For the sandbox's lifetime.
Usage records: sandbox ID, template, vCPUs, memory, runtime, and originating API key Billing. Retained after the sandbox stops.
Image record: ID, the sandbox it was saved from, size, state, timestamps and metadata Supports GET /v1/images/{image_id}; storage billing. Retained after the image is deleted.

Sandbox metadata remains stored after the sandbox stops. Don't put secrets in it.

What Keln's logs record

Keln's logs record what it needs to run and bill your sandboxes, such as their IDs, sizes, and states. They don't record your commands, file contents, or command output. For debugging, they may keep file paths.

Best practices

  • Delete sandboxes when you're finished with them. Set timeout_s based on how long the work needs to run.
  • Delete paused sandboxes you no longer need. Pausing preserves memory as well as files.