Skip to content

@flue/react should expose safe display metadata for tool parts #375

Description

@dknecht

Summary

Reduced dynamic-tool parts currently expose raw tool input / output, but there is no separate safe-display contract for UI surfaces that want to show live tool activity without exposing trusted context or user/customer text verbatim.

For agent activity feeds, raw tool payloads are often the wrong presentation boundary:

  • tool output may contain retrieved documents, case/customer text, or trusted context;
  • tool input may contain large internal prompt/context objects;
  • apps often only need a friendly label, lifecycle state, compact safe argument summary, and maybe a safe operator-facing result summary.

Why this matters

A React app consuming useFlueAgent().messages should be able to render a live activity feed from reduced message parts without either:

  • displaying raw tool payloads to users/operators by default;
  • reconstructing raw events separately;
  • or maintaining app-specific deny-lists for every tool whose output is unsafe to show.

Possible API shape

One option would be to let tool definitions or emitted tool events provide explicit display metadata, for example:

{
  type: "dynamic-tool",
  toolName,
  toolCallId,
  state,
  input,
  output,
  display: {
    label: "Loading case context",
    summary: "Loaded case context",
    details?: "operator-safe detail text",
    inputSummary?: "domain=example.com"
  }
}

The exact shape is less important than the principle: raw input/output and safe UI presentation should be distinct.

Related

This is related to origin/visibility metadata for reduced messages: apps need to know which parts are user-visible and which are internal orchestration/debug data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions