Jido.AI.Observe.Sanitize (Jido AI v2.3.0)

Copy Markdown View Source

Sanitizer boundary for AI telemetry and public/tool transport payloads.

The telemetry profile keeps metadata low-cardinality by redacting sensitive keys, bounding nested values, and summarizing payload-shaped fields.

The transport profile preserves more payload detail while converting arbitrary terms into bounded JSON-safe data.

Summary

Functions

Sanitizes arbitrary payloads for a specific boundary profile.

Redacts sensitive keys recursively without changing payload shape otherwise.

Sanitizes event metadata before it crosses the telemetry boundary.

Sanitizes public/tool payloads into bounded JSON-safe data.

Types

profile()

@type profile() :: :telemetry | :transport

Functions

sanitize(payload, profile, opts \\ [])

@spec sanitize(term(), profile(), keyword()) :: term()

Sanitizes arbitrary payloads for a specific boundary profile.

sensitive(payload)

@spec sensitive(term()) :: term()

Redacts sensitive keys recursively without changing payload shape otherwise.

telemetry_metadata(metadata, opts \\ [])

@spec telemetry_metadata(
  term(),
  keyword()
) :: term()

Sanitizes event metadata before it crosses the telemetry boundary.

transport_payload(payload, opts \\ [])

@spec transport_payload(
  term(),
  keyword()
) :: term()

Sanitizes public/tool payloads into bounded JSON-safe data.