Skip to the page

Learn · Get started

Napalm and Gel

Napalm runs Gel's schema language and EdgeQL on a redesigned engine and compiler.

API
—

Security and execution defaults#

Napalm runs standard SDL schemas and EdgeQL on a hardened multi-tenant runtime: stored object types default to closed, caller globals bind strictly from verified credentials and DDL stays isolated on the Control API.

Closed-by-default types

Any stored object type without a declared or inherited access policy refuses all Project API reads and writes until explicit allow rules exist.

Static statement gate

Multi-statement scripts, DDL, set global, catalog introspection and outbound std::net calls are rejected with 400 query_rejected before compilation.

Default-deny object types
In Napalm, any stored type without an access policy (declared or inherited) is completely closed over the Project API until you add explicit allow rules. Upstream Gel lets every caller read and write a type without access policies. See Access and sign-in.
Credential-bound globals
Clients cannot set globals, config parameters or roles in request payloads. Napalm binds ext::auth::ClientTokenIdentity from the verified session JWT and injects your endpoint’s userGlobals or serviceGlobals automatically.
Private schema functions
Functions marked set is_private := true can be called from schema expressions (computed fields, policies, triggers, rewrites) inside the same module. Direct client calls are rejected.
Disallowed outbound net calls
Schema expressions cannot invoke std::net directly. Outbound HTTP side effects run through audited notify webhooks and deployed query actions.
Path- and key-scoped branches
Callers cannot switch branches via connection headers. The URL prefix (/ for main, /branches/{name}/ for branches) and the branch bound to the credential determine which database runs the query.
HTTPS only
A project’s hostname serves only the HTTPS routes below and refuses Gel’s binary protocol and raw SQL, so Gel’s client libraries and the gel CLI do not connect. Coming from Gel covers moving an app over.
Control-plane DDL
The Project API executes data statements only. Schema migrations run through napalm schema push or the Control API.
Napalm’s extension
Every schema must declare using extension napalm;, which provides the Project API’s settings, keys, deployed queries, jobs and sessions. Schema pushes reject schemas that omit this declaration.

Rejected statements#

Napalm checks every statement on the Project API against static boundary rules before execution.

Rejected constructReason
Multi-statement scripts or start transactionEvery request executes one EdgeQL statement as one atomic SQL query
DDL (create, alter, drop, migrate) and configureSchema and configuration changes require an org token on the Control API
Session commands (set global, set module, reset)Globals and module context come strictly from the verified credential
System modules (sys, cfg, schema, __)Untrusted callers cannot introspect the catalog or runtime
Direct ext::* callsOnly ext::pgcrypto, the branch’s jobs (ext::napalm::Job) and the searches of ext::ai are open to a caller’s statement
Introspecting .__type__ beyond .__type__.name.__type__.name is allowed for polymorphic union discrimination

Reserved words inside comments and string literals never trigger a rejection. Disallowed constructs return 400 query_rejected.

Project routes#

Every project’s dedicated hostname serves seven data-plane and agent routes out of the box.

RouteServes
POST /query, /query/{name}Ad-hoc and deployed EdgeQL statements, action handlers, rollback is_dry_run diffs and Napalm-Bookmark causal reads.
POST /subscribeMultiplexed SSE live queries, each patched as commits change the result.
GET /changesAccess-policy-filtered CDC stream ordered by commit bookmark (after, since, until, types).
POST /searchPolicy-filtered vector and hybrid full-text search across indexed object types.
POST /askCompiler-verified natural-language EdgeQL generation and read-only execution as the caller.
POST /mcpStateless Streamable HTTP MCP server exposing deployed queries, actions, dry runs, schema and reach tools.
POST /a2aA2A 1.0 JSON-RPC server with discovery at /.well-known/agent-card.json.

Authentication and OAuth agent grants#

Napalm pairs ext::auth PKCE user sign-in with OAuth 2.1 agent consent grants in ext::napalm.

PKCE user sessions & OAuth 2.1 AgentGrant

ext::auth binds ClientTokenIdentity for signed-in people while ext::napalm::AgentGrant scopes dynamic OAuth 2.1 agent tokens to explicit user consent.

Type or globalPurpose
ext::auth::IdentityAuthenticated user identity record.
global ext::auth::ClientTokenIdentityVerified Identity of the calling user session ({} for service keys).
ext::auth::EmailFactorVerified email factor linked to an Identity.
ext::napalm::AgentGrantStored OAuth 2.1 user consent grant (global ext::napalm::ClientTokenAgentGrant).
ext::napalm::AgentClientDynamically registered OAuth 2.1 agent client metadata.

Transactional files#

Declaring using extension files; lets any object type extend ext::files::File with managed private and public buckets, presigned URLs governed by the record’s access policies, magic-byte sniffing and retention-aware cleanup across your point-in-time restore window.

Extension typeProvided fields and variants
ext::files::Filefile_name, file_size, file_status, file_format, file_error, file_is_public, file_upload, file_url and file_download_url.
ext::files::StatusEmpty, Uploading, Ready.
ext::files::UploadErrorSizeMismatch, TypeMismatch, NotAccepted, NotUploaded, Expired.
ext::files::FormatAround 120 binary formats detected from magic bytes, including Pdf, Png, Jpeg, Webp, Mp4, Parquet, Glb, Text and Other.

See Files and object storage, Vector and hybrid search and File uploads.

using extension napalm; enables the AI extension, adding vector indexes (ext::ai::index), similarity search (ext::ai::search) and single-pass hybrid search (ext::ai::hybrid_search) that blends fts::index keyword ranks with vector distance. An index grows from a few rows to tens of millions of vectors across memory and object storage with no schema change.

Commit webhooks, actions and sharding#

notify
Declare notify <name> after insert, update, delete on any object type to emit HMAC-SHA256 signed commit webhooks (ping summaries or policy-filtered rows) with causal bookmarks. See Notifications & webhooks.
Actions
Attach an HTTPS handler to any deployed query so policy-checked rows trigger external side effects (like Stripe or email APIs) with ES256 caller assertions and RFC 8693 token exchange. See Actions.
ext::napalm::root
Ownership roots spread a multi-tenant schema across PostgreSQL shards by tenant without composite keys or app-side shard routing. See Placement roots and Schema & extensions.

Type a word or two to search every docs page.