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-selectorThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
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.
oxyn add permission-selectorUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Menu
A chip that opens the presets.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Open
Open with risk on each row.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Cards
Presets as cards.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Policy
Workspace policy blocks high risk.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
PermissionSelector
| Prop | Type | Default | Description |
|---|---|---|---|
presets | Vec<Preset> | default_presets() | Presets (default Read only · Ask before edits · Auto-edit · Full access). |
value | String | "ask" | Initial id. |
ceiling | String | "high" | Highest risk allowed (`low` · `medium` · `high`). |
variant | String | "menu" | Variant: `menu` (chip + list) or `cards`. |
open | bool | Default::default() | Start open (menu). |
on_change | EventHandler<String> | — | Changed. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| EnterorSpace | Open the presets or choose one |
| Tab | Move through presets |
| Escape | Close, 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:
radiogrouplabelled "Permission level"; eachradiohasaria-describedby→ its "what auto-runs" line and, for capped rows, the policy reason. - Confirm panel:
alertdialogwitharia-labelledby(title) andaria-describedby(consequences); focus moves to Cancel first, not the danger button; the danger button exposesaria-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
Attentionaction.
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
Attentionscrolls 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
| Transition | Duration | Delay | Easing / spring | Notes |
|---|---|---|---|---|
| Hover bg | 80 ms | 0 | ease-out | — |
| Tooltip | 120 ms | 500 ms | ease-out | — |
| Press | ~120 ms | 0 | spring 600 / 30 | — |
| Popover open / close | ~200 ms / 120 ms | 0 | spring 380 / 32 / ease-in | shared |
| Dial detent snap | ~160 ms | 0 | spring 520 / 34 | — |
| Tone crossfade (chip + border) | 240 ms | 0 | ease-in-out | — |
| Glyph morph | 220 ms | 0 | cubic-bezier(0.22, 1, 0.36, 1) | — |
| Confirm panel in (list → panel) | 200 ms | 0 | ease-out, height spring 320 / 30 | — |
| Arming fill | 600 ms | 0 | linear | proposed safety delay |
| Early-click shake | 240 ms, 2 cycles, 3 px | 0 | linear | — |
| Applied scale pop | 260 ms | 0 | spring 400 / 20 | raises only |
| Undo toast | 5 s visible | 0 | 160 ms in/out | raises only |
| Attention badge in | ~180 ms | 0 | spring 500 / 22 | — |
| Attention pulse | 600 ms | 0 | ease-in-out | once per new approval |
| Card flash on jump | 400 ms | scroll end | ease-out | — |
| Notes (AppliedNow / Reverted) | 160 in / 2400–4000 hold / 160 out | 0 | ease-out / ease-in | — |
| Reduced motion | tone 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:
glyphorsegmented; 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-bypassuses haptic ticks. - Slow networks: level is local; if the adapter must acknowledge (remote agent), chip shows
Applyingwith 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:
PendingNextpersists;timer-scopevariant 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
PermissionSelectorfromoxyn_dioxusand includeCOMPOSER_CSSplus the token stylesheet once. - A GPUI version exists:
PermissionElinoxyn_gpui. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.