One guard case in the nous.guard_case/1 schema: a labelled guard input
for calibration (kind: "classifier") or a decision-table row for a
deterministic guard ("permission", "loop_guard", "hook").
{"schema": "nous.guard_case/1",
"id": "deepset-110",
"kind": "classifier",
"surface": "user_input",
"label": "block",
"split": "holdout",
"severity": "normal",
"category": "prompt_injection",
"tags": ["hard_negative"],
"group": "jackhhao/dan-template",
"input": {"text": "Forget everything ..."},
"expected": {"acceptable": ["escalate", "deny"]},
"provenance": {"source": "deepset/prompt-injections (test split)",
"source_url": "https://huggingface.co/datasets/deepset/prompt-injections",
"license": "Apache-2.0", "public": true, "label_source": "upstream"}}Keys
schema-"nous.guard_case/1"(required)id- non-empty string, unique within a dataset (required)kind-"classifier"(default),"permission","loop_guard"or"hook"surface- classifier cases:"user_input","tool_call","tool_result"or"model_output"(required)label- classifier cases:"block","allow"ornull(an unlabelled item, e.g. promoted from online eval and not yet reviewed; never calibrated on). The key is required.split- classifier cases:"tune","holdout"or"test"(required)severity-"normal"(default) or"critical"(zero tolerance in the non-regression gate)category- free text (the pack question or attack class)tags- strings ("hard_negative","upstream_train_overlap","synthetic_pii", ...)group- cluster id for clustered intervals and leakage-free splits; defaults toidguard- deterministic kinds: the name of the guard fixture the caller registers (policies and hooks are code, so cases never carry it)input- the guard input (required), by surface:user_input:text(string); optionalattachments, a list of{"media_type": "text/...", "text": ...}documentstool_call:tool({name, description?, category?}),arguments(object), optionaltasktool_result:tool,result(string or JSON), optionalargumentsandtaskmodel_output:content(string), optionaltool_calls(list) andtask
Without
tool.descriptionthe description comes from the agent under test (seeNous.Eval.Guard.Subject).expected- classifier cases: optional{"acceptable": [verdicts]}(default:["escalate", "deny"]forblock,["allow"]forallow); deterministic kinds: the expected output (required)provenance- required object:sourceandlicense(strings) plus the optionalsource_url,license_url,license_note,attribution,source_revision,source_split,source_row,public(boolean),label_source(human,upstream,generated,llm_judge,promoted_reviewed),upstream_label,template_id,derived_from,transforms,generator,redacted,promoted_from,review("pending"or"approved"),reviewed({by, at}) andduplicates
Loading is strict: an unknown key at any level the schema defines, a wrong
type or an unknown enum value is an error. Enum values map through literal
tables; nothing read from a file becomes an atom, and input,
expected and provenance stay string-keyed.
Certification
A case whose provenance.review is "pending" (a generated or promoted
item no maintainer has approved) is not certifiable?/1: calibration
reports and the non-regression gate leave it out of test-split claims.
Summary
Functions
The verdicts that count as correct for a classifier case: expected.acceptable
when given, else [:escalate, :deny] for block and [:allow] for
allow ([] for an unlabelled case).
Whether the case may back a certification claim: it is labelled and not
awaiting review (provenance.review is not "pending").
"sha256:<hex>" of the canonical input, surface, kind and label: changes
whenever the case's content changes under a stable id.
Builds a case from its decoded JSON form (string keys).
The schema id ("nous.guard_case/1").
The surfaces a classifier case may name.
The case as JSON-native data (string keys), the inverse of from_map/1.
Optional keys that are unset are left out; group is written only when it
differs from id.
Types
@type kind() :: :classifier | :permission | :loop_guard | :hook
@type label() :: :block | :allow
@type split() :: :tune | :holdout | :test
@type surface() :: :user_input | :tool_call | :tool_result | :model_output
@type t() :: %Nous.Eval.Guard.Case{ category: String.t() | nil, expected: map() | nil, group: String.t(), guard: String.t() | nil, id: String.t(), input: map(), kind: kind(), label: label() | nil, provenance: map(), severity: :normal | :critical, split: split() | nil, surface: surface() | nil, tags: [String.t()] }
@type verdict() :: :allow | :escalate | :deny
Functions
The verdicts that count as correct for a classifier case: expected.acceptable
when given, else [:escalate, :deny] for block and [:allow] for
allow ([] for an unlabelled case).
Whether the case may back a certification claim: it is labelled and not
awaiting review (provenance.review is not "pending").
"sha256:<hex>" of the canonical input, surface, kind and label: changes
whenever the case's content changes under a stable id.
Builds a case from its decoded JSON form (string keys).
Returns {:error, message} naming the case and the offending key.
@spec schema() :: String.t()
The schema id ("nous.guard_case/1").
@spec surfaces() :: [surface()]
The surfaces a classifier case may name.
The case as JSON-native data (string keys), the inverse of from_map/1.
Optional keys that are unset are left out; group is written only when it
differs from id.