fix(gateway): redact secrets in background process completion output

_output passes through redact_terminal_output (force=False) but
not _redact_gateway_user_facing_secrets (force=True). When
security.redact_secrets is disabled or the command is not an
env-dump, the output can leak credentials (Authorization: Bearer,
PGPASSWORD=, etc.) into the session transcript and chat platforms.

Add the same redaction gate applied to _command so both paths
are protected by force=True + _GATEWAY_SECRET_PATTERNS.
This commit is contained in:
handnewb 2026-07-28 14:13:34 -03:00 committed by Teknium
parent 668396c2e1
commit c0d204810d
1 changed files with 1 additions and 0 deletions

View File

@ -24097,6 +24097,7 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew
_out = f"[… output truncated — showing last {len(_tail)} chars]\n{_tail}"
else:
_out = _raw
_out = _redact_gateway_user_facing_secrets(_out)
completion_evt = {
"type": "completion",
"session_id": session_id,