Skip to content
Back

Permission selectorPro

How much the agent may do without asking: Read only, Ask before edits, Auto-edit or Full access, with risk levels, a confirm for full access and a workspace ceiling.

oxyn add permission-selector
The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

Rendered from Rust at build time · goes live when visible

When to use

  • Before (and during) a run the user decides how much the agent may do without asking: only read, ask before every change, edit files freely but ask before commands, run everything inside a sandbox, or skip all checks.
  • The selector is a chip in the composer row; its state is the safety posture of the session.
  • The user needs to see the posture at a glance (and feel it when it is dangerous), raise or lower it quickly, understand the scope (this session vs remembered), and see how it connects to the approval cards that appear in the transcript.

When not to use

  • Switch the agent between Ask, Plan and Agent: use Mode switch instead.
  • Send, stop, queue and steer in one control, in twelve styles: use Send control instead.
  • Prompt composer with model picker, voice input, app connections and approval request: use Chat Composer instead.

Installation

Permission selector is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.

Terminal
oxyn add permission-selector

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Menu

A chip that opens the presets.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Open

Open with risk on each row.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Cards

Presets as cards.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Policy

Workspace policy blocks high risk.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

PermissionSelector

PropTypeDefaultDescription
presetsVec<Preset>default_presets()Presets (default Read only · Ask before edits · Auto-edit · Full access).
valueString"ask"Initial id.
ceilingString"high"Highest risk allowed (`low` · `medium` · `high`).
variantString"menu"Variant: `menu` (chip + list) or `cards`.
openboolDefault::default()Start open (menu).
on_changeEventHandler<String>—Changed.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterorSpaceOpen the presets or choose one
TabMove through presets
EscapeClose, or cancel a confirm

Accessibility

  • Presets are a radiogroup; blocked ones are aria-disabled with the reason.
  • Full access asks in an alertdialog before it applies.
From the spec
  • Chip: button, aria-haspopup="dialog" (popover contains list + scope + confirm), label per state: "Permissions: Ask before changes, this session. Change permissions", "Permissions: Bypass all approvals is on for this session. Dangerous", "Permissions: 2 actions waiting for your approval".
  • List: radiogroup labelled "Permission level"; each radio has aria-describedby → its "what auto-runs" line and, for capped rows, the policy reason.
  • Confirm panel: alertdialog with aria-labelledby (title) and aria-describedby (consequences); focus moves to Cancel first, not the danger button; the danger button exposes aria-disabled="true" while arming and announces "Available" when armed.
  • Live region: polite for applied / pending / reverted ("Full access on for this session", "Ask will apply from your next message"); assertive for "Bypass all approvals is on" and for policy-forced lowering.
  • Risk is conveyed by glyph shape, label text and tier dot, not only colour; danger tones meet 4.5:1 for text and 3:1 for borders in both themes; daltonized themes add the hatch pattern to tier 3 too.
  • Focus order: … mode → permission → context → send. Approval cards are reachable from the chip via the Attention action.

Motion & interaction

  • Hover / press / focus: shared chip grammar (80 ms bg, 0.97 press spring, 2 px ring).
  • Tier tone: chip glyph + label + 1 px composer border crossfade to the tier tone. Tier 3 border is amber at 60 % alpha; tier 4 border is danger at 80 % alpha plus a static 45° hatch on the chip background at 8 % alpha (no animated stripes; danger should be calm and constant, not flashy).
  • Glyph morph: lock → hand → pencil-shield → open shield → shield-off; the shield body is shared across glyphs so morphs read as one object changing (path interpolation in GPUI, crossfade in Dioxus).
  • Arming: the danger button's fill sweeps left→right in 600 ms; hovering away does not cancel; a second click before armed does nothing and gives a 2-cycle 3 px shake of the button.
  • Confirm → applied: confirm panel collapses back into the chip (height to 0, then popover closes); chip does a single scale 1 → 1.06 → 1 with the new tone.
  • Lowering: no celebration; chip tone simply cools; pending auto-run tool rows in the transcript flip to "Awaiting approval" (tool-call spec owns that row).
  • Attention badge: pops in with scale 0 → 1 (spring), the chip pulses amber once (opacity 1 → 0.6 → 1); repeats at most once per new approval, never loops.
  • Approval-card link: clicking the chip in Attention scrolls the transcript to the first pending card and flashes its border once; conversely each approval card header shows a mini read-only copy of this chip ("Ask · this session") so the user knows why they are being asked.
  • Auto-approved provenance: tool rows that ran because of the current level carry a 10 px glyph of that level (hover: "Ran automatically · Auto-edit"); in Bypass the glyph is the danger shield.
  • Reverted note: slides down under the chip once, 4 s, dismissible.
Timing
TransitionDurationDelayEasing / springNotes
Hover bg80 ms0ease-out—
Tooltip120 ms500 msease-out—
Press~120 ms0spring 600 / 30—
Popover open / close~200 ms / 120 ms0spring 380 / 32 / ease-inshared
Dial detent snap~160 ms0spring 520 / 34—
Tone crossfade (chip + border)240 ms0ease-in-out—
Glyph morph220 ms0cubic-bezier(0.22, 1, 0.36, 1)—
Confirm panel in (list → panel)200 ms0ease-out, height spring 320 / 30—
Arming fill600 ms0linearproposed safety delay
Early-click shake240 ms, 2 cycles, 3 px0linear—
Applied scale pop260 ms0spring 400 / 20raises only
Undo toast5 s visible0160 ms in/outraises only
Attention badge in~180 ms0spring 500 / 22—
Attention pulse600 ms0ease-in-outonce per new approval
Card flash on jump400 msscroll endease-out—
Notes (AppliedNow / Reverted)160 in / 2400–4000 hold / 160 out0ease-out / ease-in—
Reduced motiontone and glyph swap with 80 ms opacity; arming shows a static "Available in 0.6 s" text then enables (delay is kept — it is a safety rule, not decoration); no pulse (badge only); no shake (inline text "Wait a moment"); no scale pop—linear—

Responsive behaviour

  • Cards wrap to one column in narrow frames.
Edge cases (spec)
  • Long labels / i18n ("Automatisch bearbeiten"): chip uses short_label; popover rows wrap to 2 lines.
  • Custom levels: apps can add levels between tiers; each declares a tier so visuals and confirm rules still apply.
  • RTL: list order unchanged (risk is vertical); dial mirrors; arming fill runs right→left.
  • Tiny sizes (16–20 px): glyph only; tier 3–4 add a 4 px corner dot so risk never depends on hue alone.
  • Dense IDE panels: glyph or segmented; confirm opens as a small modal sheet if the popover would be < 240 px tall.
  • Touch: rows 44 px; arming is the same 600 ms; hold-to-bypass uses haptic ticks.
  • Slow networks: level is local; if the adapter must acknowledge (remote agent), chip shows Applying with a 2 px underline progress and reverts with a note on failure. Lowering is applied locally first (fail safe): remote tool calls that arrive after a lower are gated by the client.
  • Very fast agents: an approval card may be answered before the badge animates; skip the pulse if the card resolves within 300 ms.
  • Very slow agents / long runs: PendingNext persists; timer-scope variant keeps counting while the window is hidden (wall clock, not the motion clock).
  • Multiple agents / subagents: subagents inherit the parent level (Factory: subagents inherit autonomy, research 03); the chip shows the parent level and the popover lists overrides.
  • Org policy changes mid-session: if the current level exceeds a new cap, lower immediately (AppliedNow) with reason "Lowered by your organisation".
  • Sandbox missing: Full access without a sandbox is effectively Bypass; app chooses to block or route to the Bypass confirm (SandboxUnavailable).
  • Mode/permission merged cycles: dangerous tiers never enter any cycle.

Notes for AI

  • Import PermissionSelector from oxyn_dioxus and include COMPOSER_CSS plus the token stylesheet once.
  • A GPUI version exists: PermissionEl in oxyn_gpui.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI