Part of the Determesh series.

What

Every resource in Determesh is denied to every user unless a rule allows them. Rules compare attributes the company set on a user. A resource can also take the decision itself, through its own access check. Whatever decided, the answer is cached per user and resource, and either side can correct the cache when something changes.

Why

Roles are too coarse

Most chat platforms with permissions stop at roles: admin, operator, user. A company with real data needs more than that. A level 3 employee in HR may read the policy documents but not the salary sheet. A contractor may see the holiday list until the contract ends. A customer may check their own transactions after verifying their email, and nothing else.

Those are conditions on facts about a person, which is attribute-based access control.

The company knows, and sometimes only the resource knows

Some decisions Determesh can make from attributes. Others only the resource can make: whether this person is a current customer is in the bank’s database, not in ours. So there are two kinds of answer, and both need to end up in the same place.

How

Rules: AND inside, OR between

A user’s identity holds typed attributes: user_level = 3, department = "hr", employee = true. A rule is a chain of conditions joined with AND:

employee == true AND user_level < 4

Rules combine with OR: if any rule that applies allows the user, they are in. That is the whole logic. Operators are kept small: equals and not equals for any type, less and greater for numbers, a case-insensitive contains for strings. An operator that does not suit the type is refused when the rule is saved, not when it is evaluated.

A missing attribute fails the condition. A brand new user has no attributes, so in the strictest setup they reach nothing until a verification or an admin gives them something. A rule with no conditions matches everyone, and that is how a company opens a resource, such as an FAQ, to all.

A rule can also target one identity, carry read, write and delete grants separately, apply to one method of a resource instead of the whole resource, and hold a date range. “This contractor, read only, until the end of March” is one rule.

The tree, and a child wider than its parent

Resources sit in a tree that the company arranges. A rule on a folder either applies to that folder only or propagates to everything under it.

Inherited rules and a node’s own rules all count, and any one is enough. So a child can be wider than its parent:

HR docs              user_level < 4, propagate
 ├── Policies        (inherits)
 ├── Salaries        (inherits)
 └── Holiday list    (inherits) + employee == true

A level 5 employee can read the holiday list and nothing else in HR docs. Search follows the same rule: an allowed child inside a hidden folder is still found, because the orchestrator searches resources directly instead of walking the tree.

Two policies, one cache

There are two separate things here, and keeping them separate is what makes the system hold together.

PolicyWhat it isWho sets it
Identity policyAttributes and rules: Determesh’s view of what a user may reachThe company admin, or a resource
Access policyA cache, per user and resource, of the yes or no that was decidedFilled from decisions

When creating a resource, the company picks its strategy. Accept identity policy: Determesh evaluates the rules and decides. Handle on its own: Determesh asks the resource, sending what its rules would say as a suggestion, and the resource answers yes or no from its own data or its own verification. A resource can only handle access on its own if it has a method to answer with, so a PDF always uses the rules.

Either way the answer is cached, and per user each resource is in one of three states: allowed, denied, or not decided yet. Not decided is the normal starting point. A resource is asked only when it is needed.

Keeping the cache honest in both directions

A cached answer can go stale two ways, and each has its own fix.

Allowed becomes denied. This one fixes itself. A self-managed resource still checks the user on every call. If the user was deleted on the resource’s side yesterday, today’s call is refused, and the cache flips to denied.

Denied becomes allowed. This one never fixes itself. Determesh skips resources cached as denied, so it would never call the resource to find out things changed. So the resource has to say so, with a signed call to Determesh: grant this user, or forget what you cached for this resource.

Because the second rule exists, a cached denial can be trusted, and the orchestrator can skip denied resources without asking again.

The identity side evicts too. When an admin changes a user’s attribute or edits a rule, the affected cached answers are dropped, and the next access is decided fresh.

Verification opens the way

The strictest setup gives a new user nothing. That would make the system useless for customers who arrive on Telegram as strangers. So a resource can answer “not yet, verify first, and I need an email”. The orchestrator asks the user, a verifier resource checks them, and the result is recorded against their identity. Then access is decided again, now with the verification in hand.

How verification works across many resources at once, without asking the user twenty times, is its own post.

When nothing works

If a user can reach nothing that matches, even after verification, they get a soft refusal. If they keep sending, the evaluator scores the exchanges down, and the block rules from the evaluator post take over. Access control never has to deal with persistence. That was the point of making it simple.


Previous: Five AI Roles, Five Separate Conversations

Next: Submit Only: Why Replies Come Back by Webhook