Loading component…
Loading component…
What your agent – and every agent it starts – may do without asking you first: pick how autonomous it is, review each app's actions and set the red lines.
To reuse this local React demo, copy all files from the Code tab into the same folder, then import Agent/Permissions from ./agent-permissions.
import { AgentPermissionsScreen } from "@/components/ui/agent-permissions";
export default function Page() {
const [rules, setRules] = useState(initialRules);
return (
<AgentPermissionsScreen
apps={connectedApps}
rules={rules}
onChange={(rule) => {
setRules((l) => l.map((r) => (r.id === rule.id ? rule : r)));
api.savePermission(rule.id, rule.level, rule.limit);
}}
onPreset={(preset) => analytics.track("preset", { preset })}
onNavigate={(label) => router.push(routes[label])}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| apps | { id; name; account?; icon? }[] | seven sample apps | The connected apps, in the order their groups show – icon is a Hugeicons icon, shown in the app's color |
| rules | { id; app; action; detail?; icon?; level: "allow" \| "ask" \| "never"; defaultLevel?; kind?: "read" \| "write" \| "risky"; locked?; limit?: { value; unit }; week?: { done?; asked?; blocked? }; recent?: { what; outcome; at }[] }[] | Every action. level is what it may do now, defaultLevel what Reset goes back to (default: the level it came in with); kind is what the presets go by; locked makes it a red line – listed under Red lines, left alone by the choice above, and never on its own; limit lets it act on its own up to an amount and ask above; week fills the row's count and the panel's numbers; recent is what happened lately – done, approved, declined or blocked. Pass a stable array (state) | |
| defaultApp | string \| null | "stripe" | The app open on the right when the screen starts |
| onChange | (rule: PermissionRule) => void | Called with the whole rule when its choice or its limit changes – a preset or a group's choice calls it for every rule that moved | |
| onPreset | (preset: "cautious" \| "balanced" \| "handsoff") => void | Called with a preset after the screen has set every rule by it | |
| onSelect | (appId: string) => void | Called when an app is opened | |
| onNavigate | (label: string) => void | Called with the label of a sidebar item | |
| workspace | string | "Fieldwork" | The workspace in the sidebar |
| labels | { permissions?; intro?; autonomy?; allowLong?; askLong?; neverLong?; locked?; cautious?; balanced?; handsoff?; reads?; changes?; care?; … } | Labels, e.g. for a translation | |
| user | { name: string; avatar?: string } | { name: "Alex Morgan" } | Account at the bottom of the sidebar |
| loading | boolean | While your apps and rules load: gray rows for the apps, the red lines and the open app, in the shape of the real ones (the shared Skeleton) | |
| empty | boolean | No apps connected: the Apps list shows No apps connected with a sentence on what shows up here and a Connect app button (onConnect), the red lines hide and the App panel shows nothing open | |
| onConnect | () => void | Called with Connect app in the empty list (default: onNavigate("Integrations")) | |
| className | string | Extra class on the root |
Fills its container – give it the full viewport height in your app; the page keeps a readable 680px column
Below 620px the three choices stack and the apps keep their small bars without the words; an app opens in the App Shell's sheet
Long names and accounts end in '…' with the full text in a tooltip; an app without a logo or icon shows its first letter; a limit's field grows with its amount; dates from another year carry the year
Touch targets grow to 36px on touch screens
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"