# Isolation

> How builds and apps of different customers are kept apart in Sypnia Cloud.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://run.docs.sypnia.com/architecture/isolation/

For agents: Run isolation in Cloud: builds in fresh per-build CodeBuild containers with per-project IAM role (read own source, write own prefix, no Run API, no SSM, no control-plane network), secrets only when marked build-time; apps in Firecracker micro-VMs (Lambda, Fargate) with per-app execution/task roles limited to own parameters and project KMS key; static files per-deploy prefixes read only by CloudFront OAC; no shared VPC for functions, Fargate security groups allow only the ALB; function URLs require CloudFront signing; customer apps on sypnia.app (Public Suffix List) never sypnia.com; shared: cell CloudFront, ALB, quotas, with per-project limits; dedicated cells for hard separation.

In Sypnia Cloud many customers' code runs in the same AWS accounts. These are the walls between them.

## Builds

- Every build runs in its own CodeBuild container, created for that build and destroyed after it. Nothing persists between builds except the cache Run restores explicitly, which is per app.
- The build assumes a **per-project IAM role** that can read only its source archive and write only under its own artifact prefix. It cannot call the Run API, read other prefixes, read Parameter Store or reach the control plane's network.
- Secrets reach a build only when marked for build time, injected as environment variables for that build alone and masked in logs.
- Build containers have outbound internet (package registries) and no inbound access.

## Running apps

- **Lambda** runs each function in Firecracker micro-VMs; Run creates functions per app, with an **execution role per app** that can read only that app's parameters and decrypt only with its project's KMS key.
- **Fargate** tasks also run in Firecracker micro-VMs, one task definition and task role per app.
- **Static files** are under per-deploy prefixes that only CloudFront reads; an app cannot list or read another app's files.
- **Networking:** functions run outside any shared VPC by default; Fargate tasks are in per-cell subnets with security groups that allow traffic only from the load balancer. Apps cannot reach each other or the control plane.
- **Origin protection:** a Lambda function URL accepts only CloudFront-signed requests (origin access control), so nobody can skip the edge router and call another app's server directly.

## Addresses and cookies

Customer apps are served on `sypnia.app`, a domain listed in the Public Suffix List, so browsers treat `ana.sypnia.app` and `laespiga.sypnia.app` as separate sites and no app can set cookies for another. Sypnia's own products and sessions live on `sypnia.com`, which customer code never serves.

## What is shared

The CloudFront distribution, the load balancer and AWS account quotas of a cell. Run limits each project's share (concurrency, tasks, build minutes) so one project cannot exhaust a cell. Customers who need hard separation get a **dedicated cell** (their own AWS account), priced separately ([Design decisions](https://run.docs.sypnia.com/reference/decisions)).
