Docs Approvals & guardrails
DocsCore conceptsApprovals & guardrails

Approvals and guardrails

Pause sensitive tool calls for human sign-off, verify exact arguments on the server, and enforce hard USD spend limits.

View Markdown
On this page

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:

  1. Execution pauses durably with status: "requires_action" (no open HTTP connection or worker timeout required).
  2. Norilu returns the exact pending turnId, callId, tool name, destination, and arguments.
  3. Your backend or embedded <ApprovalCard /> presents the exact payload to an authorized reviewer.
  4. Submitting approve or deny resumes 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 pending callId + 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 receive 403.

Hard USD spend limits

Protect your margins at three nested layers—the strictest limit always wins before dispatch:

  1. Per-run cap (maxCostUsd): set per call by your server SDK.
  2. Per-customer-space monthly cap: configured per tenant in Customer Spaces.
  3. Workspace monthly execution limit: work pauses cleanly at your plan ceiling with zero automatic overage bills.
Still have a question? Talk to usRead as Markdown

Search documentation

Find a guide, endpoint or concept.

↑ ↓ to navigate · ↵ to openSearch stays in your browser