Native pause and resume
Any tool that writes data, moves money, or sends external messages (issuing a refund, emailing a customer, updating a CRM record) can require human approval. When an agent reaches a gated call:
- Execution pauses durably with
status: "requires_action"(no open HTTP connection or worker timeout required). - Norilu returns the exact pending
turnId,callId, tool name, destination, and arguments. - Your backend or embedded
<ApprovalCard />presents the exact payload to an authorized reviewer. - Submitting
approveordenyresumes the same thread seamlessly.
const turn = await norilu.agents.run("agt_billing_01", {
space: org.id,
user: currentUser.id,
input: "Refund invoice 1042 for $49.",
maxCostUsd: 0.5,
});
if (turn.pending?.kind === "approve_tool_call") {
// Inspect exact tool name and arguments before approving
console.log(turn.pending.tool, turn.pending.arguments);
const completed = await norilu.threads.approve(turn.threadId, { approved: true });
}
turn = norilu.agents.run(
"agt_billing_01",
space=org.id,
user=current_user.id,
input="Refund invoice 1042 for $49.",
max_cost_usd=0.50,
)
if turn.pending and turn.pending.kind == "approve_tool_call":
print(turn.pending.tool, turn.pending.arguments)
completed = norilu.threads.approve(turn.thread_id, approved=True)
turn, err := client.Agents.Run(ctx, "agt_billing_01", norilu.RunAgentParams{
Space: org.ID,
User: currentUser.ID,
Input: "Refund invoice 1042 for $49.",
MaxCostUSD: norilu.Float64(0.50),
})
if turn.Pending != nil && turn.Pending.Kind == "approve_tool_call" {
completed, err = client.Threads.Approve(ctx, turn.ThreadID, norilu.ApproveParams{
Approved: norilu.Bool(true),
})
}
Exact-payload server verification
Approvals are never a blind boolean flag:
- Every decision is bound on the server to the exact
runId,turnId, and every pendingcallId+ argument hash. - Duplicate, stale, omitted, or tampered decisions are rejected with
409 approval_conflict. - In embedded UIs (
@norilu/react), only browser tokens explicitly minted with"approve"permission can submit decisions—read-only or non-admin users receive403.
Hard USD spend limits
Protect your margins at three nested layers—the strictest limit always wins before dispatch:
- Per-run cap (
maxCostUsd): set per call by your server SDK. - Per-customer-space monthly cap: configured per tenant in Customer Spaces.
- Workspace monthly execution limit: work pauses cleanly at your plan ceiling with zero automatic overage bills.