# Sypnia Files documentation > Sypnia Files stores the files of your app: photos, documents, videos and anything your users upload. Public or private buckets, rules tied to who is signed in, uploads that survive a bad connection, images resized on the fly, and an S3-compatible API. Every page of the documentation follows, in reading order. Each one starts with its title and its address. --- ## Start here > What Sypnia Files is, how it works, what is open source and what is Sypnia Cloud, the quickstarts, and how Sypnia uses it. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/start/ For agents: Section index for Sypnia Files: object storage on S3-compatible backends with buckets (public/private), access rules as Postgres row-level security using the same JWT as Sypnia Data (or any issuer), signed URLs, resumable uploads (tus, S3 multipart), image transforms and CDN, optional malware scanning, quotas, an S3-compatible API and bring-your-own bucket. Engine open source; Sypnia Cloud hosted. Sypnia Files stores the files of your app and decides who can see each one. Photos of products, receipts, documents your users upload, videos: they go into **buckets**, your **rules** decide who reads and writes them, and images can be resized on the way out. > **Note: Sypnia uses it** > > Sypnia's own images, documents and downloads are served by Sypnia Files. - **\[Engine]** **The Sypnia Files engine** is open source. You run it with any S3-compatible storage (AWS S3, Cloudflare R2, MinIO) and a Postgres. - **\[Cloud]** **Sypnia Cloud** runs the same engine for you, on Amazon S3 with a CDN in front, the console, and billing in credits. * [What Sypnia Files is](/start/what-it-is/): Storage for the files of your app, with rules tied to who is signed in, image transforms and an S3-compatible API. * [How it works](/start/how-it-works/): From an upload in your app to a file served at the edge, step by step. * [Open source and Sypnia Cloud](/start/open-source-and-cloud/): Exactly what the open-source engine does, and what Sypnia Cloud adds. * [Quickstart: Sypnia Cloud](/start/quickstart-cloud/): Create a bucket, write a rule, upload a file from your app and show a resized image. * [Quickstart: self-host](/start/quickstart-self-host/): Run the engine with Docker, MinIO and Postgres, and upload your first file. * [How Sypnia uses it](/start/how-sypnia-uses-it/): Telemetry, the pilot, keeps its recordings and raw events in Sypnia Files, and the rest of Sypnia serves its files from it too. --- ## What Sypnia Files is > Storage for the files of your app, with rules tied to who is signed in, image transforms and an S3-compatible API. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/start/what-it-is/ For agents: What Sypnia Files is: buckets (public/private), access rules as Postgres policies with auth.uid() (same user as Sypnia Data) or any JWT issuer, signed URLs (download and upload), resumable uploads, image transforms (resize/crop/WebP/AVIF) cached at the edge, optional malware scanning, S3-compatible API, bring-your-own S3/R2/MinIO. With Data in the same project metadata lives in the project database (policies can join tables); Run gets Files variables; Mail can attach by path. Not video streaming/transcoding, not backup, not a people file-sharing app. > **In plain words** > > When someone uploads a photo or a document in your app, it has to be kept somewhere safe, shown only to the right people, and delivered fast. Files does all three. ### What you get | What | In one line | | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Buckets** | Folders at the top level, public (anyone with the link) or private (only who your rules allow) | | **Access rules** | Who can read, upload, replace or delete each file, written as Postgres policies with `auth.uid()`, the same user as in [Sypnia Data](https://data.sypnia.com) | | **Signed URLs** | A link to one private file that works for a few minutes, or a link to upload one file without a session | | **Resumable uploads** | Big files and bad connections: an upload that stops continues where it stopped | | **Images** | Resize, crop and convert to WebP or AVIF in the URL, cached at the edge | | **Use cases** | Each file records the use case that wrote it, and each upload is a step in that case's trace ([Use cases and traces](https://files.docs.sypnia.com/buckets/use-cases)) | | **Malware scanning** | Optional per bucket: a file is served only after it is checked | | **S3-compatible API** | Use the AWS SDK, rclone or any S3 tool against your buckets | | **Your own storage** | Keep the objects in your AWS S3, Cloudflare R2 or MinIO bucket | ### How it fits with the rest of Sypnia - With **Sypnia Data** in the same project, file metadata lives in your project's database, so a policy can join files with your tables («a customer can see the receipt of their own order»). - **Sypnia Run** apps get the Files address and keys as variables when you connect them. - **Sypnia Mail** can attach a file from a bucket by its path. - **Sypnia Domains** serves your public files on your own address, such as `cdn.laespiga.co` ([Your own address](https://files.docs.sypnia.com/images/cdn-and-caching#your-own-address)). - **Sypnia Telemetry** shows every upload and download inside the trace of the use case that made it. Files also works alone: point it at any issuer of JWTs (Auth0, Clerk, Firebase, your own) and it checks them the same way. ### What it is not - Not a video streaming service: it stores and serves video files, without transcoding to adaptive streams. - Not a backup product for your computers. - Not a file-sharing app with folders for people; it is the storage behind your app. --- ## How it works > From an upload in your app to a file served at the edge, step by step. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/start/how-it-works/ For agents: How Files works: upload to https://.files.sypnia.com/object// with user token (resumable for big files) → policy check on sypnia_files.objects in the project Postgres (403 if denied) → bytes to S3 or BYO bucket under project prefix, metadata row (bucket, path, size, type, owner, checksum; pending until scan if enabled) → download public via https://.files.sypnia.app CDN, private via signed URL or token (never cached for others) → image transforms by query params cached at edge. Two hosts: API on files.sypnia.com, content on files.sypnia.app (separate domain for safety). #### 1. Your app asks to upload The SDK sends the file to `https://.files.sypnia.com/object//` with the signed-in user's token. For big files it uses the resumable protocol and sends it in parts. #### 2. Files checks your rules Files reads who the user is from the token, and asks your project's Postgres whether the policies on `sypnia_files.objects` allow this insert for this bucket and path. If not, the answer is `403` and nothing is stored. #### 3. The object is stored The bytes go to S3 (or your bucket) under the project's prefix; a row in `sypnia_files.objects` records the bucket, path, size, type, owner and a checksum. With scanning on, the row stays `pending` until the scan says `clean`. #### 4. Someone downloads it A public file is served from `https://.files.sypnia.app//` through the CDN. A private file is served to whoever the rules allow, with a signed URL or with their token, and never cached for others. #### 5. Images on the way out `?width=400&format=webp` on an image URL returns a resized copy, made once and cached at the edge. ### Two addresses | Address | For | | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | `https://.files.sypnia.com` | the API: uploads, listing, policies, signed URLs, the S3 API | | `https://.files.sypnia.app` | the content: files and image transforms, on a separate domain so an uploaded HTML or SVG file can never touch Sypnia's cookies | --- ## Open source and Sypnia Cloud > Exactly what the open-source engine does, and what Sypnia Cloud adds. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/start/open-source-and-cloud/ For agents: Files engine vs Cloud: engine on any S3-compatible storage or local folder, metadata in your Postgres 14+, any JWT issuer via JWKS, no CDN built in, transforms in engine, pluggable scanner (ClamAV image), no console; Cloud on Amazon S3 or BYO bucket, metadata in project DB, CloudFront CDN with edge transforms, GuardDuty Malware Protection per bucket, console with file browser and policy editor, credits. Same API/SDK/CLI/MCP; moving = copy objects + dump sypnia_files schema. | | Engine **\[Engine]** | Sypnia Cloud **\[Cloud]** | | ---------------- | ----------------------------------------------------------------- | ---------------------------------------------------- | | Storage | any S3-compatible service, or a local folder for development | Amazon S3, or your own bucket | | Metadata | your Postgres 14+ | your project's database | | Sign-in | any JWT issuer (JWKS), Sypnia Data included | your Sypnia Data project, or any JWT issuer | | CDN | none built in; put your own in front | CloudFront, with image transforms at the edge | | Image transforms | in the engine | at the edge, cached | | Malware scanning | plug a scanner (ClamAV in the image) | Amazon GuardDuty Malware Protection, per bucket | | Console | none; the API, CLI and MCP | the console, with a file browser and a policy editor | | License | open source: the engine under AGPL-3.0, `@sypnia/files` under MIT | a hosted service, paid in credits | The API, the SDK, the CLI and the MCP tools are the same. Moving from Sypnia Cloud to your engine: copy the bucket's objects with any S3 tool, dump the `sypnia_files` schema, point the SDK at your engine. --- ## Quickstart: Sypnia Cloud > Create a bucket, write a rule, upload a file from your app and show a resized image. Applies to: Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/start/quickstart-cloud/ For agents: Files Cloud quickstart: npx @sypnia/files login; buckets create avatars --public --max-size 5MB --types …; SQL policy on sypnia_files.objects for insert to authenticated with check bucket_id and foldername()[1] = auth.uid(); upload with createFiles(…/client) session from @sypnia/data; url() with width/height/resize/format → .files.sypnia.app WebP. At the end, your app uploads a profile photo for the signed-in user and shows it at 256 px. #### 1. Create a bucket ```bash npx @sypnia/files login npx @sypnia/files buckets create avatars --public --max-size 5MB --types image/jpeg,image/png,image/webp ``` **You should see:**`Bucket avatars created (public).` #### 2. Allow each user to write their own folder ```sql create policy "own avatar" on sypnia_files.objects for insert to authenticated with check (bucket_id = 'avatars' and (sypnia_files.foldername(name))[1] = auth.uid()::text); ``` Run it in the SQL editor of the console, or with `npx @sypnia/files policies apply policies.sql`. #### 3. Upload from your app ```ts import { createFiles } from '@sypnia/files/client'; const files = createFiles('https://.files.sypnia.com', { session: sypnia.auth }); // sypnia: your @sypnia/data client await files.bucket('avatars').upload(`${user.id}/photo.jpg`, file, { upsert: true }); ``` #### 4. Show it resized ```ts const src = files.bucket('avatars').url(`${user.id}/photo.jpg`, { width: 256, height: 256, resize: 'cover', format: 'webp' }); ``` **You should see:**An address on `.files.sypnia.app` that returns a 256 × 256 WebP. --- ## Quickstart: self-host > Run the engine with Docker, MinIO and Postgres, and upload your first file. Applies to: the Sypnia engine (open source, self-hosted). Source: https://files.docs.sypnia.com/start/quickstart-self-host/ For agents: Files self-host quickstart: clone sypnia-files, cp .env.example .env (SYPNIA_FILES_JWKS_URL), docker compose up (engine on :7500, MinIO storage, Postgres metadata, schema installed on start, secret key printed); npx @sypnia/files use http://localhost:7500 --key; buckets create; cp ./file files://bucket/path. ```bash git clone https://github.com/sespinosav/sypnia-files && cd sypnia-files cp .env.example .env # set SYPNIA_FILES_JWKS_URL to your issuer, or leave the local one docker compose up ``` The compose file starts the engine on `http://localhost:7500`, **MinIO** as the storage, and Postgres for metadata; the engine installs its schema on first start and prints a secret key. ```bash npx @sypnia/files use http://localhost:7500 --key npx @sypnia/files buckets create docs npx @sypnia/files cp ./menu.pdf files://docs/menu.pdf ``` **You should see:**`Uploaded docs/menu.pdf (124 KB).` > **Note** > > The repository lives in Sypnia Git, like all of Sypnia's code, with a mirror on GitHub at the address above. --- ## How Sypnia uses it > Telemetry, the pilot, keeps its recordings and raw events in Sypnia Files, and the rest of Sypnia serves its files from it too. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/start/how-sypnia-uses-it/ For agents: Dogfooding: Telemetry (the pilot, built on Sypnia end to end) points its engine's object storage (storage.endpoint, SYPNIA_STORAGE_ENDPOINT) at Files' S3-compatible API with one S3 key scoped to its private bucket telemetry-events (raw event segments, replay chunks, page snapshots, source maps; keys under each customer project's id; source maps never public). The Telemetry engine deletes expired data itself per plan. Public images of telemetry.sypnia.com and the docs come from a public bucket through Files' CDN. Files calls are spans in Telemetry's own traces. Rest of the suite: App keeps chat attachments in the private bucket app-uploads; Mail keeps inbound attachments and mailbox blobs it is told to keep; Design keeps renders and exports; Learn keeps course videos; Skills packages; sypnia.com and the product sites serve images and downloads. Self-hosted Telemetry engines can use a self-hosted Files engine the same way. Telemetry is the pilot of the Sypnia suite: it is built on Sypnia from end to end and uses every Sypnia product. This is how it uses Sypnia Files. ### How Telemetry uses Sypnia Files | What Telemetry keeps | How it lives in Files | | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | **Raw events** that arrive from every customer's app | the private bucket `telemetry-events`, one key per segment, under the customer project's id | | **Session recordings**: replay chunks and page snapshots | the same private bucket, read back only by the engine, which hands the console a short-lived link | | **Source maps** uploaded by customers' builds | the same private bucket; they are never public and never reach a browser | | **Images of telemetry.sypnia.com and its docs** | a public bucket, served through Files' CDN and sized for each screen with [image transforms](https://files.docs.sypnia.com/images/transforms) | - **Through the S3 API.** Telemetry's engine speaks S3, so it needs no special code: in Sypnia Cloud its `storage.endpoint` is [Files' S3-compatible API](https://files.docs.sypnia.com/s3/s3-api), with one S3 key limited to `telemetry-events` and to the actions the engine needs. Every request through that key is recorded with its id. - **Retention stays with Telemetry.** Each plan keeps data for a different time, and the Telemetry engine deletes what has expired once a day, so the bucket needs no rule of its own. - **Files you never see.** Nothing in `telemetry-events` is public. A recording is shown in the console through a link that works for a few minutes, for the person who opened it. - **Traced in Telemetry itself.** Each write and read is a span inside the trace of the Telemetry case that made it, so a slow upload of a recording shows up the way it would for a customer. - **Self-hosted too.** A self-hosted Telemetry engine can keep its data in a self-hosted Files engine the same way: set `SYPNIA_STORAGE_ENDPOINT` to the Files engine's `/s3` address and give it an S3 key for its bucket. ### The rest of the suite | Product or site | What it keeps in Sypnia Files | | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | | [App](https://app.docs.sypnia.com/) | the files people attach in the chat, in the private bucket `app-uploads`, readable only by the person who sent them and the project they belong to | | [Mail](https://mail.docs.sypnia.com/) | attachments of received e-mail, when a project asks to keep them in a bucket of its own | | [Design](https://design.docs.sypnia.com/) | rendered screens, the PDF of each design guide and exported images | | [Learn](https://learn.docs.sypnia.com/) | the videos of the courses | | [Skills](https://skills.docs.sypnia.com/) | the published packages of each skill version | | sypnia.com and every product site | images and downloads, from public buckets through the CDN | ### What it proves Telemetry writes to Files all day, from every customer's app at once. If an upload is slow, a key opens more than it should, or a private file leaks to a public address, Telemetry is the first to feel it, in production, every day. --- ## Buckets and files > Buckets, paths, public and private files, metadata and quotas. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/buckets/ - [Buckets and paths](/buckets/buckets-and-paths/): How files are organized: buckets, paths that look like folders, public and private buckets. - [Metadata and quotas](/buckets/metadata-and-quotas/): What Files records about each file, custom metadata, and the limits you set per bucket. - [Use cases and traces](/buckets/use-cases/): Each file knows which use case uploaded it, each case says which buckets it uses, and every upload is a step in the case's trace. --- ## Buckets and paths > How files are organized: buckets, paths that look like folders, public and private buckets. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/buckets/buckets-and-paths/ For agents: Files buckets and paths: bucket holds files identified by bucket + path (slashes look like folders; no folder objects); public bucket (download by anyone via CDN) vs private (default; download only by policy via token or signed URL; never shared in cache); uploads/replace/delete always by policy; names 3–63 lowercase/digits/dashes; paths ≤1,024 bytes UTF-8, no .., leading /, control chars; SDK list/move/copy/remove through policies. A **bucket** holds files. A file is identified by its bucket and its **path**, such as `receipts/2026/11/order-1042.pdf`. Paths with `/` look like folders in the console and the SDK, but there are no folder objects: a folder exists while a file is in it. ### Public and private | | Public bucket | Private bucket (default) | | ----------------------- | ---------------------------------------- | ---------------------------------------------------------- | | Download | anyone with the address, through the CDN | only who your policies allow: with a token or a signed URL | | Upload, replace, delete | always by your policies | always by your policies | | Cached at the edge | yes | per signed URL, never shared | Making a bucket public is a setting you change at any time; it does not move files. ### Names Bucket names: 3 to 63 lowercase letters, digits and dashes. Paths: up to 1,024 bytes of UTF-8; `..`, a leading `/` and control characters are refused. ### Operations ```ts const avatars = files.bucket('avatars'); await avatars.list('user-42/', { limit: 100, sortBy: 'created_at' }); await avatars.move('user-42/old.jpg', 'user-42/photo.jpg'); await avatars.copy('templates/menu.pdf', 'menus/2026-11.pdf'); await avatars.remove(['user-42/photo.jpg']); ``` Every operation goes through the same policies as an upload. --- ## Metadata and quotas > What Files records about each file, custom metadata, and the limits you set per bucket. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/buckets/metadata-and-quotas/ For agents: Files metadata: row per file in sypnia_files.objects (id, bucket_id, name, owner from token, size, content_type, checksum SHA-256, scan_status, metadata JSON, case, timestamps, last_accessed_at), queryable/joinable/policy-able; upload with metadata option. Per-bucket limits: maxFileSize (413), allowedTypes (sniffed from bytes), scan on/off, cacheControl. Cloud project quotas: storage and monthly transfer; over storage → uploads refused insufficient_storage, downloads keep working. ### What is recorded Each file is a row in `sypnia_files.objects`: `id`, `bucket_id`, `name` (the path), `owner` (the user who uploaded it, from the token), `size`, `content_type`, `checksum` (SHA-256), `scan_status`, `metadata` (your own JSON), `case` (the [use case](https://files.docs.sypnia.com/buckets/use-cases) that last wrote it), `created_at`, `updated_at`, `last_accessed_at`. Because it is a table in your project's database, you can query it with SQL, join it with your own tables and write policies on it. ```ts await files.bucket('receipts').upload('order-1042.pdf', pdf, { metadata: { orderId: 1042 } }); ``` ### Per-bucket limits | Setting | Effect | | -------------- | -------------------------------------------------------------------------------------------------------- | | `maxFileSize` | uploads larger than this are refused with `413` | | `allowedTypes` | a list of MIME types or patterns (`image/*`); the type is checked from the bytes, not only the file name | | `scan` | `off`, or `on` to serve files only after a clean malware scan | | `cacheControl` | the `Cache-Control` header for public files | ### Project quotas **\[Cloud]** A project has a storage quota and a monthly transfer quota from its plan. Near the limit you are notified; over it, uploads are refused with `insufficient_storage` until you add credits or capacity. Downloads keep working. --- ## Use cases and traces > Each file knows which use case uploaded it, each case says which buckets it uses, and every upload is a step in the case's trace. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/buckets/use-cases/ For agents: Case attribution in Files: SDK option case or header Sypnia-Case on uploads, replacements, deletes and signed URLs; recorded in sypnia_files.objects.case (the case that last wrote the file) and in the audit log; inside a request traced by @sypnia/telemetry the SDK reads the active case and sends traceparent, so case can be omitted. A case file declares the buckets it uses: files: { reads: [menu], writes: [receipts] }; the Cases check reports a case that writes a bucket it does not list, or lists one it never uses. The case is a label, not a permission: policies decide access. Spans: files.upload , files.download , files.sign , files.delete , files.transform with sypnia.case, size, content type, never the file or its path's query. Cases shows each case's buckets and file counts. A file in your app is always there because someone did something: a customer uploaded a photo, an order made its receipt. Files records **which use case** of your map did it, so you can answer «where did this file come from?» and «which files does this case create?». ### Saying the case ```ts await files.bucket('receipts').upload('order-1042.pdf', pdf, { case: 'place-order' }); ``` or the header `Sypnia-Case: place-order` on any request to the API: uploads, replacements, deletes and signed links. The id is the one in your map, from `cases//.case.yaml` ([Cases](https://cases.docs.sypnia.com/)). When your server is traced with Telemetry's SDK, the case of the current request is already known: `@sypnia/files` reads it and sends the trace along, so you can leave `case` out. ### What is recorded | Where | What | | --------------------------- | --------------------------------------------------------------- | | `sypnia_files.objects.case` | the case that last wrote the file; `null` when none was given | | the audit log | the case of every write and delete made with a secret or S3 key | Because the case is a column, you can query it like any other: «every receipt `place-order` wrote this week», «files no case owns». ### The case says which buckets it uses `cases/orders/place-order.case.yaml` ```yaml id: place-order title: Place an order actor: customer files: reads: [menu] writes: [receipts] ``` The Cases check compares that with what really happens: a case that writes a bucket it does not list, or lists one it never uses, is reported, the same way as a table the case did not declare. > **Note: A label, not a permission** > > The case name comes from the caller, so it never opens a file by itself. Who may read and write is always decided by your [policies](https://files.docs.sypnia.com/access/policies). The case tells you what the file is for; the policy decides who reaches it. ### In the trace Each call is a step (a span) inside the trace of its case, next to the database queries and the page that started it: | Span | What it carries | | ----------------------------------------------------- | ---------------------------------------------------------------------- | | `files.upload ` | the size, the content type, whether it was resumable, the time it took | | `files.download `, `files.transform ` | the size served, whether it came from the CDN's cache | | `files.sign `, `files.delete ` | the bucket and how long the link lasts | No span carries the file's contents. With [Sypnia Telemetry](https://telemetry.docs.sypnia.com/), a slow upload shows up in the case where a person was waiting, and in [Sypnia Cases](https://cases.docs.sypnia.com/) each case lists its buckets and how many files it wrote. --- ## Access rules > Who can read and write which file: policies with the same sign-in as Sypnia Data, signed URLs and keys. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/access/ - [Policies](/access/policies/): Rules written as Postgres row-level security on the files table, with auth.uid() and your own tables. - [Signed URLs and keys](/access/signed-urls-and-keys/): Short-lived links to private files, links to upload one file, and the keys servers use. --- ## Policies > Rules written as Postgres row-level security on the files table, with auth.uid() and your own tables. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/access/policies/ For agents: Files policies: Postgres RLS on sypnia_files.objects; select (download, list), insert (upload), update (+insert new path) for upsert/move/metadata, delete; default deny. Examples: public read for a bucket, own folder via sypnia_files.foldername(name)[1] = auth.uid()::text, join with public.orders via metadata orderId. Helpers foldername, filename, extension; auth.uid/role/jwt from Sypnia Data or engine with other issuer (JWKS). Cloud console policy templates and SQL preview with lint. Every request is checked against **policies** on `sypnia_files.objects`, the same row-level security Postgres uses for your tables. A request is allowed only if a policy for that command and role allows it; with no policy, nothing is allowed. | Request | Command checked | | ----------------------------------------- | ---------------------------------------- | | download, list | `select` | | upload | `insert` | | replace (`upsert`), move, change metadata | `update` (and `insert` for the new path) | | delete | `delete` | ### Examples ```sql -- anyone can read the public menu photos create policy "menu is public" on sypnia_files.objects for select to anon, authenticated using (bucket_id = 'menu'); -- a user reads and writes only their own folder create policy "own folder" on sypnia_files.objects for all to authenticated using (bucket_id = 'avatars' and (sypnia_files.foldername(name))[1] = auth.uid()::text) with check (bucket_id = 'avatars' and (sypnia_files.foldername(name))[1] = auth.uid()::text); -- a customer reads the receipt of their own order (joins your table) create policy "own receipts" on sypnia_files.objects for select to authenticated using (bucket_id = 'receipts' and exists ( select 1 from public.orders o where o.id = (sypnia_files.objects.metadata->>'orderId')::bigint and o.customer_id = auth.uid())); ``` Helpers: `sypnia_files.foldername(name)` (the folders as an array), `sypnia_files.filename(name)`, `sypnia_files.extension(name)`. `auth.uid()`, `auth.role()` and `auth.jwt()` come from [Sypnia Data](https://data.docs.sypnia.com/data/row-level-security), or from the engine when you use another issuer. ### Without Sypnia Data With another issuer, the engine verifies the JWT against its JWKS and exposes the same `auth.*` functions in its own metadata database, so policies are written the same way. ### In the console **\[Cloud]** The policy editor offers templates («public read», «own folder», «owner only», «role from app_metadata») and shows the SQL it will run. The lint that warns about unqualified columns in sub-selects runs here too. --- ## Signed URLs and keys > Short-lived links to private files, links to upload one file, and the keys servers use. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/access/signed-urls-and-keys/ For agents: Files signed URLs and keys: signedUrl(path, {expiresIn 1 s–7 days default 1 h, download name}) checked against select policies, transform options can be signed; signedUploadUrl(path, {expiresIn}) for one path, once, without session; keys: publishable (policies apply), secret (bypasses policies, servers only, refused from browsers with Origin), S3 access keys scoped to buckets/actions; in Cloud publishable/secret keys shared with Data per project. ### Signed download URLs ```ts const { url } = await files.bucket('receipts').signedUrl('order-1042.pdf', { expiresIn: 300, download: 'recibo-1042.pdf' }); ``` A signed URL works for anyone who has it until it expires (1 second to 7 days; 1 hour by default). Creating one is checked against your `select` policies. Image transform options can be part of the signature, so a signed thumbnail cannot be turned into the full image. ### Signed upload URLs ```ts const { url, token } = await files.bucket('uploads').signedUploadUrl('forms/42/id.jpg', { expiresIn: 7200 }); // give url+token to a browser or device that has no session; it can upload exactly this path, once ``` ### Keys | Key | Who uses it | What it can do | | --------------- | -------------------------------------- | -------------------------------------------------------- | | publishable key | browsers and apps, with a user's token | only what policies allow to `anon` or the user | | secret key | your servers | everything: bypasses policies; never put it in a browser | | S3 access key | S3 tools | the buckets and actions you scope it to | In Sypnia Cloud, a project's publishable and secret keys are the same for Data and Files. A secret key sent from a browser (`Origin` header present) is refused. --- ## Uploads > Direct uploads, resumable uploads for big files and bad connections, and signed upload URLs. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/uploads/ - [Direct uploads](/uploads/direct-uploads/): One request per file, for files up to the direct-upload limit. - [Resumable uploads](/uploads/resumable-uploads/): Big files and unreliable connections: the tus protocol, S3 multipart, and how an upload resumes. --- ## Direct uploads > One request per file, for files up to the direct-upload limit. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/uploads/direct-uploads/ For agents: Files direct uploads: upload(path, file, {contentType sniffed, upsert (needs update policy), cacheControl, metadata}) → POST /object/{bucket}/{path}; response id, size, checksum, scan_status; checks in order: auth + bucket, path format, maxFileSize and direct-upload limit (413 → resumable), type sniffing vs allowedTypes, insert/update policy, storage quota; row written only after bytes stored. ```ts await files.bucket('menu').upload('pan-masa-madre.jpg', file, { contentType: 'image/jpeg', // checked against the bytes upsert: false, // true replaces an existing file (needs an update policy) cacheControl: '3600', metadata: { product: 'pan-masa-madre' }, }); ``` The SDK sends `POST /object/{bucket}/{path}` with the file as the body. The response has the file's `id`, `size`, `checksum` and `scan_status`. ### What is checked, in order 1. The token or key, and that the bucket exists. 2. The path's format. 3. The size against the bucket's `maxFileSize` and the direct-upload limit (`413` above it: use [resumable uploads](https://files.docs.sypnia.com/uploads/resumable-uploads)). 4. The type, sniffed from the first bytes, against `allowedTypes`. 5. Your `insert` policy (and `update` with `upsert`). 6. The project's storage quota. The object is written to storage with a SHA-256 checksum; the metadata row is written only after the bytes are stored, so a failed upload never leaves a row pointing at nothing. --- ## Resumable uploads > Big files and unreliable connections: the tus protocol, S3 multipart, and how an upload resumes. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/uploads/resumable-uploads/ For agents: Files resumable uploads: uploadResumable(path, file, {chunkSize, onProgress}) resumes after drops; protocols tus 1.0 at POST /upload/resumable (Uppy, tus-js-client, TUSKit) and S3 multipart via S3 API; resumable for 24 h; file and metadata row appear only on completion, policies checked at start and end; max file per plan up to 50 GB; parts 5–100 MB except last. For files over a few megabytes, or from phones on mobile data, use resumable uploads: the file goes in parts, and if the connection drops the upload continues from the last part that arrived. ```ts const upload = files.bucket('videos').uploadResumable('clase-01.mp4', file, { chunkSize: 6 * 1024 * 1024, onProgress: (sent, total) => setProgress(sent / total), }); await upload.done; // resumes by itself after a dropped connection ``` ### Protocols | Protocol | Endpoint | For | | ------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------- | | [tus 1.0](https://tus.io) | `POST /upload/resumable` | browsers and mobile apps; any tus client works (Uppy, tus-js-client, TUSKit) | | S3 multipart | the [S3 API](https://files.docs.sypnia.com/s3/s3-api) | S3 tools and SDKs | An unfinished upload can be resumed for 24 hours. Parts are stored as they arrive; the file and its metadata row appear only when the last part completes and the policies pass, which are checked when the upload starts and again when it ends. ### Limits The largest file depends on the plan, up to 50 GB. Parts are between 5 MB and 100 MB, except the last. --- ## Images and the CDN > Resizing, cropping and converting images in the URL, caching, and serving through the CDN. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/images/ - [Image transforms](/images/transforms/): Resize, crop and convert any stored image by adding options to its address. - [CDN and caching](/images/cdn-and-caching/): How public and private files are cached, and how a change reaches visitors. --- ## Image transforms > Resize, crop and convert any stored image by adding options to its address. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/images/transforms/ For agents: Files image transforms via URL query on .files.sypnia.app: width/height 1–2,500 px, resize cover|contain|fill (cover), gravity center|north|south|east|west|face, format origin|webp|avif|jpeg|png|auto (auto from Accept), quality 20–100 (80), blur 0–100; SDK bucket.url(); private via signed URL with options signed; originals JPEG/PNG/WebP/AVIF/GIF/HEIC/TIFF ≤25 MB and 50 MP; EXIF/GPS stripped; each distinct transform made once and cached, metered per month. ```text https://.files.sypnia.app/menu/pan-masa-madre.jpg?width=600&height=400&resize=cover&format=webp&quality=80 ``` | Option | Values | Default | | ----------------- | ---------------------------------------------------------------------------------------------- | -------------- | | `width`, `height` | 1–2,500 pixels | the original's | | `resize` | `cover` (fill and crop), `contain` (fit inside), `fill` (stretch) | `cover` | | `gravity` | `center`, `north`, `south`, `east`, `west`, `face` | `center` | | `format` | `origin`, `webp`, `avif`, `jpeg`, `png`; `auto` picks AVIF or WebP from the browser's `Accept` | `auto` | | `quality` | 20–100 | 80 | | `blur` | 0–100 | 0 | The SDK builds these addresses: `bucket.url(path, { width: 600, format: 'webp' })`. For private files the options are part of the [signed URL](https://files.docs.sypnia.com/access/signed-urls-and-keys). Supported originals: JPEG, PNG, WebP, AVIF, GIF (first frame), HEIC and TIFF, up to 25 MB and 50 megapixels. EXIF metadata, including GPS, is removed from transformed images. Each distinct transform is made once and cached; the console shows how many transforms a project made in the month, which is what is metered. --- ## CDN and caching > How public and private files are cached, and how a change reaches visitors. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/images/cdn-and-caching/ For agents: Files caching: own address via Sypnia Domains (connect cdn. files:, public files, transforms and signed URLs; API stays on its host; use a files-only subdomain); public files at edge shared (bucket cacheControl, default 1 h); public transforms 30 days keyed by options; private via signed URL cached per URL until expiry; private via token not cached; upsert invalidates cached copies and transforms; versioned paths recommended; Range requests for video seeking; ETag/If-None-Match. | File | Cached where | For how long | | -------------------------- | ------------------------------- | ---------------------------------------------- | | public file | at the edge, shared by everyone | the bucket's `cacheControl`, 1 hour by default | | public image transform | at the edge | 30 days, keyed by the options | | private file by signed URL | at the edge, for that URL only | until the URL expires | | private file by token | not cached at the edge | — | Replacing a file (`upsert`) invalidates its cached copies and its transforms. Clients that cache harder should use paths with a version (`menu/v3/pan.jpg`). Range requests (`Range: bytes=…`) are supported, so video players can seek. `ETag` and `If-None-Match` make repeat requests cheap. ### Your own address Public files and image transforms are served on `.files.sypnia.app` from the start. To serve them on your own domain, connect an address with [Sypnia Domains](https://domains.docs.sypnia.com/connect/data-and-files): ```bash npx @sypnia/domains connect cdn.laespiga.co files:public ``` Domains writes the record and the certificate, and the same files answer on `https://cdn.laespiga.co/menu/pan.jpg`. Signed links can use the address too; the Files API stays on its own host. Use a subdomain made only for files, never the one your app runs on, so an uploaded file can never read your app's cookies. A domain registered somewhere else connects the same way once Domains keeps its DNS ([DNS only](https://domains.docs.sypnia.com/dns/dns-only-and-registration-only)). --- ## S3 API and your own storage > The S3-compatible API, and bringing your own S3, R2 or MinIO bucket. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/s3/ - [The S3-compatible API](/s3/s3-api/): Use the AWS SDK, the AWS CLI, rclone or any S3 tool against your buckets. - [Bring your own bucket](/s3/bring-your-own-bucket/): Keep the objects in your AWS S3, Cloudflare R2 or MinIO bucket and use Files on top. --- ## The S3-compatible API > Use the AWS SDK, the AWS CLI, rclone or any S3 tool against your buckets. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/s3/s3-api/ For agents: Files S3-compatible API at https://.files.sypnia.com/s3 (path-style SigV4); S3 access keys via files s3-keys create --buckets --actions (shown once), bypass row policies but scoped to buckets/actions, audited, servers only; operations Get/Head/Put/Copy/Delete/DeleteObjects/ListObjectsV2/ListBuckets + multipart; writes get metadata rows and scanning. ```bash npx @sypnia/files s3-keys create --buckets backups,uploads --actions read,write # prints an access key id and a secret, once aws s3 cp ./export.csv s3://backups/2026-11/export.csv --endpoint-url https://.files.sypnia.com/s3 --region us-east-1 ``` Requests are signed with AWS Signature Version 4, path-style. Supported operations: `GetObject`, `HeadObject`, `PutObject`, `CopyObject`, `DeleteObject`, `DeleteObjects`, `ListObjectsV2`, `ListBuckets`, and multipart (`CreateMultipartUpload`, `UploadPart`, `CompleteMultipartUpload`, `AbortMultipartUpload`, `ListParts`). S3 access keys bypass row policies but are limited to the buckets and actions they were created with, and every request through them is recorded with the key's id. They are for servers and tools, never for browsers. Files written through the S3 API get their metadata row and malware scan like any other upload. --- ## Bring your own bucket > Keep the objects in your AWS S3, Cloudflare R2 or MinIO bucket and use Files on top. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/s3/bring-your-own-bucket/ For agents: Files bring-your-own bucket: objects in your bucket, metadata/policies/scanning/transforms by Files; AWS S3 via IAM role trusting Sypnia with external id (no long-lived keys); R2/MinIO/B2/Wasabi/any S3-compatible via access key stored encrypted with project key; files buckets create --storage s3://… --role arn; writes only under chosen prefix; external objects visible only after files buckets import. A bucket in Files can store its objects in a bucket you own. Files keeps the metadata and applies policies, scanning and transforms; the bytes stay with you. | Your storage | How Files gets access | | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | AWS S3 | an IAM role in your account that trusts Sypnia with an **external id**; Files never holds long-lived AWS keys | | Cloudflare R2, MinIO, Backblaze B2, Wasabi, any S3-compatible service | an access key you create there, stored encrypted with the project's key | ```bash npx @sypnia/files buckets create invoices --storage s3://laespiga-invoices --role arn:aws:iam::123456789012:role/sypnia-files ``` Files writes under the prefix you choose and does not list or touch anything else in your bucket. Objects written into your bucket by other means are not visible to Files until you run `files buckets import`, which creates their metadata rows. --- ## SDK, CLI and MCP > The @sypnia/files package, the files command and the MCP tools for agents. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/tools/ - [The @sypnia/files package](/tools/sdk/): One npm package with subpaths for browsers, servers and React. - [The CLI](/tools/cli/): Every files command. - [MCP for agents](/tools/mcp/): The Files MCP server and its tools. --- ## The @sypnia/files package > One npm package with subpaths for browsers, servers and React. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/tools/sdk/ For agents: @sypnia/files subpaths: /client (uploads direct+resumable, downloads, URLs, signed URLs with user session), /server (secret key, bucket management, policies, imports, S3 keys), /react (useUpload, FileDrop with progress/resume), CLI npx @sypnia/files; createFiles(url, {session}) where session = @sypnia/data client, getAccessToken() object or token function; ESM + types; Node 20+, browsers, Bun, Deno, React Native. | Import | For | | ---------------------- | -------------------------------------------------------------------------------------------------------- | | `@sypnia/files/client` | browsers and apps: uploads (direct and resumable), downloads, URLs, signed URLs, with the user's session | | `@sypnia/files/server` | servers: the secret key, bucket management, policies, imports, S3 keys | | `@sypnia/files/react` | `useUpload()` and `` with progress and resume | | `npx @sypnia/files` | [the CLI](https://files.docs.sypnia.com/tools/cli) | ```ts import { createFiles } from '@sypnia/files/client'; const files = createFiles('https://.files.sypnia.com', { session: sypnia.auth }); ``` `session` accepts a `@sypnia/data` client, any object with `getAccessToken()`, or a function returning a token, so it works with other auth providers. ESM with types, Node 20+, browsers, Bun, Deno and React Native. --- ## The CLI > Every files command. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/tools/cli/ For agents: Files CLI: login/logout/whoami/use; buckets create|ls|update|rm|import; ls files://bucket/prefix; cp (both ways, -r, resumable); mv, rm; sign --expires; policies ls|apply; s3-keys create|ls|revoke; --json; SYPNIA_FILES_KEY or --key. | Command | What it does | | ------------------------------------------- | -------------------------------------------------------------------------------------------- | | `login` · `logout` · `whoami` · `use ` | Sign in (device flow) or point at an engine | | `buckets create\|ls\|update\|rm\|import` | Buckets and their settings | | `ls files:///` | List files | | `cp ` | Copy between your disk and Files, either way, recursively with `-r`; resumable for big files | | `mv`, `rm` | Move and delete | | `sign files:/// --expires 1h` | Print a signed URL | | `policies ls\|apply ` | Policies | | `s3-keys create\|ls\|revoke` | S3 access keys | `--json` on every command; `SYPNIA_FILES_KEY` or `--key` for a secret key instead of the session. --- ## MCP for agents > The Files MCP server and its tools. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/tools/mcp/ For agents: Files MCP at https://mcp.files.sypnia.com: OAuth (PKCE, DCR) or PAT with Sypnia account, or project token for one project; tools list_buckets/get_bucket, list_files/get_file, read_file, upload_file, sign_url, create_bucket/update_bucket (approval to make public), delete_files (approval), apply_policy (approval); approvals in console or files approve; audited. `https://mcp.files.sypnia.com` serves every project you can reach. An agent signs in with your Sypnia account (OAuth with PKCE and dynamic client registration) or a personal access token; with a project token it works only on that project. | Tool | Does | Needs approval | | -------------------------------- | ------------------------------ | ---------------------- | | `list_buckets`, `get_bucket` | buckets and their settings | no | | `list_files`, `get_file` | files and their metadata | no | | `read_file` | text and small files' contents | no | | `upload_file` | upload a file the agent has | no | | `sign_url` | a signed download URL | no | | `create_bucket`, `update_bucket` | buckets | making a bucket public | | `delete_files` | delete | yes | | `apply_policy` | add or change a policy | yes | Approvals are confirmed in the console or with `files approve `. Every call is recorded. --- ## API reference > The Files API: addresses, authentication, errors and limits. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/api/ For agents: Files API at https://.files.sypnia.com (content on .files.sypnia.app); auth apikey header (publishable/secret) + Bearer user JWT; error shape; codes 400 invalid_request/path/transform, 401 unauthorized/invalid_token, 403 policy_denied/secret_key_in_browser, 404 not_found/bucket_not_found, 409 already_exists, 413 too_large, 415 type_not_allowed, 423 scan_pending/infected, 507 insufficient_storage, 429 rate_limited. API: `https://.files.sypnia.com` **\[Cloud]**, or your engine's address **\[Engine]**. Content: `https://.files.sypnia.app`. ### Authentication | Header | Meaning | | ------------------------------------- | -------------------------------------------------- | | `apikey: ` | which project, and with the secret key full access | | `Authorization: Bearer ` | who the user is; policies apply | ### Errors ```json { "error": { "code": "policy_denied", "message": "No policy allows insert on avatars/user-42/photo.jpg." } } ``` | Status | Codes | | ------ | ------------------------------------------------------ | | 400 | `invalid_request`, `invalid_path`, `invalid_transform` | | 401 | `unauthorized`, `invalid_token` | | 403 | `policy_denied`, `secret_key_in_browser` | | 404 | `not_found`, `bucket_not_found` | | 409 | `already_exists` | | 413 | `too_large` | | 415 | `type_not_allowed` | | 423 | `scan_pending`, `infected` | | 507 | `insufficient_storage` | | 429 | `rate_limited` | - [Endpoints](/api/endpoints/): Buckets, objects, uploads, signed URLs, policies and S3 keys. --- ## Endpoints > Buckets, objects, uploads, signed URLs, policies and S3 keys. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/api/endpoints/ For agents: Files API endpoints: buckets GET/POST/PATCH/DELETE /bucket; objects POST/GET/HEAD /object/{bucket}/{path} (x-upsert), POST /object/list/{bucket}, move/copy, DELETE /object/{bucket} {paths}, PATCH metadata; POST /upload/resumable (tus); POST /object/sign/… (signed download), POST /object/upload/sign/… (signed upload); GET /object/public/… on content host; policies endpoints (secret key); S3 keys; /s3 API. ### Buckets | Method and path | Does | | --------------------------------------------------------------- | ------------------------------------------------------------------------------ | | `GET /bucket` | List buckets | | `POST /bucket` | `{ id, public?, maxFileSize?, allowedTypes?, scan?, cacheControl?, storage? }` | | `GET /bucket/{id}`, `PATCH /bucket/{id}`, `DELETE /bucket/{id}` | Read, change, delete (only when empty, or with `?empty=true`) | ### Objects | Method and path | Does | | ---------------------------------------- | ------------------------------------------- | | `POST /object/{bucket}/{path}` | Upload (`x-upsert: true` to replace) | | `GET /object/{bucket}/{path}` | Download as the user (policies apply) | | `HEAD /object/{bucket}/{path}` | Metadata only | | `POST /object/list/{bucket}` | `{ prefix, limit, offset, sortBy, search }` | | `POST /object/move`, `POST /object/copy` | `{ bucket, from, to }` | | `DELETE /object/{bucket}` | `{ paths: [...] }` | | `PATCH /object/{bucket}/{path}/metadata` | Change your metadata | ### Uploads and signed URLs | Method and path | Does | | -------------------------------------------------------- | ------------------------------------------------------------ | | `POST /upload/resumable` | Start a tus upload (then `PATCH` its location) | | `POST /object/sign/{bucket}/{path}` | `{ expiresIn, transform?, download? }` → signed download URL | | `POST /object/upload/sign/{bucket}/{path}` | `{ expiresIn }` → signed upload URL and token | | `GET /object/public/{bucket}/{path}` on the content host | Public download, with transform options | ### Policies, keys and S3 | Method and path | Does | | ------------------------------------------------------------ | ----------------------------------------------- | | `GET /policies`, `POST /policies`, `DELETE /policies/{name}` | Policies on `sypnia_files.objects` (secret key) | | `POST /s3-keys`, `GET /s3-keys`, `DELETE /s3-keys/{id}` | S3 access keys | | `/s3/...` | The S3-compatible API | The OpenAPI document is in the engine's repository, at `spec/openapi.yaml`. --- ## Architecture > How Sypnia Files is built: its parts, where Rust runs, and how they connect. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/architecture/ For agents: Files architecture: one Rust binary (axum; libvips) with auth, object API, tus server, S3 gateway, image transformer, MCP; metadata and policies in Postgres (sypnia_files), bytes in S3-compatible storage; content host behind CDN serves public files and transforms and checks signed URLs; @sypnia/files TypeScript; console private. **Figure**: Sypnia Files: the API and the content edge, the engine's modules, and where metadata and bytes live. 1. Your app or a tool calls the Files API with a token, a key or S3 signatures. 2. The engine checks the token and runs the policy in Postgres. 3. Metadata goes to `sypnia_files` in Postgres; bytes go to S3-compatible storage. 4. Visitors get files and transforms from the content host through the CDN. Apps, S3 tools and agents call the Files API. The engine is one Rust binary with an auth module, the object API, the tus upload server, the S3 gateway, the image transformer and the MCP server. It keeps metadata and policies in Postgres and bytes in S3-compatible storage. The content host, behind the CDN, serves public files and image transforms and checks signed URLs. | Part | Language | Open source | | --------------------------------------------------- | --------------------------------------------------------- | --------------- | | Files engine: API, tus, S3 gateway, transforms, MCP | Rust (axum, libvips for images) | yes | | `@sypnia/files` | TypeScript | yes | | Content edge in Sypnia Cloud | CloudFront + Lambda running the engine's transform module | the module, yes | | Console | TypeScript (React) | no | - [Request paths](/architecture/request-paths/): An upload, a private download and an image transform, call by call. - [Data model](/architecture/data-model/): The sypnia_files schema: buckets, objects, uploads in progress, S3 keys and the functions policies use. - [Reference implementation on AWS](/architecture/reference-implementation-aws/): Every AWS service Files uses in Sypnia Cloud, and how. - [Failures and scaling](/architecture/failures-and-scaling/): What happens when storage, the database or scanning fails, and how Files grows. - [Codebase](/architecture/codebase/): How the open-source repository is organized. --- ## Request paths > An upload, a private download and an image transform, call by call. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/architecture/request-paths/ For agents: Files request paths: upload (JWT verified with cached JWKS, transaction as authenticated with claims, insert policy check, stream to storage with SHA-256, type sniffing, size enforcement, metadata row commit, scan queued → pending); signed download (sign endpoint checks select policy as user, HMAC over bucket/path/expiry/options; edge verifies signature without DB and fetches object); transform (CDN miss → function reads original if public or signed, libvips resize, EXIF stripped, long cache). ### An upload 1. `POST /object/avatars/user-42/photo.jpg` with `apikey` and the user's JWT reaches the engine. 2. The engine verifies the JWT with the project's JWKS (cached), finds the project and its database. 3. It opens a transaction as role `authenticated` with the JWT's claims, and runs the `insert` check of your policies against the row it is about to write. 4. It streams the body to storage, computing SHA-256 and sniffing the type, and enforces the size limit while streaming. 5. It writes the metadata row and commits. If scanning is on, it queues the scan and the row stays `pending`. ### A private download with a signed URL 1. The app asks `POST /object/sign/receipts/order-1042.pdf`; the engine checks the `select` policy as the user and returns a URL with an HMAC signature over bucket, path, expiry and options. 2. The browser opens the URL on the content host; the edge verifies the signature and the expiry without calling the database, and fetches the object from storage. ### An image transform 1. `GET https://.files.sypnia.app/menu/pan.jpg?width=600&format=webp` reaches the CDN. 2. On a cache miss, the transform function reads the original (public bucket, or a valid signature), resizes it with libvips, strips EXIF and returns it with a long cache time. 3. Later requests with the same options are served from the CDN. --- ## Data model > The sypnia_files schema: buckets, objects, uploads in progress, S3 keys and the functions policies use. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/architecture/data-model/ For agents: Files data model: sypnia_files.buckets (public, max_file_size, allowed_types, scan, cache_control, storage backend+prefix), objects (bucket_id, name, owner, size, content_type, checksum, scan_status not_scanned|pending|clean|infected, metadata, case; unique bucket+name; RLS on), uploads (resumable in progress), s3_keys (secret_hash, buckets, actions), audit; functions foldername/filename/extension; installed by sypnia-files install; storage key // so moves only update rows. | Table | Holds | | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sypnia_files.buckets` | `id`, `public`, `max_file_size`, `allowed_types`, `scan`, `cache_control`, `storage` (the backend and prefix), `created_at` | | `sypnia_files.objects` | `id`, `bucket_id`, `name`, `owner`, `size`, `content_type`, `checksum`, `scan_status` (`not_scanned`, `pending`, `clean`, `infected`), `metadata`, `case` (the [use case](https://files.docs.sypnia.com/buckets/use-cases) that last wrote it), timestamps; unique on (`bucket_id`, `name`); **row-level security on** | | `sypnia_files.uploads` | resumable uploads in progress: `id`, `bucket_id`, `name`, `owner`, `offset`, `size`, `expires_at`, the storage upload id | | `sypnia_files.s3_keys` | `id`, `secret_hash`, `buckets`, `actions`, `created_by`, `last_used_at` | | `sypnia_files.audit` | key and admin actions | Functions: `sypnia_files.foldername(text) returns text[]`, `filename(text)`, `extension(text)`. The schema is installed by the engine's migrations (`sypnia-files install`) and never edited by hand. In storage, an object lives at `//`, not at its path: moving a file only updates its row. --- ## Reference implementation on AWS > Every AWS service Files uses in Sypnia Cloud, and how. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/architecture/reference-implementation-aws/ For agents: Files on AWS: CloudFront (API host .files.sypnia.com) → Lambda engine (API, tus, S3 gateway, MCP); CloudFront content host .files.sypnia.app with edge signed-URL checks and Lambda transform function; S3 objects under / with SSE-KMS per project and 7-day versioning; GuardDuty Malware Protection for S3 on scan buckets → EventBridge → scan_status; KMS per project; RDS Postgres (sypnia_files in project DB); CloudWatch. **Figure**: Sypnia Files on AWS: the API function, the content CDN with the transform function, S3, and the scanning pipeline. The API runs as a Lambda function behind CloudFront at the project's files address. Objects are in S3 under the project's prefix, encrypted with the project's KMS key. The content host is a second CloudFront distribution in front of S3 and of a transform function. GuardDuty Malware Protection scans new objects in scanning buckets and reports through EventBridge, which updates the object's status. | Service | Used for | | ------------------------------------------ | ----------------------------------------------------------------------------------- | | CloudFront (API) | `.files.sypnia.com`, TLS, routing to the engine | | AWS Lambda | the engine (API, tus, S3 gateway, MCP) and the image transform function | | CloudFront (content) | `.files.sypnia.app`, cache, signed URL checks at the edge | | Amazon S3 | objects, under `/…`, SSE-KMS with the project's key, versioning for 7 days | | Amazon GuardDuty Malware Protection for S3 | scanning objects in buckets with `scan: on` | | Amazon EventBridge | scan results → the engine updates `scan_status` | | AWS KMS | one key per project | | Amazon RDS for PostgreSQL | `sypnia_files` in the project's database | | CloudWatch | logs and metrics | --- ## Failures and scaling > What happens when storage, the database or scanning fails, and how Files grows. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/architecture/failures-and-scaling/ For agents: Files failures: DB down (uploads/list/token downloads 503; public and signed URLs keep serving), storage down (503 Retry-After; cached served), partial uploads (resumable continue; abandoned expire 24 h, parts deleted), scanner down (scan buckets stay pending 423, never served unscanned, retries, notify after 1 h), transform failure (422; original available). Scaling with S3/CDN; stateless engine; streaming uploads. | What fails | Effect | What Files does | | ---------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------- | | The database | uploads, listing and private downloads by token fail (`503`) | public files and valid signed URLs keep being served by the CDN | | Storage | uploads and cache misses fail | cached files keep being served; uploads return `503` with `Retry-After` | | An upload midway | nothing is visible | resumable uploads continue; abandoned ones expire after 24 hours and their parts are deleted | | The scanner | new files in scanning buckets stay `pending` (`423`) | files are never served unscanned; scans retry; you are notified past an hour | | A transform | `422` for that image | the original stays available; broken images are reported in the log | Files scale with S3 and the CDN. The engine is stateless; uploads stream without buffering whole files, so memory does not grow with file size. --- ## Codebase > How the open-source repository is organized. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/architecture/codebase/ For agents: Files codebase: crates core, objects, tus, s3, transform (libvips), storage (S3-compatible, local), scan (GuardDuty, ClamAV), install (schema), server (binary, Lambda, CLI, MCP); packages/files (@sypnia/files); deploy (compose, AWS template); spec; docs. ```text sypnia-files/ ├── crates/ │ ├── core/ config, project registry, auth (JWKS, keys, S3 signatures), errors, audit │ ├── objects/ buckets, objects, policies through Postgres, signed URLs │ ├── tus/ the resumable upload server │ ├── s3/ the S3-compatible gateway │ ├── transform/ image transforms (libvips), EXIF removal │ ├── storage/ backends: S3-compatible, local folder │ ├── scan/ scanning hooks: GuardDuty events, ClamAV │ ├── install/ the sypnia_files schema, versioned │ └── server/ the binary, Lambda adapter, CLI, MCP ├── packages/files/ @sypnia/files (client, server, react, CLI) ├── deploy/ docker-compose, the AWS template ├── spec/ openapi.yaml └── docs/ ARCHITECTURE.md ``` --- ## Self-hosting > Run the engine with Docker or on AWS against your own storage and Postgres. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/self-hosting/ - [Docker](/self-hosting/docker/): The engine's image and the compose file with MinIO and Postgres. - [AWS](/self-hosting/aws/): The AWS template: Lambda, CloudFront, S3 and RDS or your Postgres in your account. - [Configuration](/self-hosting/configuration/): Every environment variable of the engine. - [Upgrades and backups](/self-hosting/upgrades/): Upgrading the engine and what to back up. --- ## Docker > The engine's image and the compose file with MinIO and Postgres. Applies to: the Sypnia engine (open source, self-hosted). Source: https://files.docs.sypnia.com/self-hosting/docker/ For agents: Files Docker: ghcr.io/sespinosav/sypnia-files (amd64/arm64, non-root) runs sypnia-files serve on :7500, install on first start; compose adds Postgres 16, MinIO, ClamAV when SYPNIA_FILES_SCAN=clamav; put a CDN/proxy in front; private until release. ```bash docker run -p 7500:7500 --env-file .env ghcr.io/sespinosav/sypnia-files:latest ``` The image (amd64 and arm64, non-root) runs `sypnia-files serve`; on first start with an empty database it runs `install`. The compose file in the repository adds Postgres 16 and MinIO, and ClamAV when `SYPNIA_FILES_SCAN=clamav`. Put a CDN or a reverse proxy in front for public files and HTTPS. The image is private until the first release. --- ## AWS > The AWS template: Lambda, CloudFront, S3 and RDS or your Postgres in your account. Applies to: the Sypnia engine (open source, self-hosted). Source: https://files.docs.sypnia.com/self-hosting/aws/ For agents: Files AWS template deploy/aws.yaml: Lambda engine behind CloudFront (API), second CloudFront for content with transform function, S3 SSE-KMS, KMS key, RDS or DatabaseUrl; parameters Domain, ContentDomain, CertificateArn, DatabaseUrl, JwksUrl, Scan none|guardduty; use a content domain outside the app domain for cookie safety. `deploy/aws.yaml` creates in your account: the engine as a Lambda function behind CloudFront (API), a second CloudFront distribution for content with the transform function, an S3 bucket with SSE-KMS, a KMS key, and RDS PostgreSQL or the connection to yours. Parameters: `Domain`, `ContentDomain`, `CertificateArn`, `DatabaseUrl`, `JwksUrl`, `Scan` (`none`, `guardduty`). ```bash aws cloudformation deploy --template-file deploy/aws.yaml --stack-name sypnia-files --parameter-overrides Domain=files.example.com ContentDomain=cdn.example.net CertificateArn=arn:aws:acm:… --capabilities CAPABILITY_IAM ``` Use a content domain that is not a subdomain of your app's main domain, so uploaded files can never read your app's cookies. --- ## Configuration > Every environment variable of the engine. Applies to: the Sypnia engine (open source, self-hosted). Source: https://files.docs.sypnia.com/self-hosting/configuration/ For agents: Files engine env: SYPNIA_FILES_DATABASE_URL, _STORAGE s3|local, _S3_ENDPOINT/_BUCKET/_REGION/_ACCESS_KEY_ID/_SECRET_ACCESS_KEY, _JWKS_URL/_ISSUER/_AUDIENCE, _SECRET_KEY, _SIGNING_KEY (HMAC signed URLs), _PUBLIC_URL, _MAX_DIRECT_UPLOAD (50MB), _SCAN none|clamav|guardduty. | Variable | Default | Meaning | | ---------------------------------------------------------------------------------------- | -------------------- | --------------------------------------- | | `SYPNIA_FILES_DATABASE_URL` | — | Postgres 14+ for `sypnia_files` | | `SYPNIA_FILES_STORAGE` | `s3` | `s3` or `local` | | `SYPNIA_FILES_S3_ENDPOINT`, `_BUCKET`, `_REGION`, `_ACCESS_KEY_ID`, `_SECRET_ACCESS_KEY` | AWS defaults | Your S3-compatible storage | | `SYPNIA_FILES_JWKS_URL`, `_ISSUER`, `_AUDIENCE` | — | The issuer of your users' JWTs | | `SYPNIA_FILES_SECRET_KEY` | generated at install | The secret key (store it as a secret) | | `SYPNIA_FILES_SIGNING_KEY` | generated at install | The HMAC key of signed URLs | | `SYPNIA_FILES_PUBLIC_URL` | — | The content address used in public URLs | | `SYPNIA_FILES_MAX_DIRECT_UPLOAD` | `50MB` | Above this, resumable uploads | | `SYPNIA_FILES_SCAN` | `none` | `none`, `clamav`, `guardduty` | --- ## Upgrades and backups > Upgrading the engine and what to back up. Applies to: the Sypnia engine (open source, self-hosted). Source: https://files.docs.sypnia.com/self-hosting/upgrades/ For agents: Files upgrades: new image or stack update; migrations on start; refuses newer schema. Back up Postgres (sypnia_files) and storage (versioning/replication) together; sypnia-files doctor reports orphan rows and orphan files. Upgrade by pulling a new image (or updating the stack); the engine runs schema migrations on start and refuses to start against a newer schema than it knows. Back up two things: the Postgres database (`pg_dump` of `sypnia_files`, with your tables) and the storage bucket (versioning or replication). A backup of only one of them leaves rows without files or files without rows; `sypnia-files doctor` reports both kinds. --- ## Security > Policies, content isolation, malware scanning, the threat model and the checklist. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/security/ - [Threat model](/security/threat-model/): What could go wrong in Sypnia Files, and how each threat is answered. - [Malware scanning](/security/malware-scanning/): How scanning works per bucket, what pending and infected mean, and what you see. - [Checklist](/security/checklist/): What to check before your buckets hold real files. --- ## Threat model > What could go wrong in Sypnia Files, and how each threat is answered. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/security/threat-model/ For agents: Files threat model: cross-user access (default deny, policies as user), active content (separate content domain files.sypnia.app, CSP sandbox, nosniff, active types as downloads), fake types (byte sniffing), malware (scan buckets, quarantine), leaked signed URL (expiry, signed options), secret key in browser (Origin refused, rotate), decompression/transform bombs (50 MP / 25 MB), storage exhaustion (per-project quotas). | Threat | Answer | | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | A user reads or overwrites another user's files | default deny; every operation checked against policies as that user | | An uploaded HTML or SVG file runs scripts with your app's or Sypnia's cookies | files are served from a separate domain (`files.sypnia.app`), with `Content-Security-Policy: sandbox` and `X-Content-Type-Options: nosniff`; active types are sent as downloads unless the bucket allows inline | | A file pretends to be an image | the type is sniffed from the bytes and checked against `allowedTypes` | | Malware is uploaded and shared | optional scanning per bucket; infected files are never served and are quarantined | | A signed URL is leaked | it expires; its options are signed; buckets can require short expiries | | A secret key reaches a browser | refused when sent with an `Origin` header; rotate with `files keys rotate` | | A transform bomb (huge dimensions) | originals limited to 50 megapixels and 25 MB for transforms | | One project fills shared storage | per-project quotas; uploads refused past them | --- ## Malware scanning > How scanning works per bucket, what pending and infected mean, and what you see. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/security/malware-scanning/ For agents: Files malware scanning per bucket (scan: on): pending → 423 scan_pending (SDK can wait), clean → allowed by policy, infected → 423 infected, quarantined 30 days then deleted; Cloud uses GuardDuty Malware Protection for S3; engine ClamAV or GuardDuty; file.infected webhook and console notice with uploader; detects known malware only. With `scan: on`, every new file in the bucket is scanned before it can be downloaded. | `scan_status` | Download | | ------------- | ---------------------------------------------------------------------------------------- | | `pending` | refused with `423 scan_pending`; the SDK can wait for it | | `clean` | allowed by your policies | | `infected` | refused with `423 infected`; the file is moved to quarantine, kept 30 days, then deleted | In Sypnia Cloud the scanner is Amazon GuardDuty Malware Protection for S3. Self-hosted, the engine supports ClamAV or GuardDuty. A webhook (`file.infected`) and the console tell you when a file is quarantined, with who uploaded it. Scanning detects known malware; it does not make a file safe to open. Keep serving user files from the separate content domain. --- ## Checklist > What to check before your buckets hold real files. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/security/checklist/ For agents: Files checklist: minimal policies per private bucket; public upload buckets with maxFileSize, allowedTypes, scan when shared; shortest signed URL expiry; secret key only on servers, scoped S3 keys; public buckets only indexable content; self-hosted back up DB and storage together. - [ ] Every private bucket has policies for exactly the operations you need; nothing broader than `own folder` unless intended. - [ ] Buckets that accept uploads from the public have `maxFileSize`, `allowedTypes` and, if files are shared with others, `scan: on`. - [ ] Signed URLs use the shortest expiry that works. - [ ] The secret key is only on servers; S3 keys are scoped to the buckets they need. - [ ] Public buckets contain only what you want indexed by search engines. - [ ] You back up the database and the storage together (self-hosted). --- ## Sypnia Cloud > Projects, metering in credits, limits and plans. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/cloud/ In Sypnia Cloud, Files belongs to a **project** of your organization, the same project your other Sypnia products use. You sign in with your Sypnia account, and what Files uses is paid from your prepaid credits. - [Credits and limits](/cloud/credits-and-limits/): What Files measures, how it is paid with credits, and its limits. - [Plans](/cloud/plans/): How Files is sold: on its own, in the global Sypnia subscription, and with extra capacity. --- ## Credits and limits > What Files measures, how it is paid with credits, and its limits. Applies to: Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/cloud/credits-and-limits/ For agents: Files in Sypnia Cloud: metered items, plan amounts, overage from prepaid credits, extra capacity per item, no post-paid charges, limits published with plans. ### What is measured | Item | Unit | | ---------------- | ----------------------------------------- | | Storage | GB-months, averaged over the month | | Transfer | GB sent to downloads and transforms | | Image transforms | distinct transforms made | | Requests | thousands of uploads and other operations | | Malware scans | GB scanned | The console shows usage per day and what it will cost in credits by the end of the month at the current pace. ### How it is paid Every plan includes an amount of each item. What goes beyond it is charged against your **prepaid credits**, item by item, at prices published with the plans. You can also buy **extra capacity** for one item for the month. There are no charges after the fact. Credits are bought in [App](https://app.docs.sypnia.com/account/credits), from USD 5. They expire 12 months after you buy them, and the oldest are spent first. Credits are not refunded, except when the mistake is ours, and then only in credits. ### Limits Each plan sets: buckets per project, the largest file, storage, monthly transfer, transforms per month, and whether scanning is available. The values are published with the plans. --- ## Plans > How Files is sold: on its own, in the global Sypnia subscription, and with extra capacity. Applies to: Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/cloud/plans/ For agents: Files plans: on its own, global Sypnia subscription tiers, per-item extra capacity; all prepaid; larger of product plan vs tier per item; when credits run out: notices at 80/100 %, 7 days of grace with everything working, then uploads past the plan refused; no file deleted. ### Three ways to pay for Files 1. **Files on its own.** A free plan and paid plans for Files alone, like buying object storage. 2. **The Sypnia subscription.** One monthly subscription with every Sypnia product, in tiers that each include an amount of Files. 3. **Extra capacity.** On any plan, buy more of one item for the month without changing plan. Everything is **prepaid**: a monthly subscription paid in advance, or credits you top up. When a product plan and a global tier both include Files, you get the larger amount of each item. ### When credits run out 1. When **80 %** of your credits are spent, counted from the balance after your last top-up, the owners and billing members get an e-mail and a notice in the app; again at **100 %**. 2. From then on there are **7 days of grace**: uploads, downloads, public files and image transforms keep working as on your plan, and nothing is deleted. 3. After the 7 days, the project keeps its files and its downloads; uploads past the plan's amounts are refused with `insufficient_storage` until credits are added. **No file is deleted** for lack of credits. --- ## Reference > Glossary, design decisions, the changelog and common questions. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/reference/ - [Glossary](/reference/glossary/): Every word these docs use with a fixed meaning. - [Design decisions](/reference/decisions/): The choices behind Sypnia Files, and why each one was made. - [Common questions](/reference/faq/): Short answers to what people ask first about Sypnia Files. - [Changelog](/reference/changelog/): What changed in Sypnia Files, newest first. --- ## Glossary > Every word these docs use with a fixed meaning. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/reference/glossary/ For agents: Sypnia Files vocabulary: bucket, path, object, public bucket, private bucket, policy, signed URL, signed upload URL, resumable upload, transform, content host, scan status, quarantine, S3 access key, publishable key, secret key, engine. One name per thing, in these docs, in the console and in the API. **Bucket**: A top-level container of files, public or private, with its own limits. **Content host**: The separate domain that serves files: `.files.sypnia.app`. **Engine**: The open-source Files you can run yourself. **Object**: A stored file and its metadata row. **Path**: The name of a file inside its bucket, such as `receipts/2026/order-1042.pdf`. **Policy**: A Postgres row-level security rule on `sypnia_files.objects` that allows an operation. **Resumable upload**: An upload sent in parts that continues after a dropped connection. **S3 access key**: A key for S3 tools, limited to chosen buckets and actions. **Scan status**: `not_scanned`, `pending`, `clean` or `infected`. **Secret key**: The project key for servers; it bypasses policies. **Signed URL**: A link to one file that works for anyone until it expires. **Transform**: A resized, cropped or converted copy of an image, made from options in its address. --- ## Design decisions > The choices behind Sypnia Files, and why each one was made. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/reference/decisions/ For agents: Sypnia Files design decisions: files are served on .files.sypnia.app (sypnia.app is in the Public Suffix List), never under sypnia.com; malware scanning is off by default, with a console warning on buckets that accept public uploads; video is stored and served as files, without transcoding to adaptive streams; the largest file is 50 GB on paid plans and 50 MB on the free plan; one pair of publishable and secret keys per project for every product, with scopes per product; licenses: AGPL-3.0 engine, MIT @sypnia/files. | # | Decision | What Sypnia Files does, and why | | - | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 1 | **The content domain** | Files are served on `.files.sypnia.app`. `sypnia.app` is in the Public Suffix List, so a file can never set cookies for another project, and user files are never served under `sypnia.com`, where Sypnia's sessions live. | | 2 | **Malware scanning** | Off by default, with a console warning on buckets that accept public uploads; turn it on per bucket ([Bucket settings](https://files.docs.sypnia.com/buckets/metadata-and-quotas)). | | 3 | **Video** | Stored and served as files, without transcoding to adaptive streams: Files is not a streaming service. | | 4 | **Largest file** | 50 GB on paid plans, 50 MB on the free plan. | | 5 | **Keys shared with Data** | One pair of publishable and secret keys per project for every Sypnia product, with scopes per product on each key, so one key never opens more than it should. | | 6 | **Licenses** | AGPL-3.0 for the engine (a hosted copy must share its changes) and MIT for `@sypnia/files`, like every Sypnia engine and SDK. | --- ## Common questions > Short answers to what people ask first about Sypnia Files. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/reference/faq/ #### How do I use it? In Sypnia Cloud with your Sypnia account, ready to use, or self-hosted: the open-source engine runs in your own account. #### How is it different from Supabase Storage or Amazon S3? Like Supabase Storage, rules are Postgres policies with `auth.uid()`; unlike it, the engine runs on any S3-compatible storage and any JWT issuer. Compared with S3 alone, you get rules per user, resumable uploads, image transforms and a CDN without building them. #### Do I need Sypnia Data? No. With Data in the same project, policies can join your tables. Without it, Files uses its own Postgres and your issuer's JWTs. #### Can I keep the files in my own bucket? Yes: [bring your own bucket](https://files.docs.sypnia.com/s3/bring-your-own-bucket). #### Can I leave? Yes. Objects are in S3-compatible storage and metadata in Postgres; copy both with standard tools. --- ## Changelog > What changed in Sypnia Files, newest first. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://files.docs.sypnia.com/reference/changelog/ ### 2026-11-17 Sypnia Files and its documentation: buckets, policies, signed URLs, direct and resumable uploads, image transforms and the CDN, the S3 API, bring-your-own bucket, malware scanning, the SDK, CLI and MCP, the API, the architecture on AWS, self-hosting, security and Sypnia Cloud.