Register an agent
An agent needs awebhook_url and an HMAC secret. There are three ways to
register one: a provisioning manifest at kernel boot (--config),
rebuno agent add, or the admin API (POST /v0/agents). See
Provisioning agents.
lease_timeout_seconds overrides REBUNO_DISPATCH_LEASE_TIMEOUT for this
agent. Omit it to use the kernel default. Values under ten seconds are ignored.
Dispatch lifecycle
The kernel POSTs to the webhook every time it has work for an execution. The agent runs the same sequence on the first dispatch and on every resume:- Dispatch. The webhook arrives with
{execution_id, dispatch_id, dispatch_attempt, lease_timeout_seconds}and a signature header,Rebuno-Signature: sha256=<HMAC-SHA256(secret, body)>. The agent checks the signature and acks with200 OKright away. The kernel delivers at least once, so the same dispatch can arrive twice. Key the handler on(execution_id, dispatch_id, dispatch_attempt). - Fetch input. The agent reads the execution’s original input with
GET /v0/executions/{id}. - Run. The agent runs its own logic from the top, with that input.
- Submit each effect. Before every tool or LLM call, the agent submits a step
(
POST /v0/executions/{id}/steps, carrying the dispatch id and attempt). The kernel answers with a decision:replay→ the recorded result comes back. The effect does not run.proceed→ the agent runs the effect, then reports how it went (.../completeor.../fail).denied→ policy rejected the call. The agent surfaces it as an error.rate_limited→ a rule’s rate limit refused the call. The agent surfaces it as an error.blocked→ the agent stops and exits the dispatch.execution_blocked→ an earlier step is awaiting approval, so no new effect can start. The agent stops and exits, same asblocked.execution_terminal→ the execution is already cancelled or finished. The agent exits cleanly.
- Block.
blockedhas two causes. A human approval is pending, and the response carries anapproval_idwhile the execution moves toblocked. Or a rate limit parked the step, and the execution staysrunning. Either way the agent holds nothing in memory, so the process can exit here, or crash, without losing anything. - Resume. The kernel dispatches again once the approval resolves or the rate
limit’s wait is up. The agent runs from the top, every effect it already did
comes back as
replay, and the step that blocked gets a fresh decision. - Complete. When the agent’s logic finishes, it reports the result with
POST /v0/executions/{id}/complete, and the kernel recordsexecution.completed.
What an agent must guarantee
Replay only lines up if the agent makes the same calls in the same order when it sees the same input and the same earlier results.- The agent can pick its calls and their order from the input and from earlier results. It must not branch on the clock, a random number, or anything else local to the process.
- If something non-deterministic decides which effects fire, record it as a
localstep. It lands in the log and replays to the same value. Both SDKs expose this asstep(name, fn). See Local steps.
Idempotency and at-least-once delivery
Webhooks are delivered at least once, so the same dispatch can arrive twice. A redelivery re-submits the same step IDs and short-circuits on the recorded results. A dispatch that goes quiet is reclaimed and delivered again under the nextdispatch_attempt. Calls from the earlier attempt are refused with
409 lease_superseded, and the agent stops without failing the execution.
A crash can still orphan an effect, where a step started but never recorded a
result. What the kernel does then depends on the idempotency mode the step
declared. See Idempotency modes.