Skip to content
GitHub (opens in a new tab)
SettingsScreen

Audit log

Every action by people and agents in the workspace, filterable, with before and after for each change.

What a screen is

A screen is a whole page exported from the kit, built only from kit components and tokens. Import it once, pass your data and callbacks, and render it as the page: it brings its own nav and <main>, and its loading and empty states are built in. A pattern is the copy-in version you own and change; a block is one area that sits inside your <main>.

When to use

  • admins need one record of what people and agents did in the workspace: sign-ins, changes, deletes, approvals, permission changes and agent runs
  • an agent acts for a person and the log should say both
  • you want the whole page done, with loading, empty and filtered empty, and only need to pass data and callbacks

When not to use

  • a short feed of recent activity inside a page — ActivityFeed
  • one record's own history, like an invoice — ActivityFeed with variant history
  • one agent run step by step — RunDetail
  • what an agent did to guardrails in one run — GuardrailLog

Usage

Every action by people and agents in the workspace on one page: sign-ins, changes, deletes, approvals, permission changes and agent runs. Pick a date range, export a CSV, and filter by People, Agents or System, by actor, action type or resource, or search. Each row says when, who (and who an agent acted for), what in a Badge with a word, and which record, with a link to it. Open a row for what changed as Before and After, the request and the linked run. Import it once and pass the events and your callbacks. The frozen time column, row menus, Load more, the toasts, phones, loading, empty and filtered empty come with it.

<AuditLogScreen events={events} selectedId={openId} onSelect={setOpenId} filters={filters} onFiltersChange={setFilters} range={range} onRangeChange={setRange} onExport={exportCsv} onAction={(action, id) => handle(action, id)} onNavigate={(to, detail) => go(to, detail)} hasMore={hasMore} onLoadMore={loadMore} workspace={{ name: "Northwind" }} user={{ name: "Alex Morgan", email: "alex@northwind.example" }} />
import { AuditLogScreen } from "agentic-ds-kit";

export default function AuditLogPage({ events, hasMore, loading }) {
  // The screen renders its own app nav and <main>: don't wrap it in another main.
  return (
    <AuditLogScreen
      events={events}                          // { id, at, when?, actor, action, resource?, summary, source, changes?, … }[]
      loading={loading}                        // Skeleton rows; the title stays
      range={range}
      onRangeChange={(next) => fetchEvents(next)}
      onExport={() => downloadCsv(filters)}
      hasMore={hasMore}
      onLoadMore={() => fetchNextPage()}
      onNavigate={(to, detail) => {
        if (to === "customer") router.push(`/customers/${detail.customerId}`);  // an invoice opens its customer
        else if (to === "plan") router.push(`/plans/${detail.planId}`);        // Plan review
        else if (to === "run") router.push(`/runs/${detail.runId}`);           // Run / Handoffs
        else if (to === "agent") router.push(`/agents/${detail.agentId}`);
        else router.push(`/${to}`);
      }}
      workspace={{ name: "Northwind" }}
      user={{ name: "Alex Morgan", email: "alex@northwind.example" }}
    />
  );
}

Props

AuditLogScreen props, from the screen contract.
PropTypeDefaultNotes
eventsarray—{ id, at, when?, actor: { kind: "person" | "agent" | "system", id, name, src?, tone?, icon?, onBehalfOf?: { id, name } }, action: "created" | "updated" | "deleted" | "approved" | "denied" | "ran" | "signed-in" | "permission-changed", outcome?: "success" | "failed", resource?: { type: "agent" | "customer" | "invoice" | "plan" | "setting", id, label, customerId?, agentId? }, summary, source: { ip?, client }, changes?: { field, before?, after? }[], request?: { method, path, requestId, userAgent? }, run?: { runId, agentId } }[] The events in the range, newest first. at is an ISO 8601 time: it sorts Time and fills the time element and the exact time (UTC). when is the relative time, shown as given (like 12 min ago); left out, the exact time shows. A failed signed-in reads Sign-in failed (danger); any other failed action adds failed to its word. changes fill What changed in the Drawer (before left out reads Not set, after left out reads Removed). Sample Northwind log (20 events over 14–20 November) when omitted.
selectedIdstring—The event open in the Drawer. Left out, the screen keeps it, with none open first. null closes it.
onSelectfunction—(id | null) => void. The Time button, a card, View details, or null when the Drawer closes.
filtersobject—{ actorKind: "all" | "people" | "agents" | "system", query: string, actorId: string, action: action | "all", resource: resource type | "all" } The filters. Left out, the screen keeps them, starting on All with no search. Filtering is over the loaded events.
onFiltersChangefunction—(filters) => void. Any filter control, Filter by the actor from a row menu, or Clear filters.
rangeobject—{ start: string, end?: string } The date range, YYYY-MM-DD, shown in the DateRangePicker. Left out, the screen keeps it, starting on 14–20 November (the sample).
onRangeChangefunction—(range) => void. The DateRangePicker's Apply. Fetch the events for the new range.
onExportfunction—() => void. Export CSV in the header. Hidden when there are no events.
onActionfunction—(action, id) => void. action is "view" | "copy-id" | "filter-actor" from a row menu, or "copy-id" | "open-resource" from the Drawer, with the event id. Copy event ID writes the id to the clipboard; Copy and Filter are said in a kit Toast.
onNavigatefunction—(destination, detail?) => void. destination is an app nav row ("overview" | "inbox" | "customers" | "agents" | "runs" | "settings" | "audit-log"), or from a resource link or Open resource "customer" ({ customerId, invoiceId? }: Customer detail; an invoice opens its customer), "agent" ({ agentId }), "plan" ({ planId, agentId }: Plan review) and "settings" ({ section }), or "run" ({ runId, agentId }: Run / Handoffs) from the Drawer's linked run.
hasMorebooleanfalseMore events exist past the loaded ones: shows Load more under the Table when onLoadMore is set.
onLoadMorefunction—() => void. Load more: fetch the next page and append it to events. The button reads Loading… until events grows or hasMore turns false.
workspaceobject—{ name: string, icon?: KitIcon } App nav brand and the subtitle's workspace. Same shape as SettingsPreferencesScreen. Example workspace when omitted.
userobject—{ name: string, email?: string, src?: string } Account menu at the foot of the app nav (kit DropdownMenu: the avatar on the rail, the account card in the Drawer, both with src as the photo and an online presence mark; the menu holds View profile, Account settings, Documentation, Switch account with a sample second account, Add account and Sign out, all samples that only close the menu except Account settings, which goes to a Settings row when the screen has one). Same shape as SettingsPreferencesScreen. Example person when omitted.
loadingbooleanfalseThe title, range and filters stay (disabled, no counts); the Table rows are Skeletons; main is aria-busy.
emptybooleanfalseNo events yet: kit Empty, whatever events holds. Also shown when events is empty.
classNamestring—On the root layout-shell.

