MingaAgent.Redaction (Minga v0.1.0)

Copy Markdown View Source

Redacts secrets before values cross logs, UI, telemetry, status, or model-visible tool results.

Redaction is intentionally conservative. Secret-bearing map keys never expose values, and common token-shaped substrings are replaced even when they appear inside a free-form error string from an external process.

Summary

Functions

Formats and redacts an arbitrary error term.

Redacts argv-style secret values while preserving non-secret arguments.

Redacts environment values while keeping keys visible.

Redacts an error string or command output string.

Redacts an arbitrary term while preserving safe shape for diagnostics.

Returns true when a key name conventionally carries a secret.

Types

redacted()

@type redacted() :: String.t()

Functions

format_error(reason)

@spec format_error(term()) :: redacted()

Formats and redacts an arbitrary error term.

redact_args(args)

@spec redact_args(term()) :: term()

Redacts argv-style secret values while preserving non-secret arguments.

redact_env(env)

@spec redact_env(map()) :: %{required(String.t()) => redacted()}

Redacts environment values while keeping keys visible.

redact_string(value)

@spec redact_string(String.t()) :: redacted()

Redacts an error string or command output string.

redact_term(config)

@spec redact_term(term()) :: term()

Redacts an arbitrary term while preserving safe shape for diagnostics.

secret_key?(key)

@spec secret_key?(term()) :: boolean()

Returns true when a key name conventionally carries a secret.