Skip to main content

Write Your Broker’s Access Policy

Every broker operation—creating users, deploying Actions, publishing to topics—passes through Rules before it executes. This page is the complete syntax reference for writing those rules: the conditions you can check, the scopes you can target, and the patterns that tie them together.
Like writing house rules on a whiteboard. Each rule says “IF you are on the approved list, THEN you may enter the room—ELSE the door stays locked.” LoT rule syntax works the same way: you name the rule, pick the door (scope), and write the condition.

When You Need This Reference

Deploying rules: In a LoT Notebook, just write the rule and run the cell—the extension handles the rest. For MQTT clients, use the -addRule broker command.

On This Page


Rule Structure

Every rule follows this structure:

Conditions

Rules evaluate conditions to decide whether to ALLOW or DENY an operation.

User Identity Checks

Check if the current user matches a specific username:

Permission Checks

Check if the user has a specific permission tag:

Combining Conditions

Use OR and AND to create complex conditions:

Operation Scopes

Rules control different categories of operations. Each scope targets specific broker functionality.

User Management

Control who can manage broker users: This example allows users with the AllowedUserManagement permission or the root user to create new accounts:

Entity Management

Control who can create and manage LoT entities: This example restricts Action creation to administrators and the root user:

Asset Management

Control who can manage installed assets (plugins, extensions): This example allows asset installation only for users with the appropriate permission:

System Operations

Control access to system-level operations: This example restricts configuration changes to authorized administrators:

Log Management

Control who can manage log traces: This example allows log trace management for users with logging permissions:

Topic Access Rules

Control who can publish to or subscribe from specific MQTT topics.

Standard Topics

Use Publish and Subscribe with TO TOPIC to control access:

System Topics ($SYS)

Use PublishSys and SubscribeSys for system topic access:
System topics ($SYS/#) contain sensitive broker information and command interfaces. Restrict access to administrative users only.

Permission Tags

Permission tags are assigned to users and checked with USER HAS. These are the standard permission tags:
You can define custom permission tags for your organization. Assign them to users through the broker’s user management system.

Priority and Evaluation

Rules are evaluated in priority order (lower number = higher priority). The first matching rule determines the outcome.
Use lower priority numbers for more specific rules (like denying specific users) and higher numbers for general allow/deny rules.
Structure layered access as specific deny rules first, then broader allow rules:

Complete Examples

A typical production setup with role-based access control:

Best Practices

Create restrictive rules first, then add specific allow rules for authorized users. This prevents accidental access.
Check USER HAS <permission> rather than USER IS "<name>" when possible. This makes it easier to manage access as users change.
Always restrict access to $SYS/# topics. These contain broker commands and sensitive system information.
Use clear, descriptive rule names that explain their purpose. AllowAdminActionCreation is better than Rule1.

Next Steps

Actions Guide

Build event-driven automation with Actions.

Models Guide

Structure your MQTT data with Models.
Last modified on May 22, 2026