States

  • page: default, loading, empty, drawer-open, agents-only, filtered-empty
  • event: created (Badge Created, success tone, Plus), updated (Badge Updated, info tone, Pencil; the Drawer shows What changed), deleted (Badge Deleted, danger tone, Trash2), approved (Badge Approved, success tone, CircleCheck), denied (Badge Denied, neutral tone, Ban), ran (Badge Ran, primary tone, Play), signed in (Badge Signed in, neutral tone, LogIn), sign-in failed (Badge Sign-in failed, danger tone, ShieldX; the Drawer has the danger tone), permission changed (Badge Permission changed, warning tone, KeyRound; the Drawer has the warning tone), agent on behalf of a person (Agent, on behalf of Priya Shah under the agent's name)
  • layout: the Table with every column (--grid-breakpoint-lg and wider), the Table without IP / source, which stays in the Drawer (below --grid-breakpoint-lg), the Table without Details and IP / source; the Drawer title is the event summary (below --grid-breakpoint-md), a ListView of cards: the summary, the actor and resource, then the action word and time, in danger or warning words where the Badge would be (below --grid-breakpoint-sm)

Accessibility

  • Renders its own main landmark named Audit log; the app nav is an aside named App. Don't wrap the screen in another main
  • PageHeader title is the page h1; the Drawer title is the event summary
  • The filters sit in a search landmark named Filter events; the SegmentedControl is a radiogroup named Show and each option says its count; the Selects are named Actor, Action type and Resource
  • The Table has a caption with the workspace, the range, the filters in words and how many events show
  • Each time is a time element with a datetime attribute and the exact time as its title; the exact time is also written out in the Drawer
  • The action is a word beside an icon in a Badge, and Sign-in failed, Deleted and Permission changed say so in words; never colour alone
  • What changed is a table with Field, Before and After headers; a missing value reads Not set or Removed, so the change reads as text, not colour
  • Row menus are named Actions for the actor, action and time, like Actions for Dana Whit, Approved, 8 min ago
  • The Drawer returns focus to the control that opened it when it closes
  • Copy event ID and Filter by the actor are said in a kit Toast (role=status, polite)
  • / puts focus in search when focus is not in a field
  • Below --grid-breakpoint-md the nav opens from an IconButton named Menu into a kit Drawer
  • loading sets aria-busy on main
  • No motion of its own

Responsive

  • Wide (--grid-breakpoint-md and wider): the app nav on the canvas, the page on the inset panel, the Table with the first column frozen when it scrolls sideways; below --grid-breakpoint-lg IP / source moves to the Drawer
  • Below --grid-breakpoint-md: the nav moves into a left kit Drawer and the Table drops Details and IP / source (the Drawer has both)
  • Below --grid-breakpoint-sm: the Table becomes a ListView of cards that open the Drawer, which fills the screen; search goes on its own row and the Selects share the rows under it
  • Dark mode follows the root theme; semantic tokens only

Do not

  • Do not copy the screen's parts into a local cousin; change it through its props or compose the kit pieces yourself
  • Do not wrap it in an app shell or another main
  • Do not add a solid primary Button to the page; Open resource in the Drawer is the only one
  • Do not show an action or a failure by colour alone
  • Do not use raw hex

Built from

  • Block
    →

    Activity feed

    What people and agents did across the workspace, newest first and grouped by day.

  • Block
    →

    Run detail

    One agent run on one screen: clock, cost, pending approval and every step, all following the step you pick.

  • Component
    →

    GuardrailLog

    Every time a policy rule stepped in on an agent by itself: blocked, rewritten or flagged, what the agent tried, newest first.

  • Component
    →

    SideNav

    Product side nav: brand header, icon items, optional badges, closeable; variant single (one column that closes to an icon rail) or rail-subnav (a fixed icon rail plus a SideNav.SubNav column with the picked parent's rows).