Summary
There are two recursive mapping redactors. #18193 added autobot_shared/secret_redaction.py::redact_nested (the canonical module, BROAD policy, value-aware, keeps every non-secret field byte-identical). The older autobot-backend/llm_shared/credential_redaction.py::redact_dict also recurses, but differs in two ways that matter:
- it also runs
redact_string over non-credential strings, so non-secret values can change;
- it partially reveals credential strings via
redact_api_key (value[:4]...value[-4:]), where the canonical module uses a fixed-width placeholder.
redact_nested could not reuse redact_dict for GET /api/llm/config because of both differences. That leaves one concept with two implementations and different masking, which is what #17336 set out to remove.
Acceptance criteria
Related: #17336, #18193.
Summary
There are two recursive mapping redactors. #18193 added
autobot_shared/secret_redaction.py::redact_nested(the canonical module, BROAD policy, value-aware, keeps every non-secret field byte-identical). The olderautobot-backend/llm_shared/credential_redaction.py::redact_dictalso recurses, but differs in two ways that matter:redact_stringover non-credential strings, so non-secret values can change;redact_api_key(value[:4]...value[-4:]), where the canonical module uses a fixed-width placeholder.redact_nestedcould not reuseredact_dictforGET /api/llm/configbecause of both differences. That leaves one concept with two implementations and different masking, which is what #17336 set out to remove.Acceptance criteria
redact_dictcaller is listed with what it needs: does it rely on content-scanning non-credential strings, or on the partial reveal?redact_dictbecomes a thin composition overredact_nested(plusredact_textcontent scanning where a caller genuinely needs it), or is removed with zero-caller evidence, so one recursive mapping redactor remains.value[:4]...value[-4:]) is either justified per caller inREDACTION_BOUNDARY.mdor replaced by the fixed-width placeholder. Revealing 8 characters of a key is a disclosure, so this needs a stated reason.Related: #17336, #18193.