openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Surface approval history (audit trail) in Settings

Open obchain opened this issue 6 months ago • 1 comments

Summary

Surface the approval audit trail in the desktop UI. The core already exposes a read path for decided approvals (openhuman.approval_list_recent_decisions, merged in #2335) and the live pending queue (openhuman.approval_list_pending), but neither has a frontend caller — the only approval UI today is the in-chat ApprovalRequestCard that handles a single live prompt. Users have no way to review what the agent asked to do and how each request was decided.

Problem

When the agent runs under the supervised access tier, every external-effect tool call is gated and the user answers Approve once / Always allow / Deny. Those decisions are persisted as durable ApprovalAuditEntry rows (PII-scrubbed: summaries carry no chat content, arguments are redacted to shape-only). Today that history is write-only from the user's perspective — there is no screen to read it back.

Concretely:

  • No audit/compliance surface — an operator cannot see who approved which tool, when, and with what decision.
  • The merged backend read path (#2335) has zero callers, so the feature it shipped is effectively dark.

Platform: desktop (macOS/Windows/Linux). No backend or external-service dependency — the gate runs in-process.

Solution (optional)

Add a read-only Approval history panel under Settings → Agent access:

  • A small approvalApi.ts client calling approval_list_recent_decisions (and approval_list_pending), normalizing the RpcOutcome wire shape ({result, logs} envelope when the gate is installed vs bare [] when absent).
  • An ApprovalHistoryPanel rendering loading / empty / error / loaded states, one row per decided request (tool name, scrubbed summary, decision badge, decided-at timestamp), with a Refresh control and a stale-response guard.
  • A link from AgentAccessPanel into the new panel; route + breadcrumb wiring.
  • i18n keys across all locale chunks; about_app capability catalog entry; coverage-matrix row.

No change to approval decision semantics — decisions still flow through openhuman.approval_decide.

Acceptance criteria

  • [ ] Approval history panel reachable — Settings → Agent access → View approval history renders the decided-approval list.
  • [ ] All four states covered — loading, empty, error (localized, no raw backend text), and loaded with one row per decision.
  • [ ] Per-decision badge — Approve once / Always allowed / Denied rendered distinctly.
  • [ ] Wire-shape resilient — handles both the {result, logs} envelope and the bare-array (gate-absent) response without throwing.
  • [ ] Tests added — Vitest unit coverage for the panel states + the API client envelope normalization.
  • [ ] Diff coverage >= 80% — the implementing PR meets the changed-lines coverage gate.

Related

  • #2335 — merged backend read path (approval_list_recent_decisions + ApprovalAuditEntry) this surfaces.
  • #2135 — durable approvals/audit across channels (closed); the storage this reads.

obchain avatar May 29 '26 13:05 obchain

Picking this one up. The backend read path already shipped in #2335 with no UI caller, so I will add a read-only Approval history panel under Agent access and wire the audit list through to it.

obchain avatar May 29 '26 14:05 obchain