Network & residency

Where your data is processed is a setting, not a hope.

Your workspace pins a jurisdiction. That pin rides every call — standard runs included — and several parts of this system would rather stop than run somewhere the pin does not cover. Those refusals are quoted below, verbatim from the code.

CH · EU · UK · US are placeable · WORLD is a real setting and it disables placement

Workspace region

  • CHPlaceable
  • EUPlaceable
  • UKPlaceable
  • USPlaceable
  • WORLDNot placeable

CH is the default for a new workspace. Change it in Settings → Security & Data.

Where compute runs

Four places, and what each one is allowed to hold.

“The cloud” is not an answer to a residency question. These are the four systems your data can touch, what each holds, and which agreement covers it.

Edge

The API and dashboard

Everything you call runs as a Cloudflare Worker at the edge. Parsed uploads live in Cloudflare KV under a native 24-hour TTL — expiry is the storage layer’s job, not a cleanup task that can quietly stop running.

Residency · Global PoPs, with per-customer region selection available on Cloudflare Enterprise — the plan on which the BAA is offered. See /legal/subprocessors §2.

State

The account database

Authentication, sessions, the wallet, the rate-limit ledger, the audit log and upload metadata sit in Supabase Postgres. In schema-only mode the stored sample is clamped to ≤3 rows of ≤80 characters and the full row set is null.

Residency · US or EU per project; Ireland for EU workloads, as named in DPA Article 8. HIPAA eligibility requires the Supabase HIPAA add-on on the operating organisation.

Compute

Models and the program sandbox

Layer-5 AI cleanup and the reshape program sandbox both run through phi-cloud. A PHI call carries X-PHI and X-Region so the gateway is forced to pick a PHI-eligible model physically inside the jurisdiction you pinned.

Residency · The region is the placement decision; X-PHI is only the catalogue decision. Both are sent — see /routing for how they are resolved.

Execution

The Excel runner

Macro execution needs a real, licensed Excel, so it runs on a Windows host we operate rather than in a Worker. It is the only part of the system that opens your workbook in an application, and it is the most tightly fenced.

Residency · Our own VM, in-region, no egress; the network security group admits port 443 only from Cloudflare’s egress ranges.

  • CH · EU · UK · US placement
  • X-Region on every PHI call
  • Sandbox refuses region-less runs
  • BAA host allowlist fails closed
  • Uploads expire in KV at 24h

The region pin

One setting decides where compute may run.

PHI and standard are a separate axis: X-PHI picks which model catalogue is eligible, the region picks the ground the work is allowed to stand on. Both are sent. Zeroing the region on a standard run once broke every standard code-strategy reshape, which is exactly how load-bearing it is.

RegionWhat it meansSandbox placementNotes
CHThe default for a new workspacePlaceableSwiss-resident inference under nFADP. The Excel runner’s reference deployment is switzerlandnorth.
EUEU-resident processingPlaceableSupabase runs in Ireland for EU workloads (DPA Art. 8). GDPR with SCCs in the DPA.
UKUK-resident processingPlaceableCovered by the same DPA under UK GDPR / DPA 2018.
USUS-resident processingPlaceableThe region the general (non-PHI) model ladder pins itself to, because those model rows serve US.
WORLDNo pinNot placeableThe program sandbox refuses a run with this setting rather than choosing a jurisdiction for you.

Workspace regions come from ALLOWED_REGIONS in lib/workspaceSettings.ts; the placeable set is SANDBOX_REGIONS in lib/reshape/sandbox.ts. WORLD is deliberately absent from the second list.

Retention is pinned in the same place: uploads are held for 0, 24, 168 or 720 hours, with 24 the default and the underlying Cloudflare KV TTL doing the expiry. See what we store and for how long.

Fail-closed

Four places this system stops instead of guessing.

Fail-open is the default failure mode of most infrastructure, and it is the wrong one for regulated data. Each of these paths refuses, names the variable that would have permitted it, and returns a message you can put in a ticket.

No jurisdiction, no run

The reshape program sandbox will not execute against a workspace whose region is unset or WORLD. It stops with an error naming the jurisdictions it will accept, rather than defaulting to whichever one is nearest.

Verbatim · “sandbox requires a jurisdiction with a compliant placement (one of CH, EU, UK, US); workspace region is unset” — sandboxPreflight() in lib/reshape/sandbox.ts.

No allowlisted host, no PHI

Full-data traffic is only permitted to leave for a hostname explicitly listed as BAA-covered. In production, an unset allowlist does not mean “allow everything” — it means full-data routing refuses outright.

Verbatim · “phi_host_not_baa_covered: MAPR_PHI_ALLOWED_HOSTS unset in production — full-data PHI requests cannot be routed without an explicit BAA-host allowlist” — lib/llm.ts. /api/health reports the same component as down.

No declared boundary, no execution

A PHI-routed macro run is refused unless the Excel host has been explicitly declared inside the BAA boundary. Being reachable over https is not enough — https proves the wire is encrypted, not that the far end is covered.

Verbatim · “excel_runner_not_phi_covered: this run is PHI-routed but MAPR_EXCEL_RUNNER_PHI_OK is not set — the runner host is not declared inside the BAA boundary” — excelRunnerRefusal() in lib/excelRunner.ts.

No tenant key, no sandbox

The sandbox refuses to execute on the platform’s own phi-cloud account. Every workspace gets its own sub-key, so consumption and cost attribute to the tenant that caused them and nothing is pooled.

Verbatim · “sandbox requires a per-tenant phi-cloud key; refusing to bill the platform account” — sandboxPreflight() in lib/reshape/sandbox.ts.

The Excel runner

The one host that opens your workbook.

We read macros without executing them everywhere else in the product. Executing one needs a real Excel, so it happens on a machine we operate and fence — and that machine is refused PHI traffic until it is explicitly declared inside the BAA boundary.

posture
# infra/excel-runner — the posture, not the marketing version.

Host          Windows VM we operate, licensed Excel, in-region
              (switzerlandnorth for the CH default)
Network       No egress. NSG admits :443 from Cloudflare ranges only.
Transport     https required (MAPR_EXCEL_RUNNER_URL), bearer key
Concurrency   One run at a time — a second request gets 503 busy
Process       New Excel process per run (DispatchEx), killed on
              timeout (max 300 s) or on any exit path
PHI           Refused unless MAPR_EXCEL_RUNNER_PHI_OK=1 declares the
              host inside the BAA boundary
Outage        The checked code still ships, flagged execution_skipped
→ /api/health carries an “Excel runner” component; unconfigured is reported as such, not as healthy

Reading is free and deterministic

The macro report — modules, entry points, risky-call signals, Excel 4.0 macro sheets — is produced by parsing the file. No execution, no model, no charge.

A password is not encryption

A DPB-protected VBA project is a UI lock. We recover the source regardless, and we never present that flag to you as protection.

Execution is opt-in and metered

Running a procedure is billed per second with a five-second floor, and a PHI-routed run pays the same 20% uplift as the rest of the charge.

An outage does not fake a result

If the runner is unreachable, the authored and checked code still ships — flagged execution_skipped, so you know it was never actually run.

Residency, per workspace

Pin a jurisdiction, and the pin travels.

Set the region once in Settings → Security & Data. Every run carries it, and the parts that cannot honour it stop rather than improvise.

No free tier · prepaid wallet from $10 · PHI routing +20%, in-region under a BAA
Network & data residency — AdaptivMapr — AdaptivMapr