Skip to main content

Overview

The PathResolver handles safe resolution of dot-notation paths in nested data structures. It provides caching, security features, and protection against common vulnerabilities.
The PathResolver is automatically used by the Rule Engine for all data access. You rarely need to interact with it directly.

Features

Dot Notation

Access nested data with simple path strings like user.profile.email

Security First

Built-in protection against prototype pollution and malicious access

Performance Caching

LRU cache for frequently accessed paths

Array Access

Support for array index notation like users[0].name

Path Syntax

Basic Paths

Array Paths

Undefined Paths

Security Features

Prototype Pollution Protection

The PathResolver automatically blocks access to dangerous prototype properties.
Blocked Properties:
  • __proto__
  • constructor
  • prototype

Function Access Prevention

Caching

The PathResolver uses an LRU cache to optimize performance:
Cache hit rates typically exceed 95% in production workloads, significantly improving performance.

Configuration

boolean
default:"true"
Enable LRU caching for path resolution
number
default:"500"
Maximum number of paths to cache
boolean
default:"false"
Allow access to prototype properties (dangerous - keep false in production)
boolean
default:"false"
Allow resolution of function properties

Direct Usage

While the PathResolver is used automatically by the engine, you can access it directly:

Performance Tips

Consistent Paths

Use consistent path strings to maximize cache hits

Shallow Access

Prefer shallower paths when possible for faster resolution

Avoid Deep Nesting

Excessive nesting (>5 levels) impacts performance

Monitor Cache

Check cache stats to optimize cache size

Common Patterns

Safe Property Access

Dynamic Path Building

Validation

Next Steps

Rule Engine

Learn how the engine uses PathResolver

Security Guide

Deep dive into security features