Repository navigation
Description
The session example at docs/examples/sessions/creating_a_new_type_of_session.py
still imports GuardianCheck and GuardianRisk from
mellea.stdlib.requirements.safety.guardian and passes them in a
requirements=[...] list:
# docs/examples/sessions/creating_a_new_type_of_session.py:21,83
from mellea.stdlib.requirements.safety.guardian import GuardianCheck, GuardianRisk
...
requirements=[GuardianCheck("jailbreak"), GuardianCheck("profanity")],That import path emits a DeprecationWarning (since v0.4) and will break
when the deprecated module is removed. The file is collected by pytest
(# pytest: ollama, qualitative, e2e), so it ships as an actively-tested
demonstration of an API users are explicitly told not to use.
The migration to the current Guardian Intrinsics API is not a one-line
swap. guardian_check() and the other Intrinsics return a numeric score
or label string, not a Requirement instance, so they cannot drop into
requirements=[...] the way GuardianCheck did. This is the same gap
documented under "Limitations" in the new
Safety Guardrails page.
PR #773 (feat: groundedness requirement) proposes a real Requirement
subclass backed by Guardian Intrinsics. Once #773 lands, this example
can migrate cleanly using the new Requirement.
Blocked on
- feat: groundedness requirement #773 — Intrinsic-backed
Requirementsubclass
Related
- docs: migrate Guardian documentation from deprecated GuardianCheck to Intrinsics API #935 — completed the Guardian docs migration; this example is the
remaining straggler in tested code - feat: intrinsic-backed Requirement subclass for Guardian safety validation in repair loops #1071 — broader tracking issue for an Intrinsic-backed
Requirement
for repair loops
Activity
refactor(intrinsics): guardian.py whole-file migration + documents= k…
refactor(intrinsics): guardian.py whole-file migration + documents= k…