Table of Contents

Orleans.Lattice.Auth API reference

This page documents Orleans.Lattice.Auth 10.5.0, in the documentation for Orleans.Lattice 10.5.0 (release line 10.5), built 2026-12-05. It is also published as markdown, with every table and list, at api.md, and llms.txt lists every page.

Every public type and member of Orleans.Lattice.Auth. The package guide summarises the same types by role and explains the rule model, scopes and precedence; this page is the complete declaration reference. Types not listed here are internal and are described by behaviour in Architecture.

The package builds on core types it does not declare: the operation vocabulary LatticeOperation, the access-gate seam ILatticeAccessGate with its LatticeAccessRequest and LatticeAccessDecision, the resolved LatticeSubject, and TenantId.

Registration

LatticeAuthServiceCollectionExtensions holds the two ISiloBuilder extension methods.

Method Signature Purpose
AddLatticeAuth ISiloBuilder AddLatticeAuth(this ISiloBuilder builder, Action<LatticeAuthOptions>? configure = null) Installs the policy store, the compiled-snapshot decision engine, the enforcing access gate (replacing the core allow-all gate), the decision observer and audit sinks, and inactive defaults for the two tenancy seams. Throws ArgumentNullException when builder is null, and InvalidOperationException when AddLattice(...) or AddLatticeMembership(...) has not been called first. A repeated call layers its configure delegate and performs no further wiring.
ConfigureLatticeAuth ISiloBuilder ConfigureLatticeAuth(this ISiloBuilder builder, Action<LatticeAuthOptions> configure) Layers an additional LatticeAuthOptions delegate. Throws ArgumentNullException when either argument is null.

Every option is documented in Configuration.

Types by role

Role Types Narrative
Rule model LatticeAuthorizationRule, LatticeSubjectSelector, LatticeSubjectSelectorKind, LatticeScope, LatticeScopeKind, LatticeEffect, LatticeAuthOperations Rule, Scope, Precedence
Policy storage ILatticeAuthorizationPolicyStore, LatticeAuthReservedTrees Rule
Rule-id namespaces LatticeAppRuleIds, LatticeAppOwnedRuleException, LatticeTenantRuleIds, LatticeTenantOwnedRuleException Rule, Tenant-tier rule ids
Decision ILatticeDecisionEngine, LatticePolicyEpochFenceContext Consistency modes
Tenancy seams ITenantGateEnforcer, ITenantRuleLayer The tenant rule layer
Observability and audit ILatticeAuthAuditSink, LatticeAuthDecisionEvent, LatticeAuthAuditVerbosity, LatticeAuthMetrics Observability
Options LatticeAuthOptions Configuration

Behaviour worth knowing

  • Rule-id guards run before any read or write. ILatticeAuthorizationPolicyStore.PutRuleAsync and RemoveRuleAsync throw LatticeAppOwnedRuleException for an app: id and LatticeTenantOwnedRuleException for a tenant: id when the caller is not already running under system origin. Both exceptions derive from ArgumentException, implement the core ILatticeDomainFault, and carry the targeted RuleId; their static Rejected(ruleId, paramName) factories build the instance the store throws.
  • Malformed rules are refused, not stored. The store rejects an empty rule or subject id, an out-of-range enum value, and a key or prefix that is missing from (or present on) the wrong scope kind with an ArgumentException. The public constructors do not validate enum values.
  • Templated scopes are validated on write. A key or prefix carrying {subject} or {group:<prefix>} is refused with an ArgumentException when a placeholder has no literal delimiter after it, when it targets a control-plane tree, or when a group prefix can reach another tenant's groups; see Subject-relative scopes.
  • LatticeAuthReservedTrees.ThrowIfReserved throws the same error the policy store enforces for the reserved sys-auth-* namespace; Prefix is sys-auth- and PolicyTreeId is sys-auth-policy.
  • LatticeScope.ClusterWideTreeId is the * sentinel tree id used by LatticeScope.ClusterWide().
  • LatticeScope.TenantCapability(tenant) is the whole-tree scope over a tenant's control-plane capability id, _lattice_tenant_admin_{tenant}, used to grant Telemetry for that one tenant; TryGetTenantCapabilityTenant(out tenant) recognises it.
  • ILatticeDecisionEngine.Evaluate is the policy decision only. The enforcing gate layers the bootstrap-administrator bypass, the control-plane fail-closed rule, the strict epoch fence and tenant isolation around it; see Architecture.
  • ITenantGateEnforcer.EnforceAsync has a default interface implementation that returns the synchronous Enforce decision.

Public declaration reference

The following inventory includes directly declared public members and overloads, enum values, record positional members, and the protected extension points of unsealed public classes. Inherited framework members and compiler-generated record equality helpers are not additional package operations. Each source link identifies the declaration that defines its signature.

Orleans.Lattice.Auth.ILatticeAuthAuditSink

Source (line 25).

public interface ILatticeAuthAuditSink

  • ValueTask WriteAsync(LatticeAuthDecisionEvent decisionEvent, CancellationToken cancellationToken = default)

Orleans.Lattice.Auth.ILatticeAuthorizationPolicyStore

Source (line 13).

public interface ILatticeAuthorizationPolicyStore

  • Task PutRuleAsync(LatticeAuthorizationRule rule, CancellationToken cancellationToken = default)
  • Task<LatticeAuthorizationRule?> GetRuleAsync(string treeId, string ruleId, CancellationToken cancellationToken = default)
  • Task<bool> RemoveRuleAsync(string treeId, string ruleId, CancellationToken cancellationToken = default)
  • IAsyncEnumerable<LatticeAuthorizationRule> ListRulesForTreeAsync(string treeId, CancellationToken cancellationToken = default)
  • IAsyncEnumerable<LatticeAuthorizationRule> ListRulesAsync(CancellationToken cancellationToken = default)

Orleans.Lattice.Auth.ILatticeDecisionEngine

Source (line 26).

public interface ILatticeDecisionEngine

  • long CurrentEpoch { get; }
  • LatticeAccessDecision Evaluate(LatticeSubject subject, string treeId, LatticeOperation operation, string? key = null, string? rangeStart = null, string? rangeEnd = null)

Orleans.Lattice.Auth.ITenantGateEnforcer

Source (line 31).

public interface ITenantGateEnforcer

  • bool IsActive { get; }
  • LatticeAccessDecision Enforce(in LatticeAccessRequest request)
  • ValueTask<LatticeAccessDecision> EnforceAsync(in LatticeAccessRequest request, CancellationToken cancellationToken = default)

Orleans.Lattice.Auth.ITenantRuleLayer

Source (line 28).

public interface ITenantRuleLayer

  • bool IsActive { get; }

Orleans.Lattice.Auth.LatticeAppOwnedRuleException

Source (line 32).

public sealed class LatticeAppOwnedRuleException : ArgumentException, ILatticeDomainFault

  • public string RuleId { get; }
  • public LatticeAppOwnedRuleException()
  • public LatticeAppOwnedRuleException(string message)
  • public LatticeAppOwnedRuleException(string message, Exception innerException)
  • public static LatticeAppOwnedRuleException Rejected(string ruleId, string paramName)

Orleans.Lattice.Auth.LatticeAppRuleIds

Source (line 11).

public static class LatticeAppRuleIds

  • public const string Prefix
  • public static bool IsAppOwned(string ruleId)

Orleans.Lattice.Auth.LatticeAuthAuditVerbosity

Source (line 7).

public enum LatticeAuthAuditVerbosity

  • DenyOnly
  • AllDecisions

Orleans.Lattice.Auth.LatticeAuthDecisionEvent

Source (line 31).

public readonly record struct LatticeAuthDecisionEvent

  • public LatticeAuthDecisionEvent(string subjectId, LatticeOperation operation, string treeId, LatticeEffect effect, long policyEpoch, DateTimeOffset timestampUtc, string? key = null, string? rangeStart = null, string? rangeEnd = null, string? matchedRuleId = null, LatticeScopeKind? matchedScopeKind = null, string? matchedScopeValue = null, string? reason = null)
  • public string SubjectId { get; init; }
  • public LatticeOperation Operation { get; init; }
  • public string TreeId { get; init; }
  • public LatticeEffect Effect { get; init; }
  • public long PolicyEpoch { get; init; }
  • public DateTimeOffset TimestampUtc { get; init; }
  • public string? Key { get; init; }
  • public string? RangeStart { get; init; }
  • public string? RangeEnd { get; init; }
  • public string? MatchedRuleId { get; init; }
  • public LatticeScopeKind? MatchedScopeKind { get; init; }
  • public string? MatchedScopeValue { get; init; }
  • public string? Reason { get; init; }

Orleans.Lattice.Auth.LatticeAuthMetrics

Source (line 28).

public static class LatticeAuthMetrics

  • public const string MeterName
  • public const string TagOperation
  • public const string TagTree
  • public const string TagEffect
  • public const string EffectAllow
  • public const string EffectDeny
  • public const string DecisionsName
  • public const string DecisionDurationName
  • public const string SnapshotRebuildsName
  • public const string SnapshotEpochName
  • public const string SnapshotAgeName
  • public const string SnapshotSubjectsName
  • public static readonly Meter Meter
  • public static readonly Counter<long> Decisions
  • public static readonly KeyValuePair<string, object?> EffectAllowTag
  • public static readonly KeyValuePair<string, object?> EffectDenyTag
  • public static readonly Histogram<double> DecisionDuration
  • public static readonly Counter<long> SnapshotRebuilds
  • public static string EffectTag(bool allowed)
  • public static void PrimeDecisions(string operation, string treeId)

Orleans.Lattice.Auth.LatticeAuthOperations

Source (line 10).

public static class LatticeAuthOperations

  • public const LatticeOperation All

Orleans.Lattice.Auth.LatticeAuthOptions

Source (line 11).

public sealed class LatticeAuthOptions

  • public LatticeEffect DefaultEffect { get; set; }
  • public ISet<string> BootstrapAdministrators { get; set; }
  • public bool UserRuleBeatsGroupRuleAtEqualScope { get; set; }
  • public bool AccessAdministrationDelegationEnabled { get; set; }
  • public bool AllTreesGrantsEnabled { get; set; }
  • public HistoryRetentionMode HistoryRetentionMode { get; set; }
  • public TimeSpan? HistoryRetentionWindow { get; set; }
  • public bool EnableDurableHistoryView { get; set; }
  • public ISet<string>? StrictConsistencyTrees { get; set; }
  • public bool EnableAuditSink { get; set; }
  • public LatticeAuthAuditVerbosity AuditVerbosity { get; set; }
  • public double AuditSamplingRatio { get; set; }
  • public bool EnableDurableAuditTrail { get; set; }
  • public TimeSpan? AuditTrailTimeToLive { get; set; }

Orleans.Lattice.Auth.LatticeAuthReservedTrees

Source (line 11).

public static class LatticeAuthReservedTrees

  • public static string Prefix { get; }
  • public static string PolicyTreeId { get; }
  • public static bool IsReserved(string treeId)
  • public static void ThrowIfReserved(string treeId, string? paramName = null)

Orleans.Lattice.Auth.LatticeAuthServiceCollectionExtensions

Source (line 14).

public static class LatticeAuthServiceCollectionExtensions

  • public static ISiloBuilder AddLatticeAuth(this ISiloBuilder builder, Action<LatticeAuthOptions>? configure = null)
  • public static ISiloBuilder ConfigureLatticeAuth(this ISiloBuilder builder, Action<LatticeAuthOptions> configure)

Orleans.Lattice.Auth.LatticeAuthorizationRule

Source (line 15).

public sealed record LatticeAuthorizationRule

  • public LatticeAuthorizationRule(string ruleId, LatticeSubjectSelector subject, LatticeScope scope, LatticeOperation operations, LatticeEffect effect, string? condition = null)
  • public string RuleId { get; init; }
  • public LatticeSubjectSelector Subject { get; init; }
  • public LatticeScope Scope { get; init; }
  • public LatticeOperation Operations { get; init; }
  • public LatticeEffect Effect { get; init; }
  • public string? Condition { get; init; }

Orleans.Lattice.Auth.LatticeEffect

Source (line 9).

public enum LatticeEffect

  • Allow
  • Deny

Orleans.Lattice.Auth.LatticePolicyEpochFenceContext

Source (line 31).

public static class LatticePolicyEpochFenceContext

  • public static long? RequiredEpoch { get; }
  • public static IDisposable RequireAtLeast(long epoch)

Orleans.Lattice.Auth.LatticeScope

Source (line 18).

public sealed record LatticeScope

  • public LatticeScope(LatticeScopeKind kind, string treeId, string? keyOrPrefix = null)
  • public LatticeScopeKind Kind { get; init; }
  • public string TreeId { get; init; }
  • public string? KeyOrPrefix { get; init; }
  • public static LatticeScope Tree(string treeId)
  • public static LatticeScope Key(string treeId, string key)
  • public static LatticeScope Prefix(string treeId, string prefix)
  • public const string SubjectPlaceholder
  • public static string GroupPlaceholder(string groupIdPrefix)
  • public bool IsTemplated()
  • public string? GetTemplateError()
  • public const string ClusterWideTreeId
  • public static LatticeScope ClusterWide()
  • public static LatticeScope TenantWide(TenantId tenant)
  • public bool IsTenantWide()
  • public bool TryGetTenantWideTenant(out TenantId tenant)
  • public static LatticeScope TenantCapability(TenantId tenant)
  • public bool TryGetTenantCapabilityTenant(out TenantId tenant)

Orleans.Lattice.Auth.LatticeScopeKind

Source (line 6).

public enum LatticeScopeKind

  • Tree
  • Key
  • Prefix

Orleans.Lattice.Auth.LatticeSubjectSelector

Source (line 14).

public sealed record LatticeSubjectSelector

  • public LatticeSubjectSelector(LatticeSubjectSelectorKind kind, string id)
  • public LatticeSubjectSelectorKind Kind { get; init; }
  • public string Id { get; init; }
  • public static LatticeSubjectSelector User(string userId)
  • public static LatticeSubjectSelector Group(string groupId)

Orleans.Lattice.Auth.LatticeSubjectSelectorKind

Source (line 7).

public enum LatticeSubjectSelectorKind

  • User
  • Group

Orleans.Lattice.Auth.LatticeTenantOwnedRuleException

Source (line 31).

public sealed class LatticeTenantOwnedRuleException : ArgumentException, ILatticeDomainFault

  • public string RuleId { get; }
  • public LatticeTenantOwnedRuleException()
  • public LatticeTenantOwnedRuleException(string message)
  • public LatticeTenantOwnedRuleException(string message, Exception innerException)
  • public static LatticeTenantOwnedRuleException Rejected(string ruleId, string paramName)

Orleans.Lattice.Auth.LatticeTenantRuleIds

Source (line 19).

public static class LatticeTenantRuleIds

  • public const string Prefix
  • public static string For(TenantId tenant, string localId)
  • public static bool IsTenantOwned(string ruleId)
  • public static bool TryGetTenant(string ruleId, out TenantId tenant)