# `MingaAgent.Redaction`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_agent/redaction.ex#L1)

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.

# `redacted`

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

# `format_error`

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

Formats and redacts an arbitrary error term.

# `redact_args`

```elixir
@spec redact_args(term()) :: term()
```

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

# `redact_env`

```elixir
@spec redact_env(map()) :: %{required(String.t()) =&gt; redacted()}
```

Redacts environment values while keeping keys visible.

# `redact_string`

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

Redacts an error string or command output string.

# `redact_term`

```elixir
@spec redact_term(term()) :: term()
```

Redacts an arbitrary term while preserving safe shape for diagnostics.

# `secret_key?`

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

Returns true when a key name conventionally carries a secret.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
