fix(policy): allow Telegram file downloads in default sandbox policy#1302
fix(policy): allow Telegram file downloads in default sandbox policy#1302latenighthackathon wants to merge 3 commits intoNVIDIA:mainfrom
Conversation
The Telegram Bot API serves file downloads at /file/bot<token>/<path> but the default policy only allows /bot*/**. Add GET /file/bot*/** so the sandbox can download incoming audio, voice, document, photo, and video attachments from users. Reported by @after-ephemera in NVIDIA Developer Discord. Closes NVIDIA#1301
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdded a network policy rule allowing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
nemoclaw-blueprint/policies/openclaw-sandbox.yaml (1)
186-188: LGTM — rule correctly enables Telegram file downloads.The glob pattern
/file/bot*/**accurately matches Telegram's file download endpoint structure (/file/bot<token>/<file_path>), and restricting toGETis appropriate for read-only file retrieval.Note: The preset policy at
nemoclaw-blueprint/policies/presets/telegram.yamlonly defines rules for/bot*/**and does not include this/file/bot*/**rule. Consider updating the preset as well for consistency, so users who apply the Telegram preset also get file download support.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nemoclaw-blueprint/policies/openclaw-sandbox.yaml` around lines 186 - 188, The preset policy for Telegram (telegram.yaml) is missing the file-download rule present in openclaw-sandbox.yaml; add an allow rule for GET with the path pattern /file/bot*/** to the telegram.yaml preset so the preset matches the sandbox behavior and enables Telegram file downloads for users applying the preset.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@nemoclaw-blueprint/policies/openclaw-sandbox.yaml`:
- Around line 186-188: The preset policy for Telegram (telegram.yaml) is missing
the file-download rule present in openclaw-sandbox.yaml; add an allow rule for
GET with the path pattern /file/bot*/** to the telegram.yaml preset so the
preset matches the sandbox behavior and enables Telegram file downloads for
users applying the preset.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3afeddfa-8752-408f-9071-2db30bcc3b7b
📒 Files selected for processing (1)
nemoclaw-blueprint/policies/openclaw-sandbox.yaml
Apply the same /file/bot*/** GET rule to the Telegram preset so users who apply the preset also get file download support.
Summary
GET /file/bot*/**rule to the Telegram endpoint in the default sandbox policyRelated Issue
Closes #1301
Changes
The Telegram Bot API uses two path patterns:
/bot<token>/getFile,/bot<token>/sendMessage— covered by existing/bot*/**rules/file/bot<token>/<file_path>— not coveredWhen a user sends an audio message, photo, document, or video to the bot, OpenClaw calls
getFile(works) then downloads the file from/file/bot<token>/<path>(blocked with 403).Validated with OPA's
glob.match:glob.match("/bot*/**", ["/"], "/file/bot123:ABC/voice/file.oga")→ false (current — blocked)glob.match("/file/bot*/**", ["/"], "/file/bot123:ABC/voice/file.oga")→ true (fix — allowed)Credit
Reported by @after-ephemera in the NVIDIA Developer Discord community.
Testing
/bot*/**unchanged)Checklist
Summary by CodeRabbit