Security model
How Blueprint isolates generated code, protects your data and secrets, authenticates wallets, and keeps every transaction under your explicit control.
Principles#
- Blueprint never asks for a seed phrase or private key. Nothing in the product accepts one. Treat any request for one as an attack.
- AI never authorizes transactions. The model writes code and explanations; only your wallet, after you confirm, can sign. Real-money contracts are never deployed automatically.
- Generated code never runs on Blueprint's servers. It is validated and bundled server-side, and executed only in a sandboxed browser frame or a hosted page with a strict CSP.
- Results are never fabricated. Compilation output, test results, findings and confirmations are stored as the tools and the chain produced them.
- AI-generated is not independently reviewed. Blueprint labels generated code as such and never implies an audit.
Sandboxing generated code#
| Stage | Isolation |
|---|---|
| Validation | Paths, file count, size and imports are checked deterministically. Only react, react-dom/client, lucide-react, viem, @blueprint/wallet, @blueprint/router and relative imports are accepted. |
| Bundling | esbuild runs against Blueprint's own node_modules: no package installs, no install scripts, no network, no execution of project code on the server. |
| Preview | <iframe sandbox="allow-scripts allow-forms allow-modals"> without allow-same-origin — an opaque origin with no access to Blueprint cookies, storage or APIs. |
| Hosting | /apps/<slug> is served with default-src 'none', connect-src limited to verified RPC origins plus declared https origins, frame-ancestors 'none', and an opaque-origin sandbox when apps share the platform origin. connect-src never includes the platform origin, so a hosted app cannot call Blueprint's APIs with a visitor's session. |
| Contracts | Foundry and Slither run in a per-job OS sandbox: no network, writes only inside the job directory, reads limited to the job, pinned libraries and pinned compilers. |
Data isolation#
The application connects to Postgres as a role with NOSUPERUSER NOBYPASSRLS, and every table has row-level security forced on. Each request runs with the caller's user id set for that transaction, so the database itself refuses rows that belong to someone else — a bug in a query cannot leak another user's private project or source.
- Private projects, their files and versions are readable only by their owner; public and demo projects are readable by everyone.
- Trusted server paths (workers, aggregates) use an explicit service context; all SQL is parameterised.
- The app role cannot update or delete audit log rows.
Authentication#
- Sessions use a random token in an http-only, SameSite=Lax cookie. Only its SHA-256 hash is stored server-side.
- Wallet sign-in is Sign-In with Ethereum: the server issues a single-use nonce bound to your session, valid for 10 minutes. The message must match Blueprint's domain, be unexpired and come from a supported chain; the signature is verified server-side (EOAs and ERC-1271/6492 smart wallets).
- The sign-in message states that it does not authorize any transaction or spending.
- API keys are random
bp_…secrets shown once; only their SHA-256 hash is stored. Keys are scoped, revocable, never admin, and cannot perform session-only actions. - Admins are configured by wallet address (
BLUEPRINT_ADMIN_ADDRESSES) on the server.
Environment variables and secrets#
| PUBLIC_* variables | Private variables | |
|---|---|---|
| Reaches builds | Yes — inlined into the browser bundle | Never |
| Sent to AI | No | Never |
| Stored as | Plain text (it is public by definition) | AES-256-GCM ciphertext |
| Visible in the UI | Full value | Name, last 4 characters (only for values of 12+ characters) and updated time |
| Visible to admins | No admin view | Never |
| Exported | Name and value in the env template | Name only |
Private values are encrypted with a key derived from the server's session secret using HKDF-SHA256. Each ciphertext is bound to its project and variable name through GCM additional data, so a value copied to another project or name fails to decrypt. The code path that manages variables exposes no decrypt function at all — private values are write-only from the product.
A project can hold up to 100 variables, 8 KB per value. Variable names and whether they are public are written to the audit log; values never are.
PUBLIC_ variable is visible to every visitor of your app. Never put API secrets, private keys or credentials there.Transactions and deployments#
- Every write is built in the browser and confirmed in your wallet. Blueprint holds no keys and signs nothing.
- Production Preview refuses all signatures and transactions; simulation never touches a chain.
- New projects target Elysium mainnet, but nothing reaches a production network until it has passing tests, no open critical/high findings and an explicit typed confirmation — regardless of token holdings. Testnets skip the review so you can rehearse.
- Deployment records come only from transaction receipts; deployed bytecode is compared with the compiled artifact.
- Contract generation includes a permission analysis, and hidden permissions or deceptive token behaviour are never introduced.
Operations, AI and admins#
- Prompts, attachments and file contents are passed to the model as labelled data, so instructions inside them cannot override system rules. Model output is schema-validated before anything is applied.
- A daily AI budget guard stops model calls when the day's recorded spend reaches the configured limit.
- Rate limits apply per account and endpoint family.
- Security-relevant actions (sign-in, key creation and revocation, env changes, payments, publishing, admin actions) are written to an append-only audit log.
- Admins cannot read private environment values or credentials and cannot sign or authorize transactions for users. Every admin action is audited with the admin as actor.
