Skip to content

fix(security): scrub Hermes secrets from voice command subprocess env - #70342

Closed
zapabob wants to merge 1 commit into
NousResearch:mainfrom
zapabob:fix/tts-command-env-scrub
Closed

fix(security): scrub Hermes secrets from voice command subprocess env#70342
zapabob wants to merge 1 commit into
NousResearch:mainfrom
zapabob:fix/tts-command-env-scrub

Conversation

@zapabob

@zapabob zapabob commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Salvage of incomplete fix(voice): sanitize command provider subprocess env #56332 (fix(voice): sanitize command provider subprocess env by @necoweb3). That PR correctly routes command TTS/STT through hermes_subprocess_env, but it has not landed on upstream/main, and main currently only applies delegated_child_subprocess_env() (kanban lineage) — which still inherits full Hermes secrets when not in a delegated child.
  • This PR applies the secret scrub and preserves delegated-child lineage by composing delegated_child_subprocess_env(hermes_subprocess_env(...)).
  • Also closes a sibling path fix(voice): sanitize command provider subprocess env #56332 did not cover: _transcribe_local_command's subprocess.run (local whisper / HERMES_LOCAL_STT_COMMAND) previously inherited the full process environment.

Prior coverage vs remaining gap

Prior (#56332) This PR
Scrub command TTS/STT Popen env Same, plus keep kanban lineage markers
Scrub local-whisper subprocess.run env
Tests for Popen paths Tests for Popen + local-whisper sibling

Capability note

Command TTS/STT providers still run; only Hermes credentials and internal secrets are withheld from the child.

Test plan

  • pytest tests/tools/test_tts_command_providers.py::TestCommandTtsEnv
  • pytest tests/tools/test_transcription_tools.py::TestTranscribeLocalCommand::test_command_provider_uses_sanitized_child_env
  • pytest tests/tools/test_transcription_tools.py::TestTranscribeLocalCommand::test_local_whisper_subprocess_uses_sanitized_env

Salvage incomplete NousResearch#56332: route command TTS/STT through hermes_subprocess_env
while preserving delegated-child lineage, and close the sibling local-whisper
subprocess.run path that still inherited the full process environment.

Co-authored-by: Cursor <cursoragent@cursor.com>
@alt-glitch alt-glitch added type/security Security vulnerability or hardening tool/tts Text-to-speech and transcription area/auth Authentication, OAuth, credential pools P3 Low — cosmetic, nice to have sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data labels Jul 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to open #56332: this salvage preserves delegated-child lineage and adds the separate local-whisper subprocess path, so it is not a duplicate.

teknium1 pushed a commit that referenced this pull request Jul 28, 2026
## Summary
- Spawn system audio players (`ffplay` / `afplay` / `aplay`) with `hermes_subprocess_env(inherit_credentials=False)`.
- Prevent gateway tokens and provider API keys from leaking into OS media helpers.
- Add a regression test asserting scrubbed env on `Popen`.

## Salvage / credit
Sibling of #70342 / incomplete #56332 (TTS/STT command scrub) on the voice-mode playback path.
teknium1 added a commit that referenced this pull request Jul 28, 2026
Command providers legitimately reference their own API keys in shell
templates (curl one-liners). The #70342 scrub removes ALL provider keys,
which would break such setups. Add a per-provider env_passthrough list
(TTS + STT) that copies named variables back from the parent env, plus
docs and tests. Scrub stays the default; passthrough is explicit opt-in.
teknium1 pushed a commit that referenced this pull request Jul 28, 2026
## Summary
- Spawn system audio players (`ffplay` / `afplay` / `aplay`) with `hermes_subprocess_env(inherit_credentials=False)`.
- Prevent gateway tokens and provider API keys from leaking into OS media helpers.
- Add a regression test asserting scrubbed env on `Popen`.

## Salvage / credit
Sibling of #70342 / incomplete #56332 (TTS/STT command scrub) on the voice-mode playback path.
teknium1 added a commit that referenced this pull request Jul 28, 2026
Command providers legitimately reference their own API keys in shell
templates (curl one-liners). The #70342 scrub removes ALL provider keys,
which would break such setups. Add a per-provider env_passthrough list
(TTS + STT) that copies named variables back from the parent env, plus
docs and tests. Scrub stays the default; passthrough is explicit opt-in.
teknium1 pushed a commit that referenced this pull request Jul 28, 2026
## Summary
- Spawn system audio players (`ffplay` / `afplay` / `aplay`) with `hermes_subprocess_env(inherit_credentials=False)`.
- Prevent gateway tokens and provider API keys from leaking into OS media helpers.
- Add a regression test asserting scrubbed env on `Popen`.

## Salvage / credit
Sibling of #70342 / incomplete #56332 (TTS/STT command scrub) on the voice-mode playback path.
teknium1 added a commit that referenced this pull request Jul 28, 2026
Command providers legitimately reference their own API keys in shell
templates (curl one-liners). The #70342 scrub removes ALL provider keys,
which would break such setups. Add a per-provider env_passthrough list
(TTS + STT) that copies named variables back from the parent env, plus
docs and tests. Scrub stays the default; passthrough is explicit opt-in.
teknium1 pushed a commit that referenced this pull request Jul 29, 2026
## Summary
- Spawn system audio players (`ffplay` / `afplay` / `aplay`) with `hermes_subprocess_env(inherit_credentials=False)`.
- Prevent gateway tokens and provider API keys from leaking into OS media helpers.
- Add a regression test asserting scrubbed env on `Popen`.

## Salvage / credit
Sibling of #70342 / incomplete #56332 (TTS/STT command scrub) on the voice-mode playback path.
teknium1 added a commit that referenced this pull request Jul 29, 2026
Command providers legitimately reference their own API keys in shell
templates (curl one-liners). The #70342 scrub removes ALL provider keys,
which would break such setups. Add a per-provider env_passthrough list
(TTS + STT) that copies named variables back from the parent env, plus
docs and tests. Scrub stays the default; passthrough is explicit opt-in.
teknium1 pushed a commit that referenced this pull request Jul 29, 2026
## Summary
- Spawn system audio players (`ffplay` / `afplay` / `aplay`) with `hermes_subprocess_env(inherit_credentials=False)`.
- Prevent gateway tokens and provider API keys from leaking into OS media helpers.
- Add a regression test asserting scrubbed env on `Popen`.

## Salvage / credit
Sibling of #70342 / incomplete #56332 (TTS/STT command scrub) on the voice-mode playback path.
teknium1 added a commit that referenced this pull request Jul 29, 2026
Command providers legitimately reference their own API keys in shell
templates (curl one-liners). The #70342 scrub removes ALL provider keys,
which would break such setups. Add a per-provider env_passthrough list
(TTS + STT) that copies named variables back from the parent env, plus
docs and tests. Scrub stays the default; passthrough is explicit opt-in.
@teknium1

Copy link
Copy Markdown
Contributor

Merged into main via consolidated salvage PR #73514 (merge e807b7106c). Your voice-subprocess secret scrub via hermes_subprocess_env(inherit_credentials=False) was cherry-picked with your authorship, composed with the delegated-child env and an explicit env_passthrough opt-in.

Your contribution is credited to you in git history. Thank you! Closing this PR as merged-via-salvage.

@teknium1 teknium1 closed this Jul 29, 2026
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
## Summary
- Spawn system audio players (`ffplay` / `afplay` / `aplay`) with `hermes_subprocess_env(inherit_credentials=False)`.
- Prevent gateway tokens and provider API keys from leaking into OS media helpers.
- Add a regression test asserting scrubbed env on `Popen`.

## Salvage / credit
Sibling of NousResearch#70342 / incomplete NousResearch#56332 (TTS/STT command scrub) on the voice-mode playback path.
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
Command providers legitimately reference their own API keys in shell
templates (curl one-liners). The NousResearch#70342 scrub removes ALL provider keys,
which would break such setups. Add a per-provider env_passthrough list
(TTS + STT) that copies named variables back from the parent env, plus
docs and tests. Scrub stays the default; passthrough is explicit opt-in.
zapabob added a commit to zapabob/hermes-agent-windows that referenced this pull request Aug 23, 2026
## Summary
- Remove `env.update(os.environ)` after `hermes_subprocess_env(...)` in the TUI compute-host supervisor.
- That re-merge re-injected gateway tokens / API keys into the child process and undid scrubbing.
- Add a spawn-path regression test asserting messaging tokens stay absent.

## Salvage / credit
Sibling of voice/TTS credential scrub (NousResearch#70342 / incomplete NousResearch#56332) on the TUI host spawn surface.
prmartinow pushed a commit to prmartinow/hermes-agent that referenced this pull request Aug 26, 2026
## Summary
- Spawn system audio players (`ffplay` / `afplay` / `aplay`) with `hermes_subprocess_env(inherit_credentials=False)`.
- Prevent gateway tokens and provider API keys from leaking into OS media helpers.
- Add a regression test asserting scrubbed env on `Popen`.

## Salvage / credit
Sibling of NousResearch#70342 / incomplete NousResearch#56332 (TTS/STT command scrub) on the voice-mode playback path.
prmartinow pushed a commit to prmartinow/hermes-agent that referenced this pull request Aug 26, 2026
Command providers legitimately reference their own API keys in shell
templates (curl one-liners). The NousResearch#70342 scrub removes ALL provider keys,
which would break such setups. Add a per-provider env_passthrough list
(TTS + STT) that copies named variables back from the parent env, plus
docs and tests. Scrub stays the default; passthrough is explicit opt-in.
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
## Summary
- Spawn system audio players (`ffplay` / `afplay` / `aplay`) with `hermes_subprocess_env(inherit_credentials=False)`.
- Prevent gateway tokens and provider API keys from leaking into OS media helpers.
- Add a regression test asserting scrubbed env on `Popen`.

## Salvage / credit
Sibling of NousResearch#70342 / incomplete NousResearch#56332 (TTS/STT command scrub) on the voice-mode playback path.
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
Command providers legitimately reference their own API keys in shell
templates (curl one-liners). The NousResearch#70342 scrub removes ALL provider keys,
which would break such setups. Add a per-provider env_passthrough list
(TTS + STT) that copies named variables back from the parent env, plus
docs and tests. Scrub stays the default; passthrough is explicit opt-in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools P3 Low — cosmetic, nice to have sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data tool/tts Text-to-speech and transcription type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants