Free & open · no paywall, ever

IntegrAuth Academy

Identity, security and practical AI — free, from zero. Byte-sized lessons, real diagrams, hands-on labs, zero fluff. Two programs, each with its own exam and certificate.

20 tracks 241 lessons 242 hands-on labs 230+ diagrams 100% free

English is hard? Your browser can translate this page into Tamil, Telugu, Kannada, Malayalam or Hindi. Tech words stay in English so you learn the real names.

How?
  • Chrome on phone: ⋮ menu → Translate
  • Chrome on computer: right-click → Translate to …
  • Edge: the translate icon in the address bar
Identity & API Security Track 7 · AI & Agents
0/166 lessons read
AI & AGENTS · LESSON 2

Fine-grained authorization — ReBAC in practice

Roles answer questions about people: is Priya an admin? Real products also ask about people and things: can Priya open this invoice? That is fine-grained authorization. Your goal: store "who can do what to which thing" as small facts, and check them one by one.

Key points
  • Roles are too coarse when people share individual files.
  • A tuple is one small fact: user, relation, object.
  • Share by writing a tuple. Revoke by deleting it.
  • The app asks Check(user, relation, object) for every decision.

Roles are not enough

RBAC (role-based access control) answers "what is this person?": admin, agent, viewer. But users create and share things. Then the question is about each thing. Can Priya view invoice-42? Can the auditors group read report-q3? With roles you would need one role per file, such as "invoice-42-viewer". Or you would put if-statements all over your code. Both get out of hand.

Picture a hospital. A staff badge opens the main door. That is a role. But a visitor card says, "Priya may see bed 12 in ward 3." That is one small fact about one thing.

FGA is a form of ReBAC (relationship-based access control). It keeps the facts about who can do what in one dedicated store. The app asks the store one small question per decision. Google Drive works this way. You share a file with people or a team, and the file remembers. Nobody gets a "role" for each document. The idea comes from Google's Zanzibar paper. The open-source engine is OpenFGA.

Tuples: small facts

Every permission is one fact. It is a tuple of (user, relation, object):

user:priya · viewer · doc:invoice-42
group:auditors#member · viewer · doc:report-q3

Sharing means writing a tuple. Revoking means deleting it. You need no redeploy and no code change. An authorization model lists the relations for each object type. A doc has an owner, an editor and a viewer. The model also says how relations imply each other. An owner can do everything a viewer can.

Check: one question per decision

Before the app serves anything protected, it asks the store Check(user, relation, object). The answer is yes or no, in milliseconds. The app stops deciding and starts asking.

App (BFF)FGA store1 · Check(priya, can_view, doc:invoice-42)2 · walk tuples + model3 · allowed: true / false
Figure — One question per decision. Check at the moment of use. Do not check only at login, and do not save the answer in a token. Then a revoke works on the very next request.

Groups and inheritance

A tuple can point at a set of users. group:auditors#member · viewer · doc:report-q3 means "every member of auditors may view this". Join the group and you can see the document. Leave the group and you cannot. Removing a person is one delete. Relations can also flow down. A folder's viewer is a viewer of the documents inside it. Three tuples can replace thousands of grants.

Why it matters for AI

An AI assistant reads many documents. A LLM does not know what is allowed. If a document reaches its context, its content can reach the answer. So run a Check for the human who is asking before the model sees anything. Never use the bot's service account. The RAG lesson shows this from start to end. Agents that act ask the same question in MCP governance.

🧪 Interactive lab — enable JavaScript to play with this one.

🧪 Try it free

Designing a relationship model for your product? Talk to our team about ReBAC and OpenFGA.