Skip to main content
Latchkey is pre-V1. These docs describe the V1 design, and most of it is not built yet.
Latchkey answers one question before a product RPC reaches its handler. May this subject perform this action on this kind of resource, and on this specific resource? Products describe their domain in proto annotations. Latchkey evaluates a fixed model and returns allow or deny. It runs two ways from the same Go module. As a service, one instance serves several products and many tenants. Embedded, it runs inside a single Go product with nothing extra to deploy. The model, the API and the data are the same in both.

What it gives a product

  • One authorization model for every product, such as Filament and Alchemy.
  • Checks in a Connect interceptor, before a request reaches a handler. Products never evaluate policy.
  • Built-in Admin, Creator and Viewer roles, plus custom roles each tenant defines.
  • Roles bound to users, groups or services, across the tenant or on a single resource.
  • A stable ConnectRPC API that any team can run as its own service.

What it leaves out

  • Authentication. Latchkey receives a subject that was already verified upstream.
  • Row-level security. Read covers the whole tenant, and list results are never filtered.
  • Project scope. Filament and Alchemy have no projects yet. A project scope can be added later as a new kind of scope.
  • A policy language. The model is fixed and evaluated in Go.

Where to go next

Concepts

The model, how a check decides, and a worked example.

Integrate a product

Annotate protos, install the interceptor and turn enforcement on.

Deploy

Service and embedded modes, the database boundary and failure behavior.

Security

Who may call what, and how Latchkey fails closed.