Conversation
`transcribe_audio` reads a local file and hands it to the configured STT provider — for the hosted providers (Groq, OpenAI, Mistral, xAI, ElevenLabs) that ships the file's bytes to a third-party API. The same local-input read guard was added to image-gen (587be5b) and xAI video-gen (1042329) to keep the agent from feeding credential/secret stores to a provider, but STT was missed. Call `get_read_block_error(file_path)` at the top of `transcribe_audio`, before validation/dispatch, so a `.env`, `auth.json`, `.anthropic_oauth.json`, `mcp-tokens/`, etc. is refused up front instead of being transcribed (and, for hosted providers, exfiltrated). This is defense-in-depth, not a security boundary — the guard's own message says so — but it restores parity with the image/video-gen tools. Regression test: a `.env` file is refused with the shared read-guard message before any provider dispatch (mutation-verified).
Duplicate of #57963 — both route local STT input paths in |
|
Merged into main via consolidated salvage PR #73514 (merge Your contribution is credited to you in git history. Thank you! Closing this PR as merged-via-salvage. |
What does this PR do?
transcribe_audioreads a local file and hands it to the configured STTprovider. For the hosted providers (Groq, OpenAI, Mistral, xAI, ElevenLabs)
that ships the file's raw bytes to a third-party API.
The shared local-input read guard (
agent.file_safety.get_read_block_error)was already added to image-gen (587be5b, "guard local provider inputs against
credential reads") and xAI video-gen (1042329), but the STT tools were
missed. So the agent can still feed a
.env,auth.json,.anthropic_oauth.json, or amcp-tokens/file to transcription and have itsplaintext leave the machine.
This routes
transcribe_audiothrough the same guard (before validation andprovider dispatch), refusing those paths up front. It is defense-in-depth,
not a security boundary — the guard's own message says so, and the terminal
tool can still reach the file — it just restores parity with the image/video-gen
tools.
Related Issue
N/A — no tracking issue. Parity follow-up to 587be5b (image-gen) and
1042329 (xai video-gen), which added the same guard to sibling tools.
Fixes #
Type of Change
Changes Made
tools/transcription_tools.py— callget_read_block_error(file_path)at thetop of
transcribe_audio, before audio validation / provider dispatch;return the guard's error dict when a read is blocked.
tests/tools/test_transcription_tools.py— addTestTranscribeCredentialReadGuard.How to Test
message, not
"Unsupported format"and not a provider error).Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/tools/test_transcription_tools.py -q→ 107 passed, 1 skippedDocumentation & Housekeeping
docs/, docstrings) — N/A (no doc-facing change)cli-config.yaml.exampleif I added/changed config keys — N/A (no config keys)CONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
Mutation check — without the guard, the same
.envinput instead reaches audiovalidation:
With the guard,
transcribe_audioreturns the read-guard message before anyprovider is contacted.