Skip to main content

Report a safety condition

Request the safety.report capability to report a condition your script has observed. This API is available to other workloads, not just farming.

local result = hexis.safety.report({
reason = "harvest_rate_low",
message = "4 BPS over 10 seconds. Minimum: 5 BPS.",
severity = "critical",
evidence = {
blocks_per_second = 4,
minimum_bps = 5,
window_seconds = 10,
},
})

Use a reason that explains the condition. Reason and evidence keys must start with a lowercase letter and contain only lowercase letters, digits, _, ., :, or -, with at most 64 characters. Evidence is optional and accepts at most 16 fields containing booleans, finite numbers or strings up to 256 characters. Nested tables are not accepted. message is optional plain text, up to 256 characters, with no control characters or Minecraft formatting codes. It appears in alerts and history; without it, Hexis displays the reason identifier. Do not use reason, message, severity, script_id or run_id as evidence keys; Hexis supplies the report's identity.

The result contains accepted and reason:

ReasonMeaning
acceptedQueued for the configured failsafe response.
duplicateThis run reported the same severity and reason within ten seconds.
rate_limitedThis run has accepted eight distinct reports within ten seconds.
disabledThe applicable failsafe policy is disabled.
unavailableThe safety service is unavailable.

Select info, warning, or critical severity. Each has a separate response under Settings → Failsafes → Trigger responses:

SeverityDefault response
critical (default)Stop
warningAlert
infoLog

A warning does not suppress a later critical report for the same reason. Hexis applies the configured response on the client tick, without an additional response delay. Your script owns the detection window. An accepted report does not synchronously stop your script or release its inputs. If your script must pause immediately, cancel its owned actions before reporting. Do not busy-loop on a rejected report.

A script cannot choose the response, clear an alert, override another failsafe, or restart a stopped run through this API. Log and Alert policies do not become Stop just because a script submitted a report.

For read-only status, request safety.read and call hexis.safety.observe({}). See the API reference for the exact contract.