Tool approval
Arivie exposes a configurable tool-approval policy through ArivieConfig.limits.requireToolApproval. When a policy is active, the agent pauses before calling a gated tool and emits a suspension that the host app can resolve.
Use cases
Section titled “Use cases”- Destructive SQL — require human confirmation before any
execute_<source>call in production. - Regulated environments — gate all tool calls by default, then explicitly allow safe tools like
compile_metric. - Per-user policies — vary approval by user role or permissions.
Policy shapes
Section titled “Policy shapes”import { defineArivie } from "@arivie/core";
defineArivie({ // ... limits: { // Gate every tool call requireToolApproval: true,
// Gate only these tools requireToolApproval: { tools: ["execute_postgres", "mastra_workspace_write_file"], },
// Gate everything except safe tools requireToolApproval: { exceptTools: ["compile_metric"], },
// Custom predicate: (toolName, args, requestContext?) => boolean requireToolApproval: (toolName, _args) => { if (toolName === "compile_metric") return false; return toolName.startsWith("execute_"); }, },});The function form receives the tool name, its arguments, and an optional request context, so you can vary policy by role, environment, or request metadata.
How it works
Section titled “How it works”Arivie forwards the policy to Mastra’s native requireToolApproval option on the Agent. When the agent hits a gated tool, Mastra emits a suspension that the host app resolves by approving or denying the call. See the Mastra tool suspension docs for the exact runtime shape.
Other limits
Section titled “Other limits”The limits config also enforces hard ceilings:
| Field | Effect |
|---|---|
rowsPerQuery | Max rows returned per execute_<source> call |
queryTimeoutMs | SQL statement timeout |
tokensPerRequest | Max tokens per agent turn |
tokensPerUserPerMonth | Monthly token budget per user |
maxSteps | Max agent steps per turn |
These are enforced inside @arivie/agent tools, not advisory.