Skip to main content

Chat

PermissionPrompt

An agent asking the person's permission before it acts: what it wants to do, exactly what it would run, why, and how risky it is, with Allow once and Deny. Once answered, here or in another app, the buttons give way to one line that says who answered and from where, "Allowed by Ana from their phone", which a screen reader hears; if the person was on a button, focus moves to that line. Allow and Deny are the person's alone: its agent side, permissionPromptAx, declares them person-only, so no agent door offers them.

Your agent wants to run a command

To add the package that scales a recipe for six.
Medium risk
npm install recipe-scaler

Research helper wants to edit a file

To fix the oven temperature in step two.
Low risk
recipes/roast.md

Allowed by Ana from their phone · 9:41

Install

Hand it to your agent
Add PermissionPrompt from Ouro UI to this app. Read https://ui.ouroboros.bot/docs/permission-prompt.md first and follow it.

Or by hand. Once per app, with Tailwind CSS v4 and an @/* path alias (Ouro HX is built on Base UI, so --base base; skip -t in an existing app):

npx shadcn@latest init --base base --preset nova --yes --no-monorepo
npx shadcn@latest add ourostack/ouro-ui/ouro-base#v1.3.823

Then the component (Installing):

npx shadcn@latest add ourostack/ouro-ui/permission-prompt#v1.3.823
import { PermissionPrompt } from "@/components/ouro/permission-prompt/permission-prompt";

Paths use shadcn's default @/ alias; the CLI rewrites them to yours.

Example

<PermissionPrompt
  title="Your agent wants to run a command"
  detail="npm install left-pad"
  reason="To add the package the importer needs."
  risk="medium"
  onAllow={allow}
  onDeny={deny}
  answer={answer}
/>

Use instead when

  • Use ConfirmDialog instead to confirm the person's own action in your app, and AttentionCard instead to list a request that waits elsewhere.

Props

Type: PermissionPromptProps.

allowLabel
Type: string
Default: "Allow once"
The allow button's label.
answer
Type: PermissionAnswer
The person's answer, once they have given it, in this app or another: the buttons give way to who answered.
answering
Type: "allow" | "deny"
Which answer is on its way, while your app sends it: that button shows it is busy and neither presses again.
className
Type: string
Layout only: margins, width (mt-2, max-w-xl). Appearance classes warn in development.
denyLabel
Type: string
Default: "Deny"
The deny button's label.
detail
Type: string
Exactly what it would run or change, as plain text, shown in a CodeBlock: npm install left-pad.
headingLevel
Type: 2 | 3 | 4 | 5 | 6
Default: 3
The title's heading level, one below the section's heading, as Card's.
onAllow
Type: (() => void)
Called when the person presses Allow once.
onDeny
Type: (() => void)
Called when the person presses Deny.
reason
Type: ReactNode
Why it asks, in the agent's words: "To add the package the importer needs."
ref
Type: Ref<HTMLDivElement>
Reaches the rendered element.
risk
Type: "medium" | "low" | "high"
How much could go wrong if the person allows it, as a badge: low, medium or high.
title (required)
Type: ReactNode
What the agent wants to do, as a sentence: "Your agent wants to run a command".

Don't use

These are not props. Passing one fails the type check with the fix in the error, and in development a console message names the fix.

  • command: Not a prop. What it would run is detail: <PermissionPrompt detail="npm install">.
  • description: Not a prop. Why it asks is reason: <PermissionPrompt reason="To add the package">.
  • onApprove: Not a prop. Ouro UI uses onAllow: <PermissionPrompt onAllow={allow}>.
  • onReject: Not a prop. Ouro UI uses onDeny: <PermissionPrompt onDeny={deny}>.
  • status: Not a prop. The person's answer is answer: <PermissionPrompt answer={{ decision: "allowed", by: "Ana" }}>.

className is for layout only

Pass margins, width and grid placement (mt-4, w-full, col-span-2).

Appearance comes from props, not classes. In development, a class that sets appearance logs one warning per component instance, naming the prop to use instead. A class sets appearance when, after its variants (hover:, sm:) and any ! are removed, it starts with bg-, text-, border-, rounded-, shadow-, font-, ring-, from-, via-, to-, fill- or stroke-, or is border, rounded, shadow or ring, or has a dark: variant. Text wrapping, overflow and table layout classes (text-wrap, text-ellipsis, border-collapse) are layout and do not warn.

Alignment classes (text-center) warn too: set alignment on a parent element.

Types

PermissionAnswer

How the person answered a PermissionPrompt.

interface PermissionAnswer {
  /** What they chose. */
  decision: "allowed" | "denied";
  /** Who answered: "Ana", "you". */
  by: ReactNode;
  /** Where they answered from, such as "the desktop app" or "their phone": "Allowed by Ana from their phone". */
  app?: ReactNode;
  /** When, already formatted ("9:41", `<RelativeTime>`). */
  at?: ReactNode;
}