Skip to main content
Not yet enforced — see the roadmap. This page describes subject-tag matching (comparing a subject’s tags to a resource’s tags). The engine does not currently load subject tags into evaluation, so subject.tags.* is always undefined and the matching patterns below never grant today. For attribute-based rules you can use right now: resource-side tag conditions, subject.meta.* attributes, resource policies, and resource ownership. The examples below describe the intended model. Also note that conditions attach to the role-permission edge (condition), not a permission logic field.

Overview

Tag-based access control (ABAC) uses tags on subjects and resources to make dynamic authorization decisions. Instead of static role assignments, access is determined by matching attributes. Example: “Users can read documents tagged with their department.”

How It Works

  1. Tag subjects with attributes (department, clearance, skills)
  2. Tag resources with attributes (department, sensitivity, category)
  3. Create permissions with JSON Logic conditions that compare tags
  4. Evaluation checks if the subject’s tags match the resource’s tags

Basic Tag Matching

Department Match

Users can only access documents in their department:

Evaluation

JSON Logic Patterns

Any Tag Matches

Subject has at least one tag that matches the resource:

All Tags Required

Subject must have ALL tags the resource has:

Specific Tag Required

Resource must have a specific tag:

Clearance Level

Subject’s clearance must meet or exceed resource’s requirement:

Combined Conditions

Multiple conditions with AND/OR:

Common Patterns

Pattern 1: Department-Based Access

Pattern 2: Sensitivity Levels

Pattern 3: Labor Class Matching (Construction)

Pattern 4: Project Team Access

Pattern 5: Geographic Restrictions

Context Variables

In tag-based conditions, you have access to:
There is no resource.meta, resource.type, or subject.type in the condition context—use resource.resourceType and subject.subjectType, and put custom data in subject.meta, resource tags, or top-level context keys.

Debugging Tag Conditions

The evaluation response includes context for debugging:

Best Practices

Complex nested conditions are hard to debug. Break them into multiple permissions if needed.
The key appears in conditions (resource.tags.departments), so make it readable.
Test with subjects/resources that have no tags, multiple tags, and mismatched tags.
Use the permission’s description field to explain what the condition does.
Tag-based conditions work alongside roles. A subject still needs the permission via a role.

Next Steps

Delegation

Learn about acting on behalf of other subjects

Conditional Permissions

More JSON Logic patterns