None of them grants permission. They describe the thread at the moment you ask.
Before an action with consequences, still call
waitFor, which is the only call that
reserves an attempt.
Decisions answer for the caller’s own role, so they need write access to the
thread. Observers can’t call them.
can
Pass eitheraction, the exact step name from your contract, or goal, a
plain-language description that Threadify maps to one of your steps.
context to also check the data you’re about to send against the step’s
content rules, for example thread.can({ action: 'refund', context: { amount: 42 } }).
Without it, can only checks order, roles and prerequisites.
requires_claim means the action needs a fresh grant each time (it uses
must succeed before each invocation). Call waitFor before doing it.
uncertain means a goal couldn’t be matched confidently to a single step.
should
should gives advice about whether an allowed action fits the current state.
It never makes an action allowed or blocked.
next
status is
allowed or requires_claim. Later steps in a path may depend on what happens
first, so check them again when you get there.
Classifier
Mapping agoal to a step, and should, use a classifier configured on your
Engine. Without one, can and next still work when you pass exact step names,
and should returns unavailable. A classifier can only choose between steps
that are in your contract, and a low-confidence answer never makes an action
allowed.
Human approval
To require a person’s approval before an agent acts, put it in the contract: a step owned by the reviewer, which the protected action depends on.- Before approval,
can({ action: 'delete_record' })reportsdelete_approvalas missing. - Your application shows the request to a reviewer. Threadify doesn’t show any
UI. When the reviewer approves, record a successful
delete_approvalas the reviewer. Don’t record a refusal as a successful step. cannow returnsrequires_claim. The agent’s tool callswaitFor('delete_record'), deletes the record, and reports the outcome.- The approval is used up. The next deletion needs a new approval.
can or next to return a helpful reason when the action isn’t allowed yet;
the model doesn’t need separate decision tools.
Decisions are also available in GraphQL as can,
should and next.