---
title: "Built-in and local drivers"
description: "The drivers that ship inside MainSDK - local drivers for offline development, built-in production drivers, action surfaces and testing fakes."
section: "integrations"
canonical: "https://mainsdk.dev/docs/integrations/built-in"
updated: "2026-10-28"
---

# Built-in and local drivers

> The drivers that ship inside MainSDK - local drivers for offline development, built-in production drivers, action surfaces and testing fakes.

Canonical: https://mainsdk.dev/docs/integrations/built-in · Updated: 2026-10-28

Some drivers need no third-party account because they ship inside MainSDK. They fall into two groups. Local drivers let `mainsdk dev` run your app offline, with no provider keys and no network calls to providers. Built-in drivers are production drivers that run in your app: Cedar for permissions and policy, the network allowlist, rate limits, privacy, webhooks, PDFs and more. This page covers both, plus the action surfaces, MainSDK Cloud as a destination, a few generic slots and the testing fakes. SQLite for local data has its own page: [SQLite](https://mainsdk.dev/docs/integrations/sqlite).

## Interfaces it serves

### Sign-in and sessions (`auth`)

- Status: Building for 0.3 · ships as a stable API
- Driver: `local` (Local (development only))
- Docs: https://mainsdk.dev/docs/interfaces/auth.md

```yaml
auth:
  driver: local
```

Swap to another provider: `github`, `clerk`, `auth0`, `better-auth`, `workos`, `supabase`.

### Connections to other services (`connections`)

- Status: Building for 0.3 · ships as a experimental API
- Driver: `local` (Local (tests and local mode)
- Docs: https://mainsdk.dev/docs/interfaces/connections.md

```yaml
connections:
  driver: local
```

Swap to another provider: `google`, `github`, `slack`, `microsoft`, `notion`, `atlassian`, `airtable`, `partner`.

### Phone, email and identity checks (`verify`)

- Status: Building for 0.7 · ships as a beta API
- Driver: `local` (Local outbox for development and tests)
- Docs: https://mainsdk.dev/docs/interfaces/verify.md

```yaml
verify:
  driver: local
```

Swap to another provider: `twilio-verify`, `bird`, `digilocker`, `onfido`, `persona`.

### Tenants (`tenant`)

- Status: Building for 0.3 · ships as a stable API
- Driver: `builtin` (Built in (core, default)
- Docs: https://mainsdk.dev/docs/interfaces/tenant.md

```yaml
tenant:
  driver: builtin
```

### API keys for your customers (`apikeys`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `local` (Local (tests and local mode)). was memory
- Docs: https://mainsdk.dev/docs/interfaces/apikeys.md

```yaml
apikeys:
  driver: local
```

Swap to another provider: `db`.

### Permissions (`access`)

- Status: Building for 0.3 · ships as a stable API
- Driver: `cedar` (Cedar (built in), default)
- Docs: https://mainsdk.dev/docs/interfaces/access.md

```yaml
access:
  driver: cedar
```

Swap to another provider: `opa`, `openfga`, `spicedb`, `cerbos`, `permit`, `oso`, `avp`.

### Policy decisions (`policy`)

- Status: Building for 0.2 · ships as a stable API
- Driver: `builtin` (Cedar (built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/policy.md

```yaml
policy:
  driver: builtin
```

Swap to another provider: `opa`.

### Context and shared context (`context`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in (the app link), default)
- Docs: https://mainsdk.dev/docs/interfaces/context.md

```yaml
context:
  driver: builtin
```

### Calendars (`calendar`)

- Status: Building for 1.2 · ships as a experimental API
- Driver: `local` (Local (tests and mainsdk dev))
- Docs: https://mainsdk.dev/docs/interfaces/calendar.md

```yaml
calendar:
  driver: local
```

Swap to another provider: `db`, `caldav`.

### Import files and pull data (`imports`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in parsers for CSV, XLSX, JSON and NDJSON, default)
- Docs: https://mainsdk.dev/docs/interfaces/imports.md

```yaml
imports:
  driver: builtin
```

Swap to another provider: `google-sheets`, `airtable`, `rest`.

### Key-value store and cache (`kv`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `local` (Local (memory or one file), default)
- Docs: https://mainsdk.dev/docs/interfaces/kv.md

```yaml
kv:
  driver: local
```

Swap to another provider: `redis`, `upstash`, `vercel-runtime-cache`, `cloudflare-kv`.

### Cache (`cache`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `local` (In-process only)
- Docs: https://mainsdk.dev/docs/interfaces/cache.md

```yaml
cache:
  driver: local
```

Swap to another provider: `kv`.

### Search (`search`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `local` (Local (in process)
- Docs: https://mainsdk.dev/docs/interfaces/search.md

```yaml
search:
  driver: local
```

Swap to another provider: `db`, `typesense`, `meilisearch`, `algolia`, `pgvector`.

### Feeds and timelines (`feeds`)

- Status: Building for 0.4 · ships as a experimental API
- Driver: `local` (Local (in process)
- Docs: https://mainsdk.dev/docs/interfaces/feeds.md

```yaml
feeds:
  driver: local
```

Swap to another provider: `db`.

### Offline-first replication (`sync`)

- Status: Building for 1.1 · ships as a experimental API
- Driver: `local` (Local (in memory, default)
- Docs: https://mainsdk.dev/docs/interfaces/sync.md

```yaml
sync:
  driver: local
```

Swap to another provider: `electric`, `powersync`.

### AI calls (`ai`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `local` (Local (no account, default). with no ai.driver the app runs the fake driver (driver: fake); local is the same kind, scripted or echoing replies, for dev and tests
- Docs: https://mainsdk.dev/docs/interfaces/ai.md

```yaml
ai:
  driver: local
```

Swap to another provider: `anthropic`, `openai`, `gateway`, `bedrock`, `ollama`, `llama-cpp`, `openai-compatible`.

### Actions and agent tools (`action`)

- Status: Preview · ships as a beta API
- Driver: `mcp` (MCP)
- Docs: https://mainsdk.dev/docs/interfaces/action.md

```yaml
action:
  driver: mcp
```

Swap to another provider: `http`, `server-action`, `cli`.

### Actions and agent tools (`action`)

- Status: Preview · ships as a beta API
- Driver: `http` (HTTP API)
- Docs: https://mainsdk.dev/docs/interfaces/action.md

```yaml
action:
  driver: http
```

Swap to another provider: `mcp`, `server-action`, `cli`.

### Actions and agent tools (`action`)

- Status: Preview · ships as a beta API
- Driver: `server-action` (Server actions)
- Docs: https://mainsdk.dev/docs/interfaces/action.md

```yaml
action:
  driver: server-action
```

Swap to another provider: `mcp`, `http`, `cli`.

### Actions and agent tools (`action`)

- Status: Preview · ships as a beta API
- Driver: `cli` (CLI)
- Docs: https://mainsdk.dev/docs/interfaces/action.md

```yaml
action:
  driver: cli
```

Swap to another provider: `mcp`, `http`, `server-action`.

### App agents (`agents`)

- Status: Building for 0.3 · ships as a experimental API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/agents.md

```yaml
agents:
  driver: builtin
```

### Agent memory (`memory`)

- Status: Building for 0.4 · ships as a experimental API
- Driver: `local` (Local (SQLite or JSONL))
- Docs: https://mainsdk.dev/docs/interfaces/memory.md

```yaml
memory:
  driver: local
```

Swap to another provider: `db`, `mem0`, `zep`, `letta`, `pinecone`, `mcp`.

### Playbook advisor (`advisor`)

- Status: Building for 0.6 · ships as a experimental API
- Driver: `builtin` (Built in (calls the ai interface), default)
- Docs: https://mainsdk.dev/docs/interfaces/advisor.md

```yaml
advisor:
  driver: builtin
```

### Payments (`pay`)

- Status: Building for 0.3 · ships as a stable API
- Driver: `local` (Local test cards)
- Docs: https://mainsdk.dev/docs/interfaces/pay.md

```yaml
payments:
  driver: local
```

Swap to another provider: `stripe`, `razorpay`, `paddle`.

### Usage metering (`meter`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `local` (Local (tests and mainsdk dev))
- Docs: https://mainsdk.dev/docs/interfaces/meter.md

```yaml
meter:
  driver: local
```

Swap to another provider: `db`, `redis`, `stripe-meters`, `lago`.

### Plans and entitlements (`entitlements`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `local` (Local (tests and local mode)). was memory
- Docs: https://mainsdk.dev/docs/interfaces/entitlements.md

```yaml
entitlements:
  driver: local
```

Swap to another provider: `db`.

### App licensing (`licence`)

- Status: Building for 0.4 · ships as a experimental API
- Driver: `local` (Local (a dev licence from the test root))
- Docs: https://mainsdk.dev/docs/interfaces/licence.md

```yaml
licence:
  driver: local
```

Swap to another provider: `offline`, `http`.

### App licensing (`licence`)

- Status: Building for 0.4 · ships as a experimental API
- Driver: `http` (HTTP refresh (MainSDK Cloud or your own issuer))
- Docs: https://mainsdk.dev/docs/interfaces/licence.md

```yaml
licence:
  driver: http
```

Swap to another provider: `local`, `offline`.

### Notifications (`notify`)

- Status: Building for 0.3 · ships as a stable API
- Driver: `local` (Local terminal channel)
- Docs: https://mainsdk.dev/docs/interfaces/notify.md

```yaml
notify:
  driver: local
```

Swap to another provider: `whatsapp-cloud`, `bird`, `msg91`, `twilio`, `fcm`, `apns`, `expo`, `resend`, `ses`, `onesignal`, `slack`, `pagerduty`, `opsgenie`, `webhook`.

### Engagement journeys (`engagement`)

- Status: Building for 0.4 · ships as a experimental API
- Driver: `builtin` (Built in on notify and workflows, default)
- Docs: https://mainsdk.dev/docs/interfaces/engagement.md

```yaml
engagement:
  driver: builtin
```

### Email (`email`)

- Status: Building for 0.3 · ships as a stable API
- Driver: `local` (Local inbox)
- Docs: https://mainsdk.dev/docs/interfaces/email.md

```yaml
email:
  driver: local
```

Swap to another provider: `resend`, `ses`, `postmark`, `bird`, `smtp`.

### Inbound mail and mailboxes (`mail`)

- Status: Building for 1.2 · ships as a experimental API
- Driver: `local` (Local (tests and mainsdk dev))
- Docs: https://mainsdk.dev/docs/interfaces/mail.md

```yaml
mail:
  driver: local
```

Swap to another provider: `ses`, `postmark`, `mailgun`, `cloudflare`, `imap`, `jmap`.

### Realtime updates (`realtime`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `local` (Local (one instance))
- Docs: https://mainsdk.dev/docs/interfaces/realtime.md

```yaml
realtime:
  driver: local
```

Swap to another provider: `broadcast`, `pusher`, `ably`, `supabase-realtime`.

### File uploads (`files`)

- Status: Building for 0.3 · ships as a stable API
- Driver: `local` (Local files on disk)
- Docs: https://mainsdk.dev/docs/interfaces/files.md

```yaml
files:
  driver: local
```

Swap to another provider: `getqr`, `s3`, `uploadthing`, `vercel-blob`.

### Share links and QR codes (`share`)

- Status: Building for 0.3 · ships as a stable API
- Driver: `local` (Local links on the dev server)
- Docs: https://mainsdk.dev/docs/interfaces/share.md

```yaml
share:
  driver: local
```

Swap to another provider: `getqr`.

### Invite, deep and sign-in links (`links`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `local` (Local links on the dev server). links uses the share driver
- Docs: https://mainsdk.dev/docs/interfaces/links.md

```yaml
links:
  driver: local
```

Swap to another provider: `getqr`.

### Images, video and audio (`media`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `local` (Local placeholder driver (right structure)
- Docs: https://mainsdk.dev/docs/interfaces/media.md

```yaml
media:
  driver: local
```

Swap to another provider: `getqr`, `mux`, `cloudinary`, `ffmpeg`.

### Moderation (`moderate`)

- Status: Building for 0.4 · ships as a experimental API
- Driver: `builtin` (Built in on db, default)
- Docs: https://mainsdk.dev/docs/interfaces/moderate.md

```yaml
moderate:
  driver: builtin
```

Swap to another provider: `ai-classify`, `pdq`, `photodna`.

### PDF documents (`pdf`)

- Status: Preview · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/pdf.md

```yaml
pdf:
  driver: builtin
```

Swap to another provider: `docraptor`, `gotenberg`, `documenso`.

### Document reading (`documents`)

- Status: Preview · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/documents.md

```yaml
documents:
  driver: builtin
```

Swap to another provider: `textract`, `azure-document`, `google-document`, `unstructured`, `ai`.

### Webhooks (`webhooks`)

- Status: Preview · ships as a stable API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/webhooks.md

```yaml
webhooks:
  driver: builtin
```

Swap to another provider: `svix`.

### Durable workflows (`workflows`)

- Status: Preview · ships as a beta API
- Driver: `local` (Local (in memory in tests, a journal folder in development))
- Docs: https://mainsdk.dev/docs/interfaces/workflows.md

```yaml
workflows:
  driver: local
```

Swap to another provider: `db`, `inngest`, `temporal`, `vercel-workflow`.

### Remote GPU and long jobs (`compute`)

- Status: Building for 0.6 · ships as a experimental API
- Driver: `local` (Local program (system.run), default)
- Docs: https://mainsdk.dev/docs/interfaces/compute.md

```yaml
compute:
  driver: local
```

Swap to another provider: `modal`, `replicate`, `runpod`.

### Events and background jobs (`jobs`)

- Status: Building for 0.3 · ships as a stable API
- Driver: `local` (In-process local queue). built; memory or files that survive mainsdk dev restarts
- Docs: https://mainsdk.dev/docs/interfaces/jobs.md

```yaml
jobs:
  driver: local
```

Swap to another provider: `db`, `inngest`, `vercel-queues`, `trigger-dev`, `sqs`.

### Secrets (`secrets`)

- Status: Building for 0.2 · ships as a stable API
- Driver: `env` (Environment variables)
- Docs: https://mainsdk.dev/docs/interfaces/secrets.md

```yaml
secrets:
  driver: env
```

Swap to another provider: `vault`, `aws-secrets-manager`, `gcp-secret-manager`, `azure-key-vault`, `doppler`, `infisical`, `local`.

### Secrets (`secrets`)

- Status: Building for 0.2 · ships as a stable API
- Driver: `local` (Local file)
- Docs: https://mainsdk.dev/docs/interfaces/secrets.md

```yaml
secrets:
  driver: local
```

Swap to another provider: `vault`, `aws-secrets-manager`, `gcp-secret-manager`, `azure-key-vault`, `doppler`, `infisical`, `env`.

### Encryption keys (`keys`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `local` (Local (development only))
- Docs: https://mainsdk.dev/docs/interfaces/keys.md

```yaml
keys:
  driver: local
```

Swap to another provider: `aws-kms`, `gcp-kms`, `azure-keyvault`, `vault-transit`.

### Cryptography (`crypto`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `cloud-kms` (Cloud key services). planned; use the keys interface today
- Docs: https://mainsdk.dev/docs/interfaces/crypto.md

```yaml
crypto:
  driver: cloud-kms
```

Swap to another provider: `builtin`, `vault-transit`, `libsodium`.

### Cryptography (`crypto`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `builtin` (WebCrypto, default)
- Docs: https://mainsdk.dev/docs/interfaces/crypto.md

```yaml
crypto:
  driver: builtin
```

Swap to another provider: `cloud-kms`, `vault-transit`, `libsodium`.

### End-to-end encryption (`e2e`)

- Status: Building for 1.2 · ships as a experimental API
- Driver: `local` (Local fake (not for production))
- Docs: https://mainsdk.dev/docs/interfaces/e2e.md

```yaml
e2e:
  driver: local
```

Swap to another provider: `mls`.

### Network permissions (`network`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/network.md

```yaml
network:
  driver: builtin
```

### Local files (`disk`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/disk.md

```yaml
disk:
  driver: builtin
```

### Server facts and programs (`system`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/system.md

```yaml
system:
  driver: builtin
```

### TCP, UDP and unix sockets (`net`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/net.md

```yaml
net:
  driver: builtin
```

### Worker threads and cluster (`workers`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/workers.md

```yaml
workers:
  driver: builtin
```

### Code sandboxes (`sandbox`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `local` (Local subprocess (development))
- Docs: https://mainsdk.dev/docs/interfaces/sandbox.md

```yaml
sandbox:
  driver: local
```

Swap to another provider: `vercel-sandbox`, `e2b`.

### Rate limits and quotas (`limits`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `local` (Local (in process), default)
- Docs: https://mainsdk.dev/docs/interfaces/limits.md

```yaml
limits:
  driver: local
```

Swap to another provider: `redis`, `arcjet`.

### Protected files (`protect`)

- Status: Building for 0.4 · ships as a experimental API
- Driver: `local` (Local fake TAPS Node, default)
- Docs: https://mainsdk.dev/docs/interfaces/protect.md

```yaml
protect:
  driver: local
```

Swap to another provider: `taps-node`, `taps-hosted`, `sovedocs`.

### Privacy and data rights (`privacy`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/privacy.md

```yaml
privacy:
  driver: builtin
```

### Backups and restore drills (`backup`)

- Status: Building for 1.2 · ships as a beta API
- Driver: `object-lock` (Object storage with object lock)
- Docs: https://mainsdk.dev/docs/interfaces/backup.md

```yaml
backup:
  driver: object-lock
```

Swap to another provider: `local`, `neon-pitr`, `supabase-pitr`, `pgbackrest`, `aws-backup`.

### Backups and restore drills (`backup`)

- Status: Building for 1.2 · ships as a beta API
- Driver: `local` (Local (tests and drills without a provider))
- Docs: https://mainsdk.dev/docs/interfaces/backup.md

```yaml
backup:
  driver: local
```

Swap to another provider: `neon-pitr`, `supabase-pitr`, `pgbackrest`, `aws-backup`, `object-lock`.

### Health, resources and status page (`status`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/status-page.md

```yaml
status:
  driver: builtin
```

Swap to another provider: `provider`.

### Health, resources and status page (`status`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `provider` (Your status page provider)
- Docs: https://mainsdk.dev/docs/interfaces/status-page.md

```yaml
status:
  driver: provider
```

Swap to another provider: `builtin`.

### Security events (`security`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `builtin` (Built in (log, OTLP and events sinks), default)
- Docs: https://mainsdk.dev/docs/interfaces/security.md

```yaml
security:
  driver: builtin
```

### Incident controls (`incident`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in (pushes through the config driver), default)
- Docs: https://mainsdk.dev/docs/interfaces/incident.md

```yaml
incident:
  driver: builtin
```

### Exfiltration guard and canaries (`canary`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in (an Aho-Corasick matcher on the standard library), default)
- Docs: https://mainsdk.dev/docs/interfaces/canary.md

```yaml
canary:
  driver: builtin
```

### Alerts (`alerts`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in (sends through notify and email drivers), default)
- Docs: https://mainsdk.dev/docs/interfaces/alerts.md

```yaml
alerts:
  driver: builtin
```

### Signals (`signals`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in (diagnostics channels, events.broadcast and the host bus), default)
- Docs: https://mainsdk.dev/docs/interfaces/signals.md

```yaml
signals:
  driver: builtin
```

### Playbooks (`playbooks`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/playbooks.md

```yaml
playbooks:
  driver: builtin
```

### Logs, audit and telemetry (`log`)

- Status: Building for 0.2 · ships as a stable API
- Driver: `terminal` (Terminal, default)
- Docs: https://mainsdk.dev/docs/interfaces/log.md

```yaml
telemetry:
  to: terminal
```

Swap to another provider: `otel`, `mainsdk`, `sentry`.

### Logs, audit and telemetry (`log`)

- Status: Building for 0.2 · ships as a stable API
- Driver: `mainsdk` (MainSDK Cloud)
- Docs: https://mainsdk.dev/docs/interfaces/log.md

```yaml
telemetry:
  to: mainsdk
```

Swap to another provider: `terminal`, `otel`, `sentry`.

### Observe the SDK (`observe`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `builtin` (Built in (core, default)
- Docs: https://mainsdk.dev/docs/interfaces/observe.md

```yaml
observe:
  driver: builtin
```

### Product analytics (`analytics`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `builtin` (Built in (on db), default)
- Docs: https://mainsdk.dev/docs/interfaces/analytics.md

```yaml
analytics:
  driver: builtin
```

Swap to another provider: `posthog`, `otel`, `plausible`.

### Behaviour norms (`norms`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/norms.md

```yaml
norms:
  driver: builtin
```

### Languages and formats (`i18n`)

- Status: Preview · ships as a beta API
- Driver: `files` (Local YAML files, default)
- Docs: https://mainsdk.dev/docs/interfaces/i18n.md

```yaml
i18n:
  driver: files
```

Swap to another provider: `tolgee`, `crowdin`, `lokalise`, `ai-draft`.

### Languages and formats (`i18n`)

- Status: Preview · ships as a beta API
- Driver: `ai-draft` (AI draft with human review)
- Docs: https://mainsdk.dev/docs/interfaces/i18n.md

```yaml
i18n:
  driver: ai-draft
```

Swap to another provider: `files`, `tolgee`, `crowdin`, `lokalise`.

### Location (`geo`)

- Status: Building for 0.7 · ships as a beta API
- Driver: `platform-headers` (Platform headers, default). a hint from the declared platform; no geocoder
- Docs: https://mainsdk.dev/docs/interfaces/geo.md

```yaml
geo:
  driver: platform-headers
```

Swap to another provider: `mapbox`, `google-maps`, `local`.

### Location (`geo`)

- Status: Building for 0.7 · ships as a beta API
- Driver: `local` (Local table in the testing kit). geocodes from a table with no network, for tests
- Docs: https://mainsdk.dev/docs/interfaces/geo.md

```yaml
geo:
  driver: local
```

Swap to another provider: `platform-headers`, `mapbox`, `google-maps`.

### App updates and version blocking (`updates`)

- Status: Building for 0.7 · ships as a beta API
- Driver: `local` (Local fake for tests and development, default). answers from a script; records every call
- Docs: https://mainsdk.dev/docs/interfaces/updates.md

```yaml
updates:
  driver: local
```

Swap to another provider: `expo-updates`, `google-play`, `app-store`, `tauri`.

### Feedback and support (`feedback`)

- Status: Building for 0.6 · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/feedback.md

```yaml
feedback:
  driver: builtin
```

Swap to another provider: `intercom`, `zendesk`, `plain`.

### Neighbour apps (`neighbours`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in (user-only sockets and the app link), default)
- Docs: https://mainsdk.dev/docs/interfaces/neighbours.md

```yaml
neighbours:
  driver: builtin
```

### App registry and link (`apps`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in (a local folder and a user-only socket), default)
- Docs: https://mainsdk.dev/docs/interfaces/apps.md

```yaml
apps:
  driver: builtin
```

### Ops server (`ops`)

- Status: Building for 0.4 · ships as a beta API
- Driver: `builtin` (Built in (a user-only socket and a token file), default)
- Docs: https://mainsdk.dev/docs/interfaces/ops.md

```yaml
ops:
  driver: builtin
```

### Connected devices (`device`)

- Status: Building for 1.3 · ships as a beta API
- Driver: `local` (Local (did:key, Ed25519 or P-256, no dependency), default)
- Docs: https://mainsdk.dev/docs/interfaces/device.md

```yaml
device:
  driver: local
```

Swap to another provider: `taps`.

### Runtime settings (`config`)

- Status: Building for 0.2 · ships as a stable API
- Driver: `files` (Files)
- Docs: https://mainsdk.dev/docs/interfaces/config.md

```yaml
config:
  driver: files
```

Swap to another provider: `local`, `redis`, `postgres`, `vercel-global-config`, `aws-appconfig`, `cloudflare-kv`.

### Runtime settings (`config`)

- Status: Building for 0.2 · ships as a stable API
- Driver: `local` (Local (in process)). was memory; for tests and several instances in one test process
- Docs: https://mainsdk.dev/docs/interfaces/config.md

```yaml
config:
  driver: local
```

Swap to another provider: `files`, `redis`, `postgres`, `vercel-global-config`, `aws-appconfig`, `cloudflare-kv`.

### Schema and parsers (`schema`)

- Status: Building for 0.2 · ships as a beta API
- Driver: `builtin` (Built in, default)
- Docs: https://mainsdk.dev/docs/interfaces/schema.md

```yaml
schema:
  driver: builtin
```

### Typed API and OpenAPI document (`api`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `builtin` (Built in core module, default)
- Docs: https://mainsdk.dev/docs/interfaces/api.md

```yaml
api:
  driver: builtin
```

### Testing kit (`testing`)

- Status: Building for 0.4 · ships as a stable API
- Driver: `local` (The local drivers with recording and chaos, default)
- Docs: https://mainsdk.dev/docs/interfaces/testing.md

```yaml
testing:
  driver: local
```

### Adopt an existing app (`adopt`)

- Status: Building for 0.5 · ships as a beta API
- Driver: `builtin` (Built in (reads files, runs git), default)
- Docs: https://mainsdk.dev/docs/interfaces/adopt.md

```yaml
adopt:
  driver: builtin
```

### Bot defence (`bots`)

- Status: Building for 0.3 · ships as a beta API
- Driver: `local` (In-process counters (the default store; no third party))
- Docs: https://mainsdk.dev/docs/interfaces/bots.md

```yaml
bots:
  driver: local
```

Swap to another provider: `pow`, `turnstile`, `hcaptcha`.

### Connectors to GRC, privacy, vulnerability and ticket tools (`connectors`)

- Status: Building for 1.2 · ships as a beta API
- Driver: `local` (Local mock (tests and mainsdk dev))
- Docs: https://mainsdk.dev/docs/interfaces/connectors.md

```yaml
connectors:
  driver: local
```

Swap to another provider: `servicenow-irm`, `archer`, `onetrust-grc`, `transcend`, `onetrust-privacy`, `dependency-track`, `snyk`, `wiz`, `defectdojo`, `github`, `jira`.

## Before you start

There is nothing to create: no account, no keys, no dashboard. Two things to know:

1. **Local drivers are for development and tests.** `mainsdk check --env prod`, or any run whose resolved environment is `prod`, fails with `MAIN-CHECK-0026` if any interface resolves to a local driver. The `keys` local driver also fails with `MAIN-KEYS-0001` in production.
2. **Built-in drivers are production-ready.** Cedar, `network`, `limits`, `privacy`, `webhooks`, `pdf`, `status`, `analytics`, `feedback`, `i18n` files, `config` files and `geo` platform headers are the default or only driver for their interface and are meant to run in production.

Keep local drivers in a development overlay (`main.env.dev.yaml`) and real providers in `main.env.prod.yaml`, so the check keeps them apart.

## Configure

### Local development drivers

`mainsdk dev` runs a local driver for every interface in use, so the app works end to end with no cloud account.

- **`auth: local`** - sign-in for development only, with no identity provider.
- **`ai: local`** - a local fake model, with redaction, caps and audit enforced as in production.
- **`pay: local`** - local test cards. With no provider key, a checkout completes and fires `payment.succeeded`.
- **`notify: local`** - the terminal channel. WhatsApp and SMS messages print in the terminal. The key that selects it is [TBD].
- **`email: local`** - a local inbox. Emails land there so you can see the rendered message and its headers.
- **`files: local`** - files on disk. In production, use `getqr`, `s3`, `uploadthing` or `vercel-blob` (ADR-0013); `check` refuses the local driver in production.
- **`jobs: local`** - an in-process queue for events and background jobs.
- **`secrets: local`** - reads `.mainsdk/secrets.json`, which is git-ignored.
- **`secrets: env`** - reads the process environment. Whether `check` treats it as a local driver in production is not specified; prefer a secrets manager with workload identity there.
- **`keys: local`** - local envelope encryption, development only.

```yaml title="main.env.dev.yaml"
ai:
  driver: local
email:
  driver: local
files:
  driver: local
jobs:
  driver: local      # [TBD] driver id for the in-process local queue
secrets:
  driver: local
keys:
  driver: local
```

### Built-in production drivers

- **`access: cedar`** - permissions decided in process with Cedar, RBAC and ABAC, deny by default.
- **`policy: cedar`** - policies from your `policies/` folder, decided in process, in `observe`, `warn` or `enforce` mode.
- **`network: builtin`** - the outbound allowlist; undeclared hosts are blocked and reported.
- **`limits: builtin`** - rate limits, locks and quotas, with sign-in and AI calls limited by default.
- **`privacy: builtin`** - export, erasure and consent across every other driver, with retention per data label.
- **`webhooks: builtin`** - signed outbound delivery with retries, and verified inbound webhooks.
- **`pdf: builtin`** - renders PDFs from templates, localised through `i18n`, and signs them.
- **`status: builtin`** - health checks per dependency and a status page.
- **`analytics: builtin`** - the built-in store; active users by country, region and version are queries, and IP addresses are never stored.
- **`feedback: builtin`** - report capture with the trace, version and steps attached.
- **`i18n: files`** - messages in local YAML files; **`i18n: ai-draft`** adds an AI draft for new strings, marked as needing review until a person approves it.
- **`config: files`** - typed settings from files; where it reads its values from is not decided yet.
- **`geo: platform-headers`** - a coarse location hint from the headers your hosting platform adds, never used for access.

```yaml title="main.yaml"
access:
  driver: cedar
  models: [rbac, abac]
policy:
  engine: cedar
  dir: policies/
  mode: observe
network:
  allow: [api.partner.com]
  default: deny
webhooks:
  driver: builtin
  secret: secret:WEBHOOK_SIGNING_KEY   # suggested name
i18n:
  driver: files
  locales: [en-IN, hi-IN]
config:
  driver: files
  schema: ./config.schema.json
```

`limits`, `pdf`, `status`, `feedback` and `geo` take `driver: builtin` (or `platform-headers`) and nothing else so far. `network` and `privacy` have one driver, so there is nothing to set.

### Action surfaces

`mcp`, `http`, `server-action` and `cli` are not drivers you choose. One `action()` definition gives you an HTTP endpoint, a server action, a CLI command (`mainsdk run <name>`) and an audit event, plus an MCP tool when you opt in with `mcp: true` or `mcp.expose`.

```yaml title="main.yaml"
mcp:
  expose: [orders.refund, orders.list]
  confirm: { write: true, destructive: true }
```

### MainSDK Cloud as a destination

`log: mainsdk` and `analytics: mainsdk` send telemetry and product events to MainSDK Cloud. Nothing leaves your app before `mainsdk login`, and then only when you opt in. `log: terminal` is the default and keeps everything local.

```yaml title="main.yaml"
telemetry:
  to: [terminal, mainsdk]   # default [terminal]
```

### Generic slots

- **`status: provider`** - your own status page provider. Which providers are supported is [TBD].
- **`crypto: cloud-kms`** - cloud key services behind `crypto`. Key names and references are [TBD].
- **`backup: object-lock`** - object storage with object lock, for immutable backups. How you select it is [TBD].

### Testing fakes

`testing: fakes` is the only driver of the testing kit: an in-memory fake for every interface, generated from its contract. It has no `main.yaml` block; `createTestApp()` reads your file and swaps each interface for its fake.

## Use it

Your code is the same on a local driver and a real provider. With `email: local`, this lands in the local inbox:

```ts title="app/signup/actions.ts"
"use server";
import { email } from "mainsdk";

export async function welcome(address: string) {
  await email.send({ to: address, template: "welcome", data: {} });
}
```

A built-in production driver, Cedar, deciding in process:

```ts title="app/api/orders/[id]/route.ts"
import { access, auth } from "mainsdk";

export async function PATCH(req: Request, { params }: { params: { id: string } }) {
  const session = await auth.require(req);
  const order = { type: "order", id: params.id };
  const decision = await access.check({ subject: session.user, action: "orders.update", resource: order });
  if (!decision.allow) return new Response("Forbidden", { status: 403 });
  return Response.json({ ok: true });
}
```

## Local development and testing

npm:

```bash
npx mainsdk dev
```

pnpm:

```bash
pnpm mainsdk dev
```


`mainsdk dev` uses local drivers with no network calls to providers. In tests, `createTestApp()` from `@mainsdk/testing` puts every interface on its fake, `clock.advance()` controls time, and `chaos.on("<interface>", { outage: true })` injects outages.

```ts title="tests/signup.test.ts"
import { it } from "node:test";
import { createTestApp, expect, mailbox } from "@mainsdk/testing";

it("sends a welcome email", async () => {
  const app = createTestApp({ main: "./main.yaml" });
  await welcome("a@pinecart.dev");
  mailbox(app).toHaveSent({ to: "a@pinecart.dev", template: "welcome" });
});
```

## What MainSDK adds on top

- Fakes enforce the same guarantees as production: a marketing email without an unsubscribe fails in a test too.
- Local drivers never reach production: `MAIN-CHECK-0026` stops the build.
- Built-in drivers run in your app, with no third-party account; Cedar decides in process with no network round trip.
- Nothing goes to MainSDK Cloud before login and opt-in.

See [Testing kit](https://mainsdk.dev/docs/interfaces/testing) and [Test your app](https://mainsdk.dev/docs/guides/testing).

## Limits and notes

- Local drivers arrive with their interfaces: the 0.2 milestone ships local mode for `config` files, `secrets` local, `policy` Cedar and `log` terminal; the rest come with 0.3.
- `files: local` and the getqr.id driver pass the same conformance suite; whether the local driver counts as the second driver for `files` to be stable is still open.
- `pdf`, `limits`, `status`, `feedback`, `i18n` and `geo` have no spec yet, so their options are provisional.
- `ai: local` is a fake; it does not run a model on your machine.

## Swap to or from it

Move from a local driver to a provider with an environment overlay:

```yaml title="main.env.prod.yaml"
email:
  driver: resend   # main.env.dev.yaml keeps driver: local
```

> **Warning:** Local drivers hold throwaway state: the local inbox, files on disk, the in-process queue, `.mainsdk/secrets.json` and data sealed with local keys do not move to a provider. Never keep real data on local drivers.

## FAQ

**Can I run the whole app offline?** Yes, for interfaces whose local drivers have shipped. `mainsdk dev` makes no calls to providers and needs no cloud account.

**Is Cedar only for development?** No. Cedar is the default production engine for `access` and `policy`, running in process.

**Why does `mainsdk check --env prod` fail with `MAIN-CHECK-0026`?** An interface still resolves to a local driver in production. Set a real driver in `main.env.prod.yaml`.

## Next

- [Testing kit](https://mainsdk.dev/docs/interfaces/testing), [Permissions](https://mainsdk.dev/docs/interfaces/access) and [Actions and agent tools](https://mainsdk.dev/docs/interfaces/action)
- [SQLite](https://mainsdk.dev/docs/integrations/sqlite), [getqr.id](https://mainsdk.dev/docs/integrations/getqr-id) and [OpenTelemetry](https://mainsdk.dev/docs/integrations/opentelemetry)
- [Test your app](https://mainsdk.dev/docs/guides/testing) and [Swap a driver](https://mainsdk.dev/docs/guides/swap-a-driver)
