Skip to content

fix(gateway): PII redaction config never read — missing yaml import - #1701

Merged
teknium1 merged 1 commit into
mainfrom
fix/gateway-yaml-pii-redaction
Mar 17, 2026
Merged

fix(gateway): PII redaction config never read — missing yaml import#1701
teknium1 merged 1 commit into
mainfrom
fix/gateway-yaml-pii-redaction

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

The privacy.redact_pii config reader in gateway/run.py line 1546 used bare yaml.safe_load(), but yaml is not in scope at that point — the module-level import is import yaml as _yaml (line 93), and other methods use local import yaml as _y.

The NameError was silently caught by the try/except Exception: pass block, so _redact_pii always defaulted to False. Users who configured privacy.redact_pii: true got no PII redaction in the gateway.

What changed

  • gateway/run.py: Added local import yaml as _pii_yaml before the safe_load call, consistent with the aliased-import pattern used throughout the file.

Test plan

  • Set privacy.redact_pii: true in config.yaml
  • Send a message via gateway containing PII
  • Verify redaction is applied (previously: always skipped)

The privacy.redact_pii config reader on line 1546 used bare 'yaml'
which is not in scope — yaml is imported as '_yaml' at module level
(line 93) and as '_y' in other methods. The NameError was silently
caught by the try/except, so PII redaction never activated even when
configured.

Add a local 'import yaml as _pii_yaml' consistent with the pattern
used elsewhere in the file.
@teknium1
teknium1 merged commit 1781c05 into main Mar 17, 2026
1 check failed
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…ml-pii-redaction

fix(gateway): PII redaction config never read — missing yaml import
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…ml-pii-redaction

fix(gateway): PII redaction config never read — missing yaml import
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…ml-pii-redaction

fix(gateway): PII redaction config never read — missing yaml import
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…ml-pii-redaction

fix(gateway): PII redaction config never read — missing yaml import
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
…ml-pii-redaction

fix(gateway): PII redaction config never read — missing yaml import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant