fix(dashboard): redact audio provider errors before HTTP replies - #37890
Open
coygeek wants to merge 1 commit into
Open
fix(dashboard): redact audio provider errors before HTTP replies#37890coygeek wants to merge 1 commit into
coygeek wants to merge 1 commit into
Conversation
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for addressing the direct provider-error relay. The result-dictionary changes target a real current-main disclosure path, but the patch is incomplete for its stated security boundary.
Problems
hermes_cli/web_server.py:3725still returns raw text from an exception asTranscription failed: {exc};hermes_cli/web_server.py:3866does the same for TTS. The PR diff only redacts the laterresult.get("error")branches, so provider errors that escape as exceptions remain client-visible.
Suggested changes
- Apply the same
redact_sensitive_text(..., force=True)helper to both outer exception details. - Add endpoint tests that mock each provider call to raise a credential-shaped exception and verify the HTTP 500 detail is redacted.
Automated hermes-sweeper review.
Redact provider-derived STT and TTS failure details before returning dashboard HTTP errors so synthetic credential-bearing provider messages cannot be relayed to clients. Add regression coverage for both audio transcription and speak endpoints using mocked provider failures.
coygeek
force-pushed
the
fix/dashboard-audio-endpoints-relay-unredacted-provider-errors
branch
from
July 21, 2026 02:58
3bbab72 to
a341d6a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An authenticated dashboard caller, or a caller on a non-loopback dashboard bind allowed by the operator, can trigger STT/TTS provider failures and receive unredacted provider error text in the JSON response body. If the upstream provider error includes the submitted API key or bearer material, Hermes sends that operator credential outside the agent process.
detailfield preserved the synthetic credential-bearing provider error.detailfield preserved the synthetic credential-bearing provider error.web_server.pyputsresult.get("error")directly intoHTTPException.detail.agent.redact.redact_sensitive_textto these audio error paths.Sanitize every provider-derived audio error string with
agent.redact.redact_sensitive_text(..., force=True)before constructing dashboardHTTPException.detail, including both success-dict failures and outer exception paths.Linked context
Closes #37889
Real behavior proof (required for external PRs)
Affected component (issue scope)
hermes-agent/hermes_cli/web_server.py:1130-1195hermes-agent/hermes_cli/web_server.py:1265-1295hermes-agent/tools/transcription_tools.py:1310-1311,1367-1368,1410-1412,1519,1605hermes-agent/tools/tts_tool.py:2142-2146hermes-agent/agent/redact.py:326-427Files changed in this PR
hermes_cli/web_server.pytests/hermes_cli/test_web_server.pyBehavior reproduced or verified
mainat source receipt commit2f0ee664670bb308c44ef969628a998c7e13cb86.tools.transcription_tools.transcribe_audioto return a failure dict whose error text contains a credential-shaped bearer token, then calltranscribe_audio_upload()with a valid base64 audio payload.400withdetailequal to the unredacted provider error.tools.tts_tool.text_to_speech_toolto return a failure JSON object whose error text contains a credential-shaped API key, then callspeak_text().400with unredacteddetail; expected result is redacted provider-error text before any dashboard response.Expected fixed behavior
Sanitize every provider-derived audio error string with
agent.redact.redact_sensitive_text(..., force=True)before constructing dashboardHTTPException.detail, including both success-dict failures and outer exception paths.Tests and validation
scripts/run_tests.sh -j 1 tests/hermes_cli/test_web_server.py -k 'redacts_provider' -q— 4 passed, 0 failed.scripts/run_tests.sh -j 1 tests/hermes_cli/test_web_server.py -q— 467 passed, 0 failed.Current branch status
mainat477c08b44766ace8b890faa72bf82ecbcf2b3ba8.a341d6a7575967ae58c3c183f240b1228dc2d309.Environment
Hermes latest-main source receipt:
2f0ee664670bb308c44ef969628a998c7e13cb86, detached local checkout. Reproduction used the upstream.venvand provider-free mocks, so no real secrets, provider transcripts, unrelated private paths, or private execution artifacts are included. Public route status: public issue plus linked review-ready PR throughpublic_security_full_disclosure; redaction checked.Source freshness receipt:
source_readyforupstream-mainat2f0ee664670bb308c44ef969628a998c7e13cb86via/tmp/hermes-source-receipt.json; affected paths exist in the prepared latest-main checkout.Risk checklist