Agent Action Approve

Agent Action Approve is a copy-paste React component that stops unreviewed agent tool calls before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/agent-action-approve
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 2 extra npm packages
  • A11y guidance in docs

StopsUnreviewed agent tool calls

Was this component page useful?

How do I install Agent Action Approve?

pnpm dlx shadcn@latest add @bollard/agent-action-approve

The files land in your project. They're yours to edit.

How do I use Agent Action Approve in React?

agent-action-approve-usage.tsx
import { AgentActionApprove, type AgentDecision, type ToolCall } from "@/components/ui/agent-action-approve"

<AgentActionApprove
  key={index}
  call={CASES[index].call}
  allowedHosts={["api.github.com"]}
  onDecision={async (d: AgentDecision) => {
    await new Promise((r) => setTimeout(r, 400))
    setLog(d.type === "always" ? `Rule saved: ${d.rule}` : d.type === "once" ? "The agent ran it once." : "The agent was told no.")
  }}
/>

What input mistakes does Agent Action Approve catch?

  • Tokens that widen the reach: a lone \ (drive root), an unset $VAR, ../, 8.3 short names
  • A stated intent that disagrees with what the call actually does
  • MCP tools labelled read-only whose call writes or deletes
  • Commands hidden inside bash -c, cmd /c or encoded PowerShell, and curl | bash
  • "Always allow" rules that would also let through other commands, and refuses them for npx, bash -c, chained or irreversible calls

What props does Agent Action Approve accept?

AgentActionApprove props
PropTypeDefault
call* (required)

The tool call the agent wants to make. Null or junk renders an empty, safe card.

ToolCall | null | undefined—
allowedHosts

Hosts an upload may go to without a warning, e.g. ["api.github.com"].

string[]—
holdMs

How long a dangerous call must be held, in ms. Default 1200.

number1200
onDecision

Called with the decision. May return a Promise: buttons show a pending state and can't fire twice.

(decision: AgentDecision) => void | Promise<void>—
messages

Override any visible string.

Partial<Omit<Messages, "risk" | "scope" | "undoLabel" | "refused">> & { risk?: Partial<Messages["risk"]> scope?: Partial<Messages["scope"…—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Agent Action Approve accessible?

  • Decision result receives focus (tabIndex=-1) and status text is announced in a role="status" region
  • Hold-to-approve works with Space or Enter held down, not just the pointer
  • Refusals of an "always" rule use role="alert"
  • Risk level is shown with text and icon, not colour alone; motion respects prefers-reduced-motion

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Enforce the decision at the tool boundary: the agent runtime must refuse calls that were not approved, and check the caller's authorisation for the target.

  • A review UI only: whether a call is actually blocked depends on your host app honouring the decision
  • Static analysis of the call text; it cannot know what a script or binary does once run
  • Unknown tools and argument shapes are described less precisely than shell and SQL calls
  • "User approved this" does not mean the operation is safe

What expensive mistakes does Agent Action Approve stop?

Unreviewed agent tool calls

Also known as

tool approval · human in the loop · mcp · coding agent · claude code · cursor · tool call confirmation · rm -rf

Field type

What dependencies does Agent Action Approve require?

Agent Action Approve facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameAgent Action Approve
Registry identifier@bollard/agent-action-approve
Install commandnpx shadcn@latest add @bollard/agent-action-approve
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react, motion
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Agent Action Approve

How does Agent Action Approve protect AI agent operations?

Agent Action Approve stops unreviewed agent tool calls. A review screen for an AI agent's tool call that spells out what it will delete, send or change and how far it reaches, before someone approves it. It validates autonomous actions against Tokens that widen the reach: a lone \ (drive root), an unset $VAR, ../, 8.3 short names, A stated intent that disagrees with what the call actually does, MCP tools labelled read-only whose call writes or deletes, Commands hidden inside bash -c, cmd /c or encoded PowerShell, and curl | bash, "Always allow" rules that would also let through other commands, and refuses them for npx, bash -c, chained or irreversible calls. Limitation: verify agent-action-approve policies at server boundary.

How do I install agent-action-approve with shadcn?

Run `npx shadcn@latest add @bollard/agent-action-approve`. Sources added: registry/default/agent-action-approve/agent-action-approve.tsx, registry/default/agent-action-approve/analyze.ts. Package requirements: lucide-react, motion.

What props customize Agent Action Approve?

Agent Action Approve accepts `call`, `allowedHosts`, `holdMs`, `onDecision`, `messages`. Configures tool approval, human in the loop, mcp behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of agent-action-approve?

A review UI only: whether a call is actually blocked depends on your host app honouring the decision. Static analysis of the call text; it cannot know what a script or binary does once run. Unknown tools and argument shapes are described less precisely than shell and SQL calls. "User approved this" does not mean the operation is safe Server requirement: Enforce the decision at the tool boundary: the agent runtime must refuse calls that were not approved, and check the caller's authorisation for the target.

How does Agent Action Approve meet accessibility guidelines?

Decision result receives focus (tabIndex=-1) and status text is announced in a role="status" region. Hold-to-approve works with Space or Enter held down, not just the pointer. Refusals of an "always" rule use role="alert". Risk level is shown with text and icon, not colour alone; motion respects prefers-reduced-motion. Minimizes errors: ai agent deleted my files, agent ran rm -rf on wrong folder.

Which components pair with Agent Action Approve?