The access an AI agent carries, drawn as a badge on a clip: who it is, who issued it, the scopes it may use, its spend cap, the time it has left and its key. The foot line and the punched hole show the last check.
On this page
Examples
Installation
Installation is part of Pro
Pro components install from a licensed registry. The live preview stays open to everyone.
Props
- agent
{ name, role?, avatar? }- Who carries it. avatar is any 48px node, usually an image element.
- issuer
string- Who issued it, on the dark band.
- scopes
{ id, label, granted }[]- What it may use. Read-only, only granted scopes show.
- onScopeToggle
(id) => void- Makes every scope a toggle: granted solid, the rest dashed. Off once expired or revoked.
- cap
{ spent, limit, currency? }- A thin meter for the spend cap, in USD unless currency is set.
- expires
{ label, left }- Time left: a label and the share of the badge's life left (0 to 1), drawn as a ring.
- keyTail / keyPrefix
string / string- Default
- / "ks_live_" - The key's last characters, masked between the prefix and them.
- state
"issuing"|"active"|"checked"|"denied"|"expired"|"revoked"- Default
"active" - Drives the foot line, the punched hole (accent while live) and the stamp.
- check
{ tool, ok, at?, reason? }- The last check, for the foot line.
- clip / footer
boolean / ReactNode- Default
true / - - The lanyard and clip above; something under the status, such as a Revoke button.
| Prop | Type | Default | Description |
|---|---|---|---|
| agent | { name, role?, avatar? } | - | Who carries it. avatar is any 48px node, usually an image element. |
| issuer | string | - | Who issued it, on the dark band. |
| scopes | { id, label, granted }[] | - | What it may use. Read-only, only granted scopes show. |
| onScopeToggle | (id) => void | - | Makes every scope a toggle: granted solid, the rest dashed. Off once expired or revoked. |
| cap | { spent, limit, currency? } | - | A thin meter for the spend cap, in USD unless currency is set. |
| expires | { label, left } | - | Time left: a label and the share of the badge's life left (0 to 1), drawn as a ring. |
| keyTail / keyPrefix | string / string | - / "ks_live_" | The key's last characters, masked between the prefix and them. |
| state | "issuing" | "active" | "checked" | "denied" | "expired" | "revoked" | "active" | Drives the foot line, the punched hole (accent while live) and the stamp. |
| check | { tool, ok, at?, reason? } | - | The last check, for the foot line. |
| clip / footer | boolean / ReactNode | true / - | The lanyard and clip above; something under the status, such as a Revoke button. |
States
- Scope toggled
The chip turns solid or dashed- Default
120ms - ease out
- A check lands
The foot line changes and settles in- Default
180ms - ease out
- Spend
The cap meter fills- Default
280ms - ease in-out
- Revoked, expired
The badge greys and a stamp crosses it- Default
at once - -
| Prop | Type | Default | Description |
|---|---|---|---|
| Scope toggled | The chip turns solid or dashed | 120ms | ease out |
| A check lands | The foot line changes and settles in | 180ms | ease out |
| Spend | The cap meter fills | 280ms | ease in-out |
| Revoked, expired | The badge greys and a stamp crosses it | at once | - |
Accessibility
- An article named for its agent and issuer. Editable scopes are toggle buttons with aria-pressed.
- The foot line is a polite status, so a check is announced once.
- The cap is a meter with its values; the key reads as its prefix and "ending in" its tail.
When to use
When to use
- Showing what one agent may do, its cap and how long its access lasts, where a person issues, edits or revokes it.
- The hero object of an agent access or identity product: scopes toggled on the badge, the last check at its foot.
When not to use
- Rules for many agents at once: use Agent Policy.
- Showing or copying the key itself: use Secret Field.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Agent Badge to my app and wire it to my own data.
- I need showing what one agent may do, its cap and how long its access lasts, where a person issues, edits or revokes it. Set that up with the Knowns UI Agent Badge.
- Which Agent Badge props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "agent-badge" }) and search_docs({ query: "agent badge" }). Pro props, full examples and source come back once your license key is in the MCP config.