1 of 62

@Permissioned Spaces

Expressive Authorization at the PDS

@verdverm.com | @blebbit.app

2 of 62

About me & blebbit

@verdverm.com

@Dr Worm (Tony)

PhD CS / ML

DevOps / DevEx

I ♥️ CUE (cuelang.org)

@blebbit.app

Communities Platform

Discord, Discourse, Reddit,� FB Groups, GitHub, …

3 of 62

What are we talking about today?

Permissioned “spaces” in the PDS

Zanzibar and SpiceDB for ReBAC (relation based)

Capability Based tokens for delegation

Prototypes with ATProtocol

4 of 62

What are we NOT talking about today?

X E2EE encrypted data / messaging (~possible)

X Private Accounts (~possible)

X Keys and distribution (out of scope)

� Develop in parallel and become options for the people

5 of 62

Where do we start from?

Use Case and UX/DX

@bnewbold’s comment in #3363 - Private Data in the Repo?

Zanzibar & SpiceDB for ReBAC

Build, experiment, and talk in parallel together

6 of 62

Use-cases - (basically all existing apps)

Goal to craft a permissions fabric for all* apps?

  • Google & Apple accounts
  • Communities and private groups
  • App content / preferences / secrets
  • E2EE record content and blobs
  • PDS operators (admin ui)... ozone & labelers too?!
  • API keys, service accounts, app integrations
  • Business internal or SaaS operations

7 of 62

People want privacy online

The People are asking #ATProtoDev for solutions

  • Private accounts and group membership
  • Paid or restricted content
  • Small groups to big communities
  • Public vs private by default

The people also want public spaces with permissions!

8 of 62

Prototypes & Experiments

Spaces, Groups, Roles, Relations, Content

Limit to the @atproto/… packages

Credible Exitible Philosophy (CEP)

Backwards Compatible with repos and network

Foundation for @blebbit.app … really any app

SpiceDB … thinking about it like an SQL database

Apps outsource IAM, PDS handles Dual Write / New Enemy

9 of 62

Dual Write Problem (transactions)

Want transaction semantics

Write to 2+ databases

FUBAR failures

Hard Problem!

Authzed - The Dual Write Problem (blog)

Authzed - Solving the Dual Write Problem (video)

10 of 62

New Enemy Problem (consistency)

  1. Alice has a group
  2. Alice removes Darth
  3. Alice adds a document

can Darth see new content for a moment?� when is the permission system consistent?

Zookie, an opaque consistency token

11 of 62

Zanzibar / SpiceDB

Relation Based Access Control (ReBAC)

  • SpiceDB is the open source Zanzibar
  • Scales both up and down, great SLAs
  • Developer friendly schema and operations
  • S-tier tooling, documentation, and learning materials
  • Supports all manner of setups
  • Credible Exit Philosophy (bulk, filtered export)
  • Firehose for auditing access and changes
  • Aligns well with AT-URI and PDS hosting
  • Avoid implementing permission query engine

12 of 62

Capability Based Tokens / Authorization

I’m new to this, grain of salt*

  • JWT stores a precomputed authorization
  • Caching, optimization layer, specific use cases
  • Enables delegation (App -> PDS -> PDS/Service)
  • Great for scaling the permissioned network
  • Requires a permission system

13 of 62

Relation to OAuth in @ATProtocol

OAuth Scopes Permissions and Relations

Permission Sets Roles

App <-> Account Account <-> Account

(App <-- PDS --> PDS )

14 of 62

@spaces?

15 of 62

@spaces? (╯°°)╯ ɐʇɐp

  • Google Workspace | GCloud IAM like
  • Spaces, Groups, Roles, Relations, Content
  • Partition the permission space by DID
  • Every account has a /root space
  • Spaces and records nest, spaces contain everything
  • New com.atproto.space lexicons
  • A few tables in per-repo sqlite db, no MST

16 of 62

at://…?

AT-URI needs to grow

at://<did>/<nsid>/<rkey> ... ?

17 of 62

at://verdverm.com?space=my-space

AT-URI needs to grow… this is backwards compatible

at://<did>/<nsid>/<rkey> ? space = <skey> & ...

Unlocking query parameters is an interesting idea

18 of 62

@spaces?

19 of 62

@spaces?

/root

20 of 62

@spaces?

/root

owner

21 of 62

@spaces?

/root

/bsky

owner

22 of 62

@spaces?

/root

parent

/bsky

owner

23 of 62

@spaces?

/root

parent

/team

/bsky

owner

24 of 62

@spaces?

/root

parent

/team

/bsky

owner

25 of 62

@spaces?

admin

/root

parent

/team

/bsky

owner

26 of 62

@spaces?

admin

/root

?

parent

/team

/bsky

owner

27 of 62

@spaces?

admin

/root

?

parent

/team

/bsky

owner

read

28 of 62

@spaces?

admin

/root

?

parent

/team

/bsky

owner

read

29 of 62

@spaces?

admin

/root

?

parent

/team

/bsky

owner

read

like

30 of 62

@spaces?

admin

/root

?

parent

/team

/bsky

owner

read

like

/friends

31 of 62

@spaces?

admin

/root

?

parent

/team

/bsky

owner

read

like

post

/friends

32 of 62

@spaces? (╯°°)╯ ɐʇɐp

admin

/root

?

parent

/team

/bsky

owner

read

like

post

/friends

33 of 62

@spaces? (╯°°)╯ pɐǝɹ

admin

/root

?

parent

/team

/bsky

owner

like

post

/friends

X

34 of 62

@spaces? (╯°°)╯ sddɐ

admin

/root

?

parent

/team

/bsky

owner

/friends

like

post

X

35 of 62

@joehills.net

36 of 62

@joehills.net

37 of 62

@joehills.net

38 of 62

@joehills.net

39 of 62

@joehills.net

/minecraft

40 of 62

@joehills.net

/minecraft

41 of 62

@joehills.net

/minecraft

/personal

42 of 62

@joehills.net

/minecraft

/personal

43 of 62

@joehills.net

/minecraft

/personal

44 of 62

@joehills.net

/minecraft

/personal

45 of 62

@joehills.net

/minecraft

/personal

46 of 62

@joehills.net

/minecraft

/personal

47 of 62

@prototype!

48 of 62

@blebbit / atproto

Fork of bluesky-social / atproto with patches

SpiceDB running next to the PDS

Schema, lexicon, and implementation, everything is wired up

Tooling for user-story experiments

PDS container image and pnpm overrides for clients

R&D instance & test network (permissioned relays experiments?!)

49 of 62

User Stories - experiment & contribute

50 of 62

User Stories - experiment & contribute

51 of 62

User Stories - experiment & contribute

52 of 62

User Stories - experiment & contribute

53 of 62

User Stories - experiment & contribute

54 of 62

User Stories - experiment & contribute

55 of 62

User Stories - experiment & contribute

56 of 62

User Stories - experiment & contribute

57 of 62

User Stories - experiment & contribute

58 of 62

User Stories - advanced features

  • NSID & context based access
  • Nested spaces, bubbles, and records
  • Time based access ( before, after, window, expire )
  • Inbox, notifications, firehose, sync
  • Content with permissioned partials
  • Move spaces and their contents
  • API keys, service accounts, app integrations
  • Moderations and appeals on the protocol

59 of 62

Prototype - @record table

60 of 62

Prototype - @spaces table

61 of 62

@Permissioned Spaces

  • Authorization features for every User and App
  • PDS is the arbiter of AuthZ
  • Easy to reason about and use
  • Credible Exit & Backwards Compatibility
  • Unlocks and enables an ecosystem

62 of 62

@questions?