Skip to main content

Where policies live

  • Created and managed at the Project level in Citadel.
  • Versioned — the active version of each policy is what Guardian evaluates.
  • Applied to a Project or to a specific Guard API.

Policy types

PII

Three detection mechanisms that can be combined in a single policy:
MechanismMatches byTypical use
NER (Named Entity Recognition)AI-inferred entities (person names, addresses, etc.)Semantically fuzzy categories
RegexRegular expression patternStructured identifiers (resident numbers, phone, email)
KeywordExact-match keywordProject names, confidential terms
Each rule declares a policy_type:
policy_typeActionEffect
PASSINGPASSDetection is logged but allowed through.
MASKINGMASKDetected text is replaced with mask_word (e.g., [PERSON_NAME]).
BLOCKINGBLOCKRequest is blocked.

Topic

Topic rules classify the entire conversation into safe, unsafe, or controversial categories. unsafe matches trigger BLOCK; controversial matches can route to review.

Final action priority

When multiple policies apply:
BLOCKING(BLOCK) > MASKING(MASK) > PASSING(PASS)
If any rule says BLOCK, the final action is BLOCK. Otherwise if any rule says MASK, the final is MASK. Otherwise PASS.

PASS / MASK / BLOCK

What each action means for the response payload.