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#

Stored object types start closed over the Project API, caller globals come from verified credentials and schema changes run only on the Control API.

Closed by default

Object types refuse API reads and writes without an allow policy.

Static query checks

Napalm rejects multi-statement scripts, DDL, session commands and catalog queries before compilation.

Eight runtime rules distinguish Napalm’s Project API from an open upstream Gel server.

Default-deny object types
In Napalm, any stored type without a declared or inherited access policy is closed over the Project API until you add explicit allow rules. Upstream Gel lets every caller read and write types that declare no 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 declares using extension napalm; to load Project API settings, service 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, ext::napalm::Job and ext::ai search functions are callable from Project API statements
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 built-in data-plane and agent routes.

RouteServes
POST /query, /query/{name}Ad-hoc and deployed EdgeQL statements, action handlers, dry-run previews and causal bookmarks.
POST /subscribeMultiplexed SSE live queries that stream patches as commits change results.
GET /changesPolicy-filtered change log ordered by commit bookmark (after, since, until, types).
POST /searchPolicy-filtered vector and hybrid full-text search across indexed object types.
POST /askCompiler-checked natural-language EdgeQL generation and read-only execution as the caller.
POST /mcpStreamable 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.

User sessions and grants

Sign-in sessions identify people, and OAuth consent grants scope external agents.

Access policies read these identity and grant records through built-in globals on every request.

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. Managed buckets store the bytes while your schema’s access policies govern uploads, presigned URLs, magic-byte checks and backup retention.

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 for vector indexes (ext::ai::index), similarity search (ext::ai::search) and hybrid search (ext::ai::hybrid_search) blending fts::index keyword ranks with vector distance. Indexes scale from a few rows to tens of millions of vectors with no schema change.

Commit webhooks, actions and sharding#

Napalm extends Gel’s schema model with transactional outbound webhooks, HTTP actions and declarative shard placement.

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 group related records onto PostgreSQL shards by top-level owner (Account, Project, Site or Organization) without composite keys or app-side shard routing. See Placement roots and Schema & extensions.

Type a word or two to search every docs page.