Examples#

Each example is one runnable file in examples/ and prints what each party sees. All but the brokerage agent use a scripted stand-in model, so they need only ENKRYPTAI_API_KEY, set in the environment or in .env.

Example

Shows

Blocking injection

an attack refused before the model runs

Secrets

local redact_secrets, then enkrypt.secrets() raising on what it missed

Code of conduct

one rule checked on the prompt and on the answer

A saved guardrail

a guardrail saved in Enkrypt, by name

Round trip

personal data hidden from the model, restored for the tool and the user

Exfiltration

a tool call carrying the user’s name out, refused

Tool results

other customers’ data in a tool result, redacted for good

Answers

personal data in the answer, sent back for another try

The brokerage agent

every guard in one agent, with a real model