Ory Keto is a permission server written in Go by Ory Corp. Its README calls it “an open source implementation of ‘Zanzibar: Google’s Consistent, Global Authorization System’” (README). Ory also runs it as a managed service: “Ory Permissions is powered by the open source Ory Keto” on the Ory Network (same README).
Keto did not start as a Zanzibar system. The Zanzibar design arrived in v0.6.0-alpha.1 on 2021-04-07; the release notes say the earlier Keto moved to a legacy-0.5 branch and that “the architectures are vastly different” (release notes). Userset rewrites, written in the Ory Permission Language, followed in v0.10.0-alpha.0 on 2022-09-27 (release notes).
Paper and Keto side by side
| In the paper | In Ory Keto |
|---|---|
| Namespace config (§2.3) | A class that implements Namespace in the Ory Permission Language (OPL), a subset of TypeScript (OPL reference) |
Relation tuple object#relation@user (§2.1) |
namespace:object#relation@subject, for example Group:eng#members@User:beto (relation tuples, parser) |
_this |
this.related.viewers.includes(ctx.subject) |
computed_userset |
this.permits.edit(ctx): “A permission can call another permission defined on the same namespace” |
tuple_to_userset |
this.related.parents.traverse((p) => p.permits.view(ctx)) |
| Union, intersection, exclusion | ||, &&, ! |
| Zookie (§2.2, §2.4) | snaptoken fields exist in the API, but each is “not implemented yet and has no effect” (check_service.proto) |
| Check (§2.4.4) | CheckService.Check, BatchCheck |
| Read (§2.4.1) | ReadService.ListRelationTuples (read_service.proto) |
| Write (§2.4.2) | WriteService.TransactRelationTuples, DeleteRelationTuples (write_service.proto) |
| Watch (§2.4.3) | None in the API |
| Expand (§2.4.5) | ExpandService.Expand (expand_service.proto) |
| Leopard (§3.2.4) | No equivalent documented |
| Spanner (§3.1) | PostgreSQL, MySQL or CockroachDB; SQLite for development only (production guide) |
The running example in OPL
The paper’s Figure 1 makes owners editors, editors viewers, and viewers of the parent folder viewers of the document (§2.3.1). In OPL, each namespace is a class: related declares the relations and the subject types they accept, and permits holds functions that return true or false for ctx.subject.
import { Namespace, SubjectSet, Context } from "@ory/keto-namespace-types"
class User implements Namespace {}
class Group implements Namespace {
related: {
members: User[]
}
}
class Folder implements Namespace {
related: {
viewers: (User | SubjectSet<Group, "members">)[]
}
permits = {
view: (ctx: Context): boolean => this.related.viewers.includes(ctx.subject),
}
}
class Doc implements Namespace {
related: {
parents: Folder[]
owners: User[]
editors: (User | SubjectSet<Group, "members">)[]
viewers: (User | SubjectSet<Group, "members">)[]
}
permits = {
edit: (ctx: Context): boolean =>
this.related.owners.includes(ctx.subject) ||
this.related.editors.includes(ctx.subject),
view: (ctx: Context): boolean =>
this.related.viewers.includes(ctx.subject) ||
this.permits.edit(ctx) ||
this.related.parents.traverse((p) => p.permits.view(ctx)),
}
}
SubjectSet<Group, "members"> is the OPL type for “the members of a group”, the paper’s userset. Relations are always arrays because “an object can have many subjects” (OPL reference).
The five tuples of the running example, in Keto’s text form. A subject written as User:anne is a subject set with an empty relation; the maintainers’ sample tuples write users this way (tuples.json).
Doc:readme#owners@User:anne
Group:eng#members@User:beto
Doc:readme#viewers@Group:eng#members
Doc:readme#parents@Folder:A
Folder:A#viewers@User:chen
Which tuple and which OPL expression decide each person’s access to the readme?
Notice that only the arrows are stored. Every step that turns an owner into a viewer, or a folder viewer into a document viewer, lives in the permits functions and runs at check time.
Architecture
Which parts of a Keto deployment talk to which?
- Each container serves a Read API (default port 4466), a Write API (4467) and an OPL syntax API (4469), each over HTTP and gRPC (config schema).
- “A good practice is to not expose the Write API at all to the public internet”, and “The Read API should also be protected” (production guide).
- Scaling: “There are no additional requirements for scaling when self-hosting Ory Keto, just spin up another container!” (same guide). The containers share the database.
Consistency
The paper’s zookie lets a client ask for a check “at a consistent snapshot no earlier than the given zookie” (§2.4.4). Keto’s protobuf API carries the same idea in its field names: snaptoken on Check, Expand and ListRelationTuples, snaptokens on TransactRelationTuples, and a latest flag for a content-change check. Every one of these fields is documented as “not implemented yet and has no effect” (check_service.proto).
What happens to a token a client sends today?
Notice that the guarantee the paper builds on zookies, protecting content from the “new enemy” problem (§2.2), therefore depends on how the SQL database behaves underneath. The Keto documentation pages checked here make no statement about consistency.
Differences from the paper
- No zookies. The fields exist; the behaviour does not (see above).
- No Watch. The v1alpha2 API has Check, Expand, Read, Write, Namespaces and Version services, and a separate OPL syntax service (
opl/v1alpha1), but no change stream (proto directory). The paper’s Watch feeds secondary indexes and Leopard (§2.4.3, §3.2.4). - No Leopard. No denormalized set index is documented.
- A programming-language syntax. OPL is a subset of TypeScript so that “users can get context help from their IDE” (OPL specification). The paper’s Figure 1 writes a config in a protocol-buffer-style text syntax (§2.3.1); the paper does not name the format.
- SQL storage. One shared SQL database rather than Spanner (§3.1).
- Check depth. Check requests carry a
max_depth, “The maximum depth to search for a relation” (check_service.proto).
Status
- First release 2018-11-13 (pre-Zanzibar design); Zanzibar design from v0.6.0-alpha.1 on 2021-04-07; OPL from v0.10.0-alpha.0 on 2022-09-27 (releases).
- Version numbers changed scheme after v0.14.0 (2025-03-06): the next release was v25.4.0 (2025-11-07), then v26.2.0 (2026-03-20), the latest on 2026-11-13.
- Last commit to the default branch: 2026-07-29. About 5.4k stars (GitHub API, 2026-11-13).
Sources
- Ory Keto repository and README: github.com/ory/keto
- Release v0.6.0-alpha.1: github.com/ory/keto/releases/tag/v0.6.0-alpha.1
- Release v0.10.0-alpha.0: github.com/ory/keto/releases/tag/v0.10.0-alpha.0
- Ory Keto docs: ory.com/docs/keto
- OPL reference: ory.com/docs/keto/reference/ory-permission-language
- OPL specification: github.com/ory/keto/blob/master/docs/ory_permission_language_spec.md
- Relation tuples: ory.com/docs/keto/concepts/relation-tuples
- Tuple string format: github.com/ory/keto/blob/master/ketoapi/enc_string.go
- Sample namespaces and tuples: namespaces.keto.ts, tuples.json
- gRPC services: github.com/ory/keto/tree/master/proto/ory/keto
- Configuration schema: github.com/ory/keto/blob/master/embedx/config.schema.json
- Production guide: ory.com/docs/keto/guides/production