Connect SafeState without adding repo dependencies.
SafeState runs as a GitHub App, a hosted OpenAPI 3.1 REST API, and a Remote Code-Mode MCP server. Emitted Vitest repro files carry zero SafeState imports.
1. Quickstart
Choose the entry path that fits your workflow:
- Free module check (fastest): Submit a public repository on safestate.dev/audit. You receive a shrunk trace, a standalone Vitest repro file, and a coding-agent fix prompt.
- Automatic pull request checks: Connect the SafeState GitHub App on one or more repositories (
contents: read,checks: write,pull_requests: read,metadata: read). - Agent-native MCP or OpenAPI: Point your coding agent at
https://api.safestate.dev/mcpor callhttps://api.safestate.dev/v1/*directly with an org API key.
2. Remote Code-Mode MCP Server
SafeState exposes a Streamable HTTP MCP endpoint at https://api.safestate.dev/mcp using the compact Code-Mode pattern: instead of dumping dozens of tool schemas into your coding agent’s context window, SafeState exposes exactly 3 fixed tools backed by our live OpenAPI 3.1 spec:
| Tool | Purpose |
|---|---|
search_operations | Search available API operations by keyword, tag, or HTTP method with minimal token usage. |
describe_operation | Load the complete OpenAPI 3.1 parameters, request body schema, and response schema for one operation. |
execute_pipeline | Execute 1–8 API calls in a single server-side round-trip with $steps.<id>.body.<field> chaining. |
{
"mcpServers": {
"safestate": {
"url": "https://api.safestate.dev/mcp",
"headers": {
"Authorization": "Bearer YOUR_SAFESTATE_API_KEY"
}
}
}
}
3. Hosted OpenAPI 3.1 REST API
The live machine-readable schema is served at https://api.safestate.dev/v1/openapi.json (also aliased at /openapi.json).
# Verify service health
curl -s https://api.safestate.dev/v1/health
# Inspect live OpenAPI 3.1 specification
curl -s https://api.safestate.dev/v1/openapi.json
# Start a deterministic stateful simulation burst run
curl -s -X POST https://api.safestate.dev/v1/runs \
-H "Authorization: Bearer YOUR_SAFESTATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"orgId": "your-org",
"repo": "your-org/billing-api",
"commitSha": "a1b2c3d4e5f6...",
"moduleId": "billing-refunds",
"traceCount": 5000,
"shardCount": 10
}'
4. Optional .safestate.yml configuration
SafeState auto-discovers stateful modules, Drizzle/Prisma/SQLite/SQL schemas, and exported operations automatically. Add .safestate.yml at the repository root only if you want to pin modules, budgets, or differential targets:
version: 1
modules:
- id: billing-refunds
entry:
- src/billing/refunds.ts
- src/billing/webhooks.ts
orm: drizzle # drizzle | prisma | sqlite | sql | none
schema: src/db/schema.ts
traces: 5000
fail_on_violation: false # advisory by default; set true to gate PR merges
differential:
enabled: false
baselineRef: main
5. Supported stacks & verification modes
| Dimension | Supported in V1 |
|---|---|
| Languages | TypeScript, JavaScript (Node.js, npm, pnpm, yarn, bun workspaces), Python |
| Databases & ORMs | PostgreSQL via Drizzle, Prisma, or raw SQL (PGlite in-memory snapshot/restore); SQLite & Cloudflare D1; ORM-free stateful modules |
| Deterministic twins | Stripe API + webhooks, outbound HTTP fetch, virtual clock & timers, seeded PRNG, local filesystem/process state |
| Verification modes | Stateful invariant simulation, async yield-point interleaving, differential equivalence (v1 vs v2), anti-tautology mutation gating |
| Output artifacts | Shrunk minimal trace, deterministic seed & SHA-256 digest, standalone Vitest repro (0 SafeState imports), coding-agent prompt |
6. Honest V1 PostgreSQL concurrency boundary
Promise.all concurrency, yields across outbound fetch/SDK calls, out-of-order or duplicate webhooks, non-atomic read-modify-write handlers, and module-level singleton leaks) on a single database connection. True multi-connection PostgreSQL MVCC lock contention (SELECT ... FOR UPDATE blocking or SERIALIZABLE retry storms) requires a multi-connection PostgreSQL server rather than single-connection PGlite.
7. Billing, activation & cancellation
Paid plans (Starter at $49/month, Team at $199/month) are sold through Link using Stripe Managed Payments (Merchant of Record). Enter your GitHub organization or user login in the GitHub account field at checkout so your plan activates automatically via webhook.
- Self-serve portal: Manage invoices, payment methods, or cancel anytime in the Stripe billing portal.
- Reply by email: Reply to any SafeState email asking to cancel or request a 30-day first-month refund.
- Direct contact: Write to hello@safestate.dev.