Autonomy levels
How much an agent may do on its own – three levels, and its real actions gliding between Runs on its own and Asks you first, with a lock for what always asks.
oxyn add autonomy-levelsSupport agent
What the agent may do on its own
Low-risk work goes ahead; anything risky stops for you
- Read the help center
- Draft replies
- Update ticket fieldsRisky
- Send repliesRisky
- Remove attachmentsDestructive
- Issue refundsDestructive
rsx! {
AutonomyLevels {
actions: Some(agent.actions()),
default_level: 1,
default_pinned: Some(vec!["refund".into()]),
title: "Support agent".into(),
on_level_change: move |l| settings.set_level(l),
on_pinned_change: move |p| settings.set_locks(p),
}
}Rendered from Rust at build time · goes live when visible
When to use
- How much an agent may do on its own: three levels, and the agent's real actions split between "Runs on its own" and "Asks you first", with a lock per action that always asks.
When not to use
- An agent asks before it acts: use Approval Card instead.
- Several open requests in one card: use Approval pager instead.
- An agent's question in its own card above the composer: use Decision Card instead.
Installation
Autonomy levels is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add autonomy-levelsuse crate::oxyn::{AutonomyLevels, STATUS_INDICATOR_CSS};Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{AutonomyLevels, STATUS_INDICATOR_CSS};
Usage
rsx! {
AutonomyLevels {
actions: Some(agent.actions()),
default_level: 1,
default_pinned: Some(vec!["refund".into()]),
title: "Support agent".into(),
on_level_change: move |l| settings.set_level(l),
on_pinned_change: move |p| settings.set_locks(p),
}
}Examples
If risky
If risky – the two safe actions run on their own, the risky ones and the two locked destructive ones ask first.
Support agent
What the agent may do on its own
Low-risk work goes ahead; anything risky stops for you
- Read the help center
- Draft replies
- Update ticket fieldsRisky
- Send repliesRisky
- Remove attachmentsDestructive
- Issue refundsDestructive
Code
rsx! {
AutonomyLevels {
actions: Some(agent.actions()),
default_level: 1,
default_pinned: Some(vec!["refund".into()]),
title: "Support agent".into(),
on_level_change: move |l| settings.set_level(l),
on_pinned_change: move |p| settings.set_locks(p),
}
}Full auto
Full auto: everything runs except what you locked.
Support agent
What the agent may do on its own
It all goes ahead, apart from the locked actions
- Read the help center
- Draft replies
- Update ticket fieldsRisky
- Send repliesRisky
- Remove attachmentsDestructive
- Issue refundsDestructive
Code
rsx! {
AutonomyLevels {
actions: Some(agent.actions()),
default_level: 1,
default_pinned: Some(vec!["refund".into()]),
title: "Support agent".into(),
on_level_change: move |l| settings.set_level(l),
on_pinned_change: move |p| settings.set_locks(p),
}
}Always ask
Always ask: every action waits for you, and the first group says so.
Support agent
What the agent may do on its own
Every action waits for your yes
- Read the help center
- Draft replies
- Update ticket fieldsRisky
- Send repliesRisky
- Remove attachmentsDestructive
- Issue refundsDestructive
Code
rsx! {
AutonomyLevels {
actions: Some(agent.actions()),
default_level: 1,
default_pinned: Some(vec!["refund".into()]),
title: "Support agent".into(),
on_level_change: move |l| settings.set_level(l),
on_pinned_change: move |p| settings.set_locks(p),
}
}Locked
A lock set on a safe action: it always asks, whatever the level.
Support agent
What the agent may do on its own
Low-risk work goes ahead; anything risky stops for you
- Draft replies
- Read the help center
- Update ticket fieldsRisky
- Send repliesRisky
- Remove attachmentsDestructive
- Issue refundsDestructive
Code
rsx! {
AutonomyLevels {
actions: Some(agent.actions()),
default_level: 1,
default_pinned: Some(vec!["refund".into()]),
title: "Support agent".into(),
on_level_change: move |l| settings.set_level(l),
on_pinned_change: move |p| settings.set_locks(p),
}
}Pointed
A row pointed at: the row tints and its lock shows.
Support agent
What the agent may do on its own
Low-risk work goes ahead; anything risky stops for you
- Read the help center
- Draft replies
- Update ticket fieldsRisky
- Send repliesRisky
- Remove attachmentsDestructive
- Issue refundsDestructive
Code
rsx! {
AutonomyLevels {
actions: Some(agent.actions()),
default_level: 1,
default_pinned: Some(vec!["refund".into()]),
title: "Support agent".into(),
on_level_change: move |l| settings.set_level(l),
on_pinned_change: move |p| settings.set_locks(p),
}
}Details
Actions with a detail line under the name.
Support agent
What the agent may do on its own
Low-risk work goes ahead; anything risky stops for you
- Read the help centerArticles, macros and past answers
- Draft repliesSaved as drafts on the ticket
- Update ticket fieldsRiskyPriority, tags and the assignee
- Send repliesRiskyReplies go straight to the customer
- Remove attachmentsDestructiveFiles older than 90 days
- Issue refundsDestructiveUp to the order's full amount
Code
rsx! {
AutonomyLevels {
actions: Some(agent.actions()),
default_level: 1,
default_pinned: Some(vec!["refund".into()]),
title: "Support agent".into(),
on_level_change: move |l| settings.set_level(l),
on_pinned_change: move |p| settings.set_locks(p),
}
}Narrow
Under 340 px the detail lines are left out and the levels tighten.
Support agent
What the agent may do on its own
Low-risk work goes ahead; anything risky stops for you
- Read the help centerArticles, macros and past answers
- Draft repliesSaved as drafts on the ticket
- Update ticket fieldsRiskyPriority, tags and the assignee
- Send repliesRiskyReplies go straight to the customer
- Remove attachmentsDestructiveFiles older than 90 days
- Issue refundsDestructiveUp to the order's full amount
Code
rsx! {
AutonomyLevels {
actions: Some(agent.actions()),
default_level: 1,
default_pinned: Some(vec!["refund".into()]),
title: "Support agent".into(),
on_level_change: move |l| settings.set_level(l),
on_pinned_change: move |p| settings.set_locks(p),
}
}Classic
Classic style: the levels in one track inside a white card, each action its own card on a grey panel.
Support agent
What the agent may do on its own
Low-risk work goes ahead; anything risky stops for you
- Read the help center
- Draft replies
- Update ticket fieldsRisky
- Send repliesRisky
- Remove attachmentsDestructive
- Issue refundsDestructive
Code
rsx! {
AutonomyLevels {
actions: Some(agent.actions()),
default_level: 1,
default_pinned: Some(vec!["refund".into()]),
title: "Support agent".into(),
on_level_change: move |l| settings.set_level(l),
on_pinned_change: move |p| settings.set_locks(p),
}
}API reference
AutonomyLevels
| Prop | Type | Default | Description |
|---|---|---|---|
actions | Option<Vec<AutonomyAction>> | Default::default() | The agent's actions (the demo's when `None`). |
level | Option<u8> | Default::default() | Controlled level (0 Always ask, 1 If risky, 2 Full auto). |
default_level | u8 | 1 | Starting level when uncontrolled. |
pinned | Option<Vec<String>> | Default::default() | Controlled locks (ids that always ask). |
default_pinned | Option<Vec<String>> | Default::default() | Starting locks when uncontrolled (the demo's when `None` and `actions` is `None`). |
title | String | "Agent permissions" | Heading, e.g. the agent's name. |
subtitle | String | "What the agent may do on its own" | Line under the heading. |
point | String | Default::default() | An action shown pointed at (its row tinted, its lock revealed). |
style | String | Default::default() | `clean`, `classic`, or empty to follow `data-cstyle`. |
on_level_change | EventHandler<u8> | — | Another level was picked. |
on_pinned_change | EventHandler<Vec<String>> | — | A lock was set or removed (the whole set). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| ← → ↑ ↓ | Picks the previous or next level |
| Tab | From the levels to the locks of the actions |
| SpaceorEnter | Sets or removes the focused lock |
Accessibility
- The levels are a radio group named Autonomy, described by what the chosen level means.
- Both groups are labelled sections; every lock is a toggle button with aria-pressed that names its action.
- Each change is read out politely – the new level and the counts of actions that run alone or wait for you.
Responsive behaviour
- 432 px up to its container.
- Under 340 px the detail lines go and the levels get tighter; without hover the locks always show and rows grow taller.
Edge cases (spec)
Up to 432 px. Under 340 px the detail lines go and the levels tighten; without hover the locks always show and rows grow to 44 px.
Notes for AI
- Import
AutonomyLevelsfromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
AutonomyLevelsElinoxyn_gpui. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.