Guards#

Every guard is a method on an Enkrypt object and returns a guard ready for the harness guardrails.

Guard

Checks for

Default action

injection_attack()

prompt injection and jailbreak attempts

block

toxicity()

hateful, harassing, violent or otherwise toxic text

block

code_of_conduct()

your own rules, inline or saved in Enkrypt

block

secrets()

API keys, passwords, tokens

raise

pii()

personal data of the types you list

redact

guardrail()

whatever a guardrail saved in Enkrypt checks

per detector

Every guard takes:

  • on_violation: what happens when Enkrypt flags the value; see Actions;

  • on_error: what happens when Enkrypt cannot be reached, "block" or "allow"; see Errors and enforcement.