Reference
Guards, judgments and deliverables reference
Configure exact checks, semantic judgments, approval and generated files. Start with the authoring guide, then use these details when a workflow needs them.
Exact expressions
Use guard for an exact condition written in standard JavaScript. It checks the supplied data; it does not independently prove that a test ran. A transition with no guard or judgment passes unconditionally.
guard: "payload.exit_code == 0 && payload.coverage >= 80"Judgment declaration and adapters
Declare judgment: { type, criterion, min_probability, escalate, fallback_target } on a transition. Types are predicate (yes/no), categorical (an option) and evaluation (a score). The Judgment Engine provides a built-in script adapter and optional Jev decisions through @typesafe-ai/sdk.
adapter_hint selects the primary adapter. Without it, available Jev is preferred while its circuit allows execution; otherwise script is selected. Exact executable predicates should use adapter_hint: script so a model probability does not decide them. reactive-skills-axi validate warns when that selection is missing.
judgment:
type: predicate
criterion: "payload.exit_code == 0"
adapter_hint: scriptfallback_adapter selects an adapter after primary failure or an open circuit. It is not a second opinion on a low-probability result: a returned result goes through the declared threshold bands.
Context sent to a model
With no input selection declared, Jev sends the whole run context and event payload. context_paths selects dot paths relative to run context; numeric segments index arrays. Selected values arrive under their dot-path keys. Missing paths are omitted without failing the judgment. include_payload: false omits the payload.
runtime_requirements:
required_capabilities: ["judgment.context_paths"]
# Fields inside judgment:
context_paths: [write_side.deciders, read_projections]
include_payload: falseGUARD_EVALUATED records judgment.contextSent with paths sent, missing paths, includePayload and inputTokens when reported by the model. The script adapter ignores these two legacy scope fields when no newer input options are declared. reactive-skills-axi validate rejects invalid paths and warns when judgment.context_paths is not required. Older runtimes without that capability drop the fields and send the whole context and payload.
These legacy fields are not the complete input policy. Current judgments also support payload_paths, required_context_paths and precondition, which prepare input before adapter execution and can reject missing required evidence. See the judgment input schema for those fields and the judgment.payload_selection capability.
A person decides an unevaluable gate
When no model can judge a natural-language gate, including no configured model, an outage or a rejected key, the runtime can refuse with APPROVAL_REQUESTED. The agent must stop and ask the user to run the returned command in their own interactive terminal from the named workspace.
reactive-skills-axi approve <skill> --job <id>approve shows each waiting gate and submitted evidence, then requests a one-time code. The code approves; reject rejects. Other nonblank answers retry, up to five wrong answers. Blank lines do not count; ended input cancels without a decision. Use --full to show all evidence when the default display abbreviates it.
Approval re-sends the original signal and reports judgment_basis: human. Rejection uses fallback_target when declared, otherwise refuses. MCP has no tool for approving these pending judgment gates; reactive_respond_human handles ordinary authored human gates instead.
Explicit self-report permission
Only when no model is configured, a user can allow the agent’s payload to decide a natural-language criterion. approve <skill> --allow-self-reported asks for a code and stores a workspace-path-keyed grant in the user’s home, outside workspace state. Copied, committed or restored workspace files cannot enable the grant or undo revocation. It covers the workspace until revoked and never acts as fallback during a configured model outage.
reactive-skills-axi approve <skill> --allow-self-reportedreactive-skills-axi approve <skill> --revoke-self-reportedSelf-reported predicate decisions use exit_code or success; categorical decisions use choice; evaluations use score. They warn and report judgment_basis: self_reported. Decided judgments record judgment.decidedBy in GUARD_EVALUATED as model, expression, human or self_reported. An unevaluable judgment need not have decidedBy.
The script adapter always executes a criterion that is a JavaScript expression. If it throws, such as on a missing field, it rejects rather than consulting the agent’s reported verdict fields.
Model capability hints
A state can declare model: { tier: fast | balanced | reasoning | decision } to express routing intent. The runtime emits model_contract prompt metadata; it does not enforce a host model switch. See the manifest model schema for the accepted fields.
model: { tier: reasoning }Custom guard modules
Use guards/<guard_name>.js for complex checks such as AST analysis or git status. Reference it with guardFunction. Accepted extensions are .js, .mjs and .cjs: .mjs is ESM, .cjs is CommonJS, and .js follows the nearest package.json type, or Node syntax detection when type is absent. reactive-skills-axi validate fails missing files, unsupported extensions and wrong-format modules.
guardFunction: "guards/check-status.mjs"Useful refusal messages
A custom guard can return a boolean or { passed, reason }. A falsy passed refuses with reason. An inline guard can declare guard_message. Without a message, the refusal names the expression or script path.
guard: "payload.exit_code == 0"
guard_message: "Tests must pass before completing."Contract documents versus enforcement
guards/*.yaml judgment contracts are design documents. Runtime judgment enforcement reads skill.yaml. Run reactive-skills-axi validate <path> to detect drift between the manifest judgment and its contract document.
Generated deliverables
deliverable_projections declares Handlebars templates under templates/*.hbs and workspace-relative outputs such as .docs/*.md. Templates receive recorded events, transitions and run context to generate files without requiring a manual agent summary.
deliverable_projections:
- template: templates/report.hbs
output: .docs/report.md
trigger_on: [REVIEW_SUBMITTED]On successful transitions, the projection engine renders matching templates. trigger_on matches the triggering signal; omitted or empty trigger_on, * and STATE_TRANSITION match every projection call. It does not subscribe to arbitrary ledger appends. See the projection schema for configuration.
Thresholds and migration
Write the probability you mean with min_probability. For a predicate it is compared directly with P(yes). For a categorical judgment it is compared with the probability of the picked label, which must also be one of the options. min_probability is not available on evaluation judgments, and a predicate min_probability must be at least 0.5.
An optional escalate band routes grey-zone results to a review state instead of the fallback. A result at or above escalate.min_probability and below min_probability moves to escalate.target. Anything lower moves to fallback_target, or refuses the transition when no fallback_target is declared.
runtime_requirements:
required_capabilities: ["judgment.probability_thresholds"]
states:
REVIEW:
transitions:
REVIEW_SUBMITTED:
target: "MERGE"
judgment:
type: "predicate"
criterion: "Does the diff satisfy every approved acceptance criterion?"
min_probability: 0.85
escalate:
min_probability: 0.3
target: "HUMAN_REVIEW"
fallback_target: "REVISE"The older min_confidence field keeps its meaning. For predicates the runtime reports confidence as |P(yes) - 0.5| * 2, so min_confidence: m requires P(yes) >= 0.5 + m / 2. For categorical judgments min_confidence is compared with the adapter's own confidence score, not with the picked label's probability. A judgment may set min_probability or min_confidence, not both, and a judgment with neither uses min_confidence 0.75.
| min_confidence | Required P(yes) | Equivalent min_probability |
|---|---|---|
| 0.6 | 0.80 | 0.8 |
| 0.7 | 0.85 | 0.85 |
| 0.75 (default) | 0.875 | 0.875 |
| 0.85 | 0.925 | 0.925 |
| 0.9 | 0.95 | 0.95 |
Require the capability before migrating
Runtimes before judgment.probability_thresholds drop min_probability and escalate and apply min_confidence 0.75 instead. List judgment.probability_thresholds in runtime_requirements.required_capabilities so an older runtime refuses the skill rather than silently changing its gates. reactive-skills-axi validate warns when the requirement is missing.