Oso and Polar
What it is
Oso is an authorization product. Its policy language, Polar, is a logic programming language close to Prolog. The open-source Oso library (with an embedded Polar engine) was deprecated in December 2023; the last library release was 0.27.3 in January 2024. Polar lives on in Oso Cloud, the hosted service.
Model
- Entities: application classes (users, resources) registered with the engine, or, in Oso Cloud, typed facts.
- Rule forms: Prolog-style rules, for example
allow(actor, action, resource) if has_permission(actor, action, resource);. Since 2021 "resource blocks" declare roles, permissions and relations per resource type, with shorthand rules such as"read" if "viewer";. - Combining: logic disjunction. A request is allowed if any proof of
allowexists. Forbid is not native; it is written with negation (not) or by structuring the rules. - Default: deny (no proof found).
- Data filtering: the engine can turn a policy into a filter over the database ("list everything this user may read").
Formal semantics and what is proved
- No published formal semantics. Evaluation is backtracking resolution, as in Prolog. Recursion is allowed, so evaluation need not terminate in general.
- No proofs, no analyser for policy properties. Tests and a REPL.
Purpose and use case
None.
Uncertainty
None.
History and state
None.
What we can reuse
- Resource blocks: a compact way for owners to state roles and relations per asset type. A good model for how an owner's sentence turns into rules.
- Data filtering: deciding over whole classes of assets at once, not one request at a time. Useful for "which documents may this agent see".
What it lacks for us
- Turing-complete style without termination guarantees. The opposite of what we need for proofs.
- No formal semantics, no forbid algebra, no forms, no purpose, no uncertainty, no history.
Key references
- Oso library repository, with the deprecation notice in its README. https://github.com/osohq/oso
- Oso documentation (Oso Cloud and Polar). https://www.osohq.com/docs