Loading component…
Loading component…
How much an agent may do on its own – a three-stop dial, and its real actions gliding between “Runs on its own” and “Asks you first”, with a lock for what always asks
To reuse this local React demo, copy all files from the Code tab into the same folder, then import AutonomyDial from ./autonomy-dial.
import { useState } from "react";
import { AutonomyDial, type AgentAction, type AutonomyLevel } from "@/components/ui/autonomy-dial";
const actions: AgentAction[] = [
{ id: "read", label: "Read files and docs", detail: "Drive · Notion", risk: "safe" },
{ id: "draft", label: "Draft emails", risk: "safe" },
{ id: "send", label: "Send emails", detail: "To customers", risk: "risky" },
{ id: "delete", label: "Delete files", risk: "destructive" },
{ id: "spend", label: "Spend money", detail: "Up to $500", risk: "destructive" },
];
export function AgentPermissions() {
const [level, setLevel] = useState<AutonomyLevel>(1);
const [pinned, setPinned] = useState(["spend"]);
return (
<AutonomyDial
title="Sales agent"
actions={actions}
level={level}
onLevelChange={setLevel}
pinned={pinned}
onPinnedChange={setPinned}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| level | 0 \| 1 \| 2 | Controlled level: 0 Always ask, 1 If risky (safe actions run), 2 Full auto | |
| defaultLevel | 0 \| 1 \| 2 | 1 | Starting level when uncontrolled |
| onLevelChange | (level: AutonomyLevel) => void | Another level was picked | |
| pinned | string[] | Controlled ids of actions that always ask, whatever the level | |
| defaultPinned | string[] | [] | Starting locks when uncontrolled |
| onPinnedChange | (pinned: string[]) => void | A lock was set or removed | |
| title | string | "Agent permissions" | Heading, e.g. the agent's name |
| subtitle | string | "What it may do without asking you" | Line under the heading |
| className | string | Extra class on the root |
Fills its container up to 400px
Below 340px the detail lines are left out and the levels get tighter
Without hover (touch) the locks are always visible; touch screens get taller rows
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"