The Fabrika platform, for the people who have to sign off on it

A single-tenant platform in your company's own cloud account. One gate in front of every app, access declared in code and approved by people, deploys, e-mail and operations in one console. The code is public, so you can check all of this.

Fabrika console overview with deploys, approvals and errors across the company's apps

Architecture

One installation per company, in a cloud account in the company's name. Only the proxies take traffic from the internet.

Internet: browsers, integrations with machine keys, forms on your website
Your cloud account

Zerops

Proxy

The only way into an app. Caddy and a Bun auth service, one per deployment namespace (the apps of one environment).

Apps

No public address.

Bun services on Alpine, PostgreSQL 18.

IAM

OIDC and password sign-in, sessions, roles and grants per app, machine keys, audit and sign-in log, JWKS.

Bun service, PostgreSQL.

Control

App registry, environments, deploy runs, access snapshots and approvals, mail relay, console.

Bun service, PostgreSQL. Hands app sources to Zerops to build.

Operations

Error ingest (Sentry protocol), releases and source maps, health checks, webhook alerts.

Bun service, its own PostgreSQL and bucket.

Cloudflare

Proxy

The only way into an app. A public proxy Worker per app environment, in front of the app's private Worker.

Apps

No public address.

Workers with no routes and workers.dev off, reached only through their proxy. From 0.9 (preview), each environment runs in a Durable Object with its SQLite.

IAM

OIDC and password sign-in, sessions, roles and grants per app, machine keys, audit and sign-in log, JWKS.

Worker, D1.

Control

App registry, environments, deploy runs, access snapshots and approvals, mail relay, console.

Worker, D1. Deploys run in a Cloudflare Container that clones the repository.

Operations

Error ingest (Sentry protocol), releases and source maps, health checks, webhook alerts.

Worker, D1.

The path of one request

First visit of the day. The proxy and the app share the app's domain; IAM has its own.

  1. 01

    Browser → proxy

    https://crm.example.com/ resolves to the app's proxy: the namespace proxy on Zerops, the app environment's proxy Worker on Cloudflare.

  2. 02

    Proxy

    Drops incoming X-Fabrika-* headers, requires a canonical path, selects exactly one endpoint from the host's table. No match, or a missing or malformed table: refused.

  3. 03

    Proxy → IAM

    No session: state and PKCE verifier (in a __Host- cookie), redirect to IAM. API calls get a 401 with a login URL.

  4. 04

    IAM

    Return address must be a registered origin, otherwise 400. Sign-in with SSO, password, or “Continue as…”.

  5. 05

    IAM → proxy

    Single-use code, valid two minutes, bound to session, app, return URL and PKCE challenge.

  6. 06

    Proxy

    Host-only __Host-px_session cookie, a child of the IAM session. No cookie shared between hosts, one sign-in across unrelated domains.

  7. 07

    Proxy → app

    Checks caller kind, action and admission rules (Sec-Fetch-Site, Content-Type, origin allowlist), strips its cookies, passes the endpoint name and a five-minute JWT, reused while fresh.

  8. 08

    App

    Verifies the JWT against IAM's JWKS and the rules digest. On Zerops, refuses requests without the per-app proxy secret (health checks aside); on Cloudflare, the app Worker has no route, so only its proxy can call it.

  9. 09

    App → database

    Runtime checks the action on the object; every query on a scoped table gets the scope condition.

Signing out or disabling someone in IAM ends every app session derived from that sign-in. Issued tokens expire within five minutes.

Access model

Apps declare their objects, actions and roles in code, like policies in a cloud IAM. People decide who holds which role.

On a demo app: the vocabulary of actions, the roles, an endpoint's and a table's access in code, then a request the proxy refuses.

The app declares its vocabulary

Dimensions form the object hierarchy, actions are what someone can do, roles bundle actions and are granted globally or on one object. Grants inherit downwards and only allow; there are no deny rules.

src/vocabulary.ts
export const vocabulary = defineVocabulary({
  app: 'crm',
  dimensions: {
    org: { members: { manage: 'members.manage', list: 'crm.read' } },
    company: { in: 'org' },
    deal: { in: 'company' },
  },
  actions: {
    'crm.read': 'Read companies and deals',
    'deals.write': 'Create deals and move them through the pipeline',
    // …
  },
  roles: {
    sales: {
      grants: ['crm.read', 'deals.write'],
      member: { scope: 'org', assignableBy: ['manager'] },
    },
    // …
  },
})

Each endpoint names what it needs

No authentication code in the handler. The proxy and the runtime enforce the access line, and the deploy approval shows a person when it changes.

Tables carry their own policy

Each table names the action for read, insert, update and delete, and the writable columns. The data layer scopes every query, so one org can't read another's rows. An unscoped table or raw SQL has to be declared.

src/deals/endpoints.ts
move: r.mutation({
  input: MoveDeal,
  output: Saved,
  // deals.write on this deal, or on its company or org
  access: { action: 'deals.write', on: 'deal', from: 'id' },
}).handle(async ({ input, ctx }) => {
  // ctx.db.target is already narrowed to the one deal
  // …
})

Roles from code, assignments from people

Deploys update role definitions and keep assignments, so a new version can't quietly add or remove access.

App owners manage their people

The owner assigns roles in the console, only to people already in IAM and only roles whose actions they hold. A user administrator can be limited to one app.

People outside the company

An external role limited to their own data; password set from an e-mailed link, in Czech or English.

Machine keys

px_ keys bound to one app, exchanged for short-lived tokens. They expire; permissions are editable without rotating the secret.

Share links and connectors

Object-bound links and app-to-app calls are declared capabilities that go through the proxy and show up in the approval.

Audit log

Sign-ins, sign-outs and IAM changes (grants, users, keys) are written in the same transaction. Deploys, approvals and mail decisions record who made them.

People screen in the console: an app owner assigns the app's roles without IT
Audit log in the console listing grants, created keys and sign-in decisions

Deploy approvals

AI agents tend to loosen whatever stopped them. So anything in a new commit that widens access compared with production waits for a named person.

On a demo app: an agent's change as a diff, and what the approval page reads from it.

How the comparison is made

Control pins the commit and reads its access snapshot without running its code, then marks each line against the target environment as widening, narrowing or unchanged. It reads the commit, not what the build reports, so an agent can't talk its way past it.

What the snapshot contains

Endpoints and who may call them, roles, table and column policies, public endpoints, jobs, webhooks, connectors, outside addresses, mail senders, file types and limits, rate limits, every SQL migration with its checksum.

Lines marked “needs closer review” still widen, and the approver reads the code behind them: raw SQL, unscoped tables, new outside addresses and connectors, issuing share links, sending through the installation's mail, database code in a migration, anything anyone can call without signing in, a GET that changes data, and people's e-mail addresses becoming visible.

Approval detail in the console: a parked production deploy with lines that widen access and lines marked for closer review

From commit to production

Every deploy takes this path. A step either lets the run on, or ends it the way shown on the right.

  1. A new commit

    pushed, tagged, or started from the console, the CLI or the AI builder

  2. 1

    Its contract file

    The commit must carry the contract that says what the app exposes and to whom.

    missing: fails before any cloud provider is called

  3. 2

    Compared with the target

    Control reads the snapshot from the commit and marks every line as widening, narrowing or unchanged.

    nothing widens: deploys at once

  4. 3

    A protected environment

    Production is protected by default. access.approve holders switch it per environment; switching off approves nothing already waiting, and is audited.

    not protected: deploys

  5. 4

    Parked, not published

    The run waits and the old access stays live.

    cancelled: the run ends

  6. 5

    A person approves

    Approving needs access.approve, held by a human and used in the console. No machine key can approve, not even the one that started the deploy.

    refused: the run fails

  7. 6

    Still current

    The approval holds only for the lines it showed.

    the environment changed meanwhile: compared again

  8. Deployed

    the new access goes live with the new version

On top of this mechanism, our service reviews changes before they go live. Security overview →

E-mail through one relay

App mail and the platform's sign-in mail go through one relay in Control. You see what went to whom and can hold mail to chosen domains.

Zerops installations, apps on Fabrika app libraries 0.7 or newer.

On Cloudflare there is no relay: apps on 0.9 send through the installation's mail provider directly, such as Cloudflare Email Sending, so nothing is recorded or held.

How a message travels

App job

Sending lives in scheduled jobs that declare the mailer, never in request handlers. The app holds a relay key, not provider credentials.

relay key, 30 days

Relay in Control

One transport per installation. Every message is recorded: sender, recipient domain, state, attempts, deduplicated by idempotency key.

content purged after 30 days

Rule

By sender and recipient domain. The most specific rule wins; no rule means pass.

  1. pass Your mail provider

    Resend, or SmartEmailing. Retried for about eight and a half hours, never twice over a non-idempotent transport.

  2. hold Held in the console

    Recipient, subject, text and script-free HTML. Release, drop or requeue; the decision records who made it.

  3. drop Dropped

    Never sent, still in the record.

Typically the test environment holds mail leaving the company, so nobody gets a test invoice.

Mail list in the console with held messages at the top
Mail detail in the console with Release and Drop buttons

Apps send HTML and text, attachments, reply-to, a sender name and one-click unsubscribe (RFC 8058). SmartEmailing takes no attachments or unsubscribe headers. Sign-in mail from the platform goes the same way, its content purged right after sending.

Deploys

A deploy is a repeatable run from an exact commit, not clicks in a cloud console.

Two files describe the app

fabrika.config.ts says where and on what it runs, with the proxy's endpoint table generated from the contract. enableSubdomainAccess: false: the app service never gets a public address.

On Cloudflare fabrika.config.ts is short: the app's id and its build. The deployer builds the proxy Worker from the contract and adds the Durable Object (from 0.9), the R2 bucket for files and the tick for jobs itself; declaring any of them is refused. The app Worker gets no route and workers.dev stays off.

fabrika.contract.ts says what it exposes and to whom: endpoints, the single-page app, file types and size limits, jobs, health check. The approval reads this file.

Zerops

fabrika.config.ts
target: {
  platform: 'zerops',
  services: () => [
    { hostname: 'appdb', type: 'postgresql:single@18' },
    { hostname: 'appfiles', type: 'object-storage', objectStorageSize: 1 },
    { hostname: 'appapi', type: 'alpine/bun@1.3', enableSubdomainAccess: false },
  ],
  contract: compiled,
  proxy: { upstream: 'appapi:3000', ...contractProxyTable(compiled) },
}

Cloudflare

fabrika.config.ts
import { defineApp } from '@fabrika/provider-cloudflare'

// The proxy Worker comes from fabrika.contract.ts; the object,
// the files bucket and the tick are added by the deployer.
export default defineApp({
  id: 'crm',
  pipeline: { build: 'bun run build:web' },
})

What starts a deploy

A push to the trigger branch, a matching tag, the console, the CLI or the AI builder. Control takes a lease for the app environment and pins the commit.

Environments and secrets

Each environment has its own namespace, secrets, domain and protection switch; each app its own database (or schema at the smallest size). Secrets live in Zerops service variables or Control's vault on Cloudflare, are never shown back, and platform variables can't be overwritten.

Run log

Status, who started it (person, webhook, key, builder), commit, step log, release. A new platform release still runs and deploys apps on Fabrika app libraries from the six months before it.

A run on Zerops

verify-exposure fails the run before any version exists if a service has a public subdomain, and reports it to Operations. Control streams the repository from GitHub to Zerops without running its code.

All ten steps
  1. 01 apply-import
  2. 02 verify-exposure
  3. 03 write-service-env
  4. 04 raise-start-memory
  5. 05 size-database
  6. 06 reserve-version
  7. 07 upload-source
  8. 08 trigger-build
  9. 09 await-version
  10. 10 reconcile-schema

A run on Cloudflare

Control checks the recorded commit and hands the job to a Cloudflare Container, which clones the repository at that commit and runs the steps. A step runs only where the app needs it: migrate with a D1 database, sync-secrets when it declares secrets.

All six steps
  1. 01 build
  2. 02 provision-resources
  3. 03 migrate
  4. 04 deploy-worker
  5. 05 reconcile-schema
  6. 06 sync-secrets
List of deploy runs in the console with status, actor and commit
Deploy run detail with the step log

Public forms and hardening

Registrations, contact forms and webhooks reach an internal app without opening it to the internet. Every app gets the rest of the hardening below, whether it has anything public or not.

A form on your website, and what it passes

A public form is its own workload: anyone may call it, and it can do only the actions it declares. The approver sees both before it goes live.

Public endpoints run on Zerops, and on Cloudflare from 0.9 (preview).

On Cloudflare the limits per client count each visitor's address. On Zerops they count every visitor as one client for now, until the platform trusts the load balancer's client address.

Password sign-in has a throttle of its own, per account, deployment and client.

  1. Anyone on the internet

    a form on your website

  2. 1

    Only from listed sites Proxy

    The endpoint must allow cross-origin calls and the exact origin must be listed for the environment. An empty list admits nothing.

    else refused

  3. 2

    A share, not the whole app App

    Public calls hold at most a quarter of the database connections. Signed-in staff keep the rest.

    else 503

  4. 3

    Rate limits App

    10 a minute per client and 100 per endpoint, unless the endpoint declares its own. Counted before the body is read.

    else 429

  5. 4

    Size and shape App

    A bounded body and strict input. Signed tokens are verified as the input is read.

    else 413 / 400

  6. 5

    Proof of work, no CAPTCHA vendor App

    ALTCHA, issued and verified by the app, so no visitor data leaves the installation. Cloudflare Turnstile if you prefer it.

    else 400

  7. 6

    Declared actions only App

    Insert a record, read declared tables. Changing a record needs its ID in a signed token, such as the link in a booking e-mail.

  8. Internal app

    stays closed: the form reaches it only through its declared actions

On every app, public or not

Outgoing calls to declared addresses

Each endpoint lists the outside addresses it calls. Anything else is refused at runtime. A reviewed guard, not a sandbox.

  • api.stripe.comdeclared
  • hooks.slack.comdeclared
  • files.unknown.examplerefused

Verified inbound webhooks

A webhook without a valid signature or credential never reaches the handler.

Checked by
HMAC
basic
bearer
Presets
Slack
Twilio
Stripe
GitHub
Standard Webhooks

Uploaded files

The first bytes must match the declared type, whatever the file is called.

contract.pdf 25 50 44 46 a PDF
photo.jpg 4D 5A a program, refused

Each file kind has its own size limit.

Security headers on every response

Set by the proxy, so an app can't forget them. Downloads get a sandboxing CSP on top.

content-security-policy: default-src 'self'; object-src 'none'; …strict-transport-security: max-age=31536000x-content-type-options: nosniffreferrer-policy: no-referrercross-origin-opener-policy: same-originpermissions-policy: camera=(), microphone=(), …x-request-id: 01a1638c…

The request ID comes from the proxy, and the app and IAM log it, so one request can be traced through both.

Operations

Runs in your installation, so error reports don't leave your account.

Sentry-compatible error ingest

Existing Sentry SDKs work. Issues are grouped; resolve, ignore, assign, comment, snooze, merge or resolve in a release. A resolved issue that returns reopens as a regression.

Automatic, scrubbed reports

Failed requests, failed or missed jobs and crashes are reported on their own. Secrets, tokens, auth headers, request bodies and rows are scrubbed or never sent.

Releases and source maps

A release per deploy, tied to its commit. Source maps upload with a per-run credential.

Health checks and alerts

HTTP checks per app environment, alerting on failure and recovery. New issues, regressions, spikes and unhealthy telemetry go out as webhooks (HTTPS, idempotent, retried).

Grouped errors in the console with sparklines
Error detail with a source-mapped stack trace
Health checks for each app environment

Clouds and stack

Each installation runs on Zerops or on Cloudflare. On Cloudflare, apps get a database, jobs and files from release 0.9, now in preview. In the stable release only Zerops has the full app runtime, so company apps usually go there.

Sign-in, proxy, console, deploys, error tracking
Zerops:yes
Cloudflare:yes
Proxy
Zerops:Caddy + Bun auth service per namespace
Cloudflare:proxy Worker per app environment
Apps
Zerops:Bun on Alpine, private service
Cloudflare:Workers without routes, workers.dev off; from 0.9 each environment in its own Durable Object
App database with row-level policies
Zerops:PostgreSQL 18
Cloudflare:SQLite in the environment's Durable Object (0.9 preview)
Background jobs and e-mail
Zerops:yes
Cloudflare:jobs on the object's alarm, e-mail also through Cloudflare Email Sending (0.9 preview)
Stored files
Zerops:S3-compatible object storage
Cloudflare:R2, no upload scanning yet (0.9 preview)

0.9 preview: the cloudflare and next release channels on npm. The stable release runs apps on Cloudflare as Workers without a database.

AWS

No AWS provider in the code. If you need AWS, we can set up an installation there as part of the setup.

One app, one cloud

Each app targets one cloud. The platform doesn't move apps between clouds for you.

Stack

Language
TypeScript everywhere
Runtime and monorepo
Bun 1.3+
Databases
PostgreSQL (Zerops), D1/SQLite for platform services on Cloudflare
Storage
S3-compatible (Zerops object storage, R2)
Schemas
zod (v4 API)
App UI
React with our own component kit
Migrations
plain SQL, each service owns its schema

Building with AI

Most apps on Fabrika are built with an AI agent. Its changes go the same way as a person's.

A local builder

Eight guided phases from brief to build, with review gates and app rules for Claude Code and Codex. Connects to a Zerops installation only after a person approves it, with a revocable one-app key valid at most 30 days.

Editing from your own Claude or ChatGPT

Built, still being verified end to end; per installation, Zerops only. People edit through MCP, signed in against your IAM with authoring-only rights. Edits become commits on a branch, deploy to stage and open a pull request; production needs a person's merge and the usual approval.

Your AI plan

Always your company's own AI plan. We're happy to help you choose a provider.

Guardrails in the repository

A checker refuses any, type casts, suppression comments, raw SQL outside the declared path and direct environment reads. Generated tests check data isolation and endpoint access.

What the platform doesn't do

As of the current release:

Multi-factor authentication
Only through your identity provider's SSO; no TOTP or passkeys for passwords.
SAML and SCIM
OIDC only, one identity provider per installation. Leavers must be disabled in IAM too.
Backups and restore
Not in the platform; we set them up with you as part of the service, using the cloud's tools.
Rollback
No command; deploy an older commit through approval. Zerops can switch versions outside Fabrika.
Alerts by e-mail
Webhooks only.
Self-service access requests
None; whoever manages the app's people grants roles.
Malware scanning of uploads
ClamAV code exists, unverified on a live account, not promised.
Verification on Zerops
Some paths, source map upload among them, still being verified end to end. DNS-safe alert webhook delivery isn't built.
Certifications
No ISO 27001, SOC 2, published penetration test or SBOM. The code is public.
Guaranteed audit of everything
IAM changes are transactional and sign-ins logged before IAM answers; events from other services are best effort.

Full answers for a supplier review: Security questionnaire →

Open source, and if you leave

Leaving us doesn't take away anything you depend on.

github.com/contember/fabrika-platform →
Your cloud account
Everything runs there. We're administrators, and you can revoke that at any time.
Your Git
App code is plain TypeScript and SQL migrations in your company's GitHub.
MIT licence
Platform on GitHub, app libraries on npm as @fabrika/* with provenance, installation guide in the CLI.
What leaving means
Running the platform yourselves or with someone else, in the same account. Not moving to another cloud.

Go through it with our engineer.

Half an hour with the person who builds the platform. Bring your identity provider, your cloud, your security questionnaire or a repository.