Skip to main content
POST /verify lets you evaluate a state predicate against a tracked application outside of an action dispatch. Use it to perform pre-flight checks before your agent commits to an irreversible action, to assert that a precondition holds before a multi-step sequence, or to build custom verification logic in your own agent loop. The endpoint polls the state until the expression becomes true or the timeout_ms window expires, so you do not need to implement your own polling retry logic.

Endpoint

Request Body

integer
Target process ID. Either pid or app_id must be present.
string
Target application ID. Either pid or app_id must be present.
string
required
JavaScript-style predicate to evaluate against the current objects map. Must not exceed 2048 bytes. See the supported syntax table below.
integer
How long to poll until the expression becomes truthy, in milliseconds. Accepts values from 100 to 30000. Defaults to 5000. The request returns early as soon as the expression passes.

Response

boolean
true when the expression evaluated to a truthy value within timeout_ms. false if the timeout elapsed without the expression passing.
string
The expression that was evaluated, echoed back for traceability.
any
The final value the expression resolved to. For boolean predicates this is true or false.
string
Human-readable summary of the evaluation outcome, for example which field changed to satisfy the expression.
integer
Total time spent polling, in milliseconds.
integer
Number of probe cycles completed during the polling window.
array
Array of { path, before, after } objects for any state fields that changed during the polling window. Empty when the expression passed on the first cycle.

Supported Expression Syntax

Expressions are JavaScript-like predicates evaluated against the flat objects map returned by GET /state/{pid}. The following operators and patterns are supported:

Examples

Error Responses