Class SubjectValues
- Namespace
- IntentSharp.Guardrails
- Assembly
- IntentSharp.dll
What a caller hands to one guardrail check: the subjects' values by name, each a JSON value or an explicit unknown
marker, plus what the check needs from the caller's context: the entities of the current description (what
"@described" in an allow list stands for), subjects the caller declares beyond the client's, and the
caller's own setting values for this check. Build one per check; an instance is not safe to change from several
threads.
public sealed class SubjectValues
- Inheritance
-
objectSubjectValues
- Inherited Members
-
object.Equals(object)object.Equals(object, object)object.GetHashCode()object.GetType()object.ReferenceEquals(object, object)object.ToString()
- Extension Methods
Constructors
- SubjectValues()
Creates an empty set of values.
Properties
- DescribedEntities
The entity paths of the current description, which
"@described"in anallowlist stands for at this check. Null means the caller has no description, so"@described"allows nothing.
- Names
The names that have a value or an unknown marker.
- Settings
The caller's setting values for this check, by setting name. They take the place of the client's code values for the same names and, like them, apply only where no file sets the setting. A name that is not declared, or a value that a setting cannot take, refuses the check.
- Subjects
Subjects the caller declares for this check beyond the client's, such as a target's own. A name the client already declares keeps the client's descriptor. A security subject here without a fail-closed value refuses the check.
Methods
- Add(string, JsonNode?)
Sets the value of
subject, replacing any value or unknown marker it had. A JSON null on a required or security subject counts as no value.
- AddUnknown(string)
Marks
subjectas unknown: the caller could not determine its value. An enforced rule on an unknown subject is a violation, never a pass.
- IsUnknown(SubjectName)
True when
nameis marked unknown.
- TryGet(SubjectName, out JsonNode?)
Gets the value of
name; false when the subject has no value or is marked unknown.