Documentation
Table of Contents

Class GuardrailRule

Namespace
IntentSharp.Guardrails
Assembly
IntentSharp.dll

One rule of a GuardrailSet: a subject, the kind that checks it and the kind's argument. Built-in kinds are allow and deny (a list of values), pattern (a regular expression), range and count (an object with min and max); a custom kind's name contains a dot.

public sealed class GuardrailRule
Inheritance
object
GuardrailRule
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Extension Methods

Remarks

In an allow list, "*" allows every value and "@described" stands for the entities of the current description; neither has a special meaning anywhere else. A deny violation stands whatever else passes.

Constructors

GuardrailRule()

Creates a rule. Set at least Id, Subject and Kind.

Properties

Compiled

True for a rule compiled from intent rather than written by a person.

Enforce

True, the default, makes a failure a violation that refuses the operation. False makes the rule detect-only: a failure is reported as a detection and refuses nothing. A rule on a security subject cannot be detect-only.

Id

The rule's id, unique within its set; named in violations.

Kind

The kind that checks the subject, by name.

Message

What a violation of this rule says to the model; when null, the violation names the rule and its subject.

Settings

The kind's argument as written: a list for allow and deny, text for pattern, an object for range and count.

Subject

The subject the rule checks.