Core classes
jes has a small surface. You build one guard, run checks with it, and read the result. A few other classes shape what a check does or carry state between checks. This section explains each one: its job, how to think about it, and how you use it. For exact signatures, see the API reference.
How they fit together
- You build a
Guardonce, from a list of policies, a backend (the decision model, Jev by default), and optionalLimits. - Each judgment policy asks the model one or more questions, and its threshold turns the answer into a flag or a block.
- Every check returns a
Result. Branch onresult.ok, and forwardresult.onward. - Across a conversation, a
Redactionsstore remembers the values jes hid, and history lets judgments see earlier turns. - Tests swap the real model for a
FakeBackend. Mistakes in your setup raise an error from theJesErrorfamily. Problems with the checked text, such as text that is too long, block the check instead.
The classes
Guard and AsyncGuardThe entry point. Holds your policies and model, and runs a check at each stage of a turn.PoliciesOne rule each. Local transforms, sensitive-data detectors, and judgments the model answers.Questions and thresholdsWhat a judgment asks the model, and where an answer becomes a flag or a block.ResultWhat every check returns: whether to proceed, what to forward, and why.RedactionsOne conversation's memory of the personal data jes hid, so replies get it back.Message and historyEarlier turns and sources you pass in so judgments see the whole conversation.LimitsThe size and work budget of a check, and what happens when it runs out.Backend and TypeSafeThe bridge to the decision model. A model name, a classifier, or your own backend.FakeBackendA scripted model for tests and offline runs.ErrorsThe JesError family: what raises, what blocks instead, and when to catch.