fix(policy): update HuggingFace endpoint and restrict Discord DELETE method#1540
Conversation
…method Two policy preset fixes: 1. HuggingFace (fixes NVIDIA#1453): - Replace deprecated api-inference.huggingface.co (returns HTTP 410) with router.huggingface.co (current Inference Providers API endpoint) 2. Discord (fixes NVIDIA#1433): - Remove overly broad DELETE on '/**' which allows deleting channels, roles, webhooks, and other resources an inference agent shouldn't touch - Scope DELETE to message/reaction paths only: /api/v*/channels/*/messages/* and /api/v*/channels/*/messages/*/reactions/* Signed-off-by: Benedikt Schackenberg <6381261+BenediktSchackenberg@users.noreply.github.com>
|
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 as they are similar to previous changes (1)
📝 WalkthroughWalkthroughDiscord preset now restricts DELETE to message- and reaction-specific endpoints; HuggingFace preset switches inference hostname from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 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.
Pull request overview
Updates two network policy presets to reflect upstream API changes and tighten default permissions.
Changes:
- Update Hugging Face inference endpoint from
api-inference.huggingface.cotorouter.huggingface.co. - Restrict Discord preset
DELETEpermissions from all paths to message/reaction-specific paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| nemoclaw-blueprint/policies/presets/huggingface.yaml | Switches Hugging Face inference host to the current router endpoint. |
| nemoclaw-blueprint/policies/presets/discord.yaml | Narrows Discord DELETE permissions to message/reaction routes instead of /**. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - allow: { method: DELETE, path: "/**" } | ||
| # DELETE only on message and reaction endpoints — not all paths | ||
| - allow: { method: DELETE, path: "/api/v*/channels/*/messages/*" } | ||
| - allow: { method: DELETE, path: "/api/v*/channels/*/messages/*/reactions/*" } |
There was a problem hiding this comment.
The reaction DELETE path pattern looks too narrow for Discord's reaction removal endpoints, which include an additional path segment (e.g., /reactions/{emoji}/@me or /reactions/{emoji}/{user_id}). With the current /reactions/* pattern, DELETE requests to remove a reaction will likely be blocked. Consider expanding the allowed path to include that trailing segment(s) while still keeping it scoped under the message reaction subtree.
| - allow: { method: DELETE, path: "/api/v*/channels/*/messages/*/reactions/*" } | |
| - allow: { method: DELETE, path: "/api/v*/channels/*/messages/*/reactions/*/*" } |
… segments
Discord reaction removal endpoints use the form:
DELETE /api/v*/channels/*/messages/*/reactions/{emoji}/@me
DELETE /api/v*/channels/*/messages/*/reactions/{emoji}/{user_id}
The previous /reactions/* only matched one segment after /reactions/,
which would block actual reaction DELETE calls. Changed to /reactions/*/*
to cover the emoji + target (self or user_id) segments.
Per Copilot review on NVIDIA#1540.
Signed-off-by: Benedikt Schackenberg <6381261+BenediktSchackenberg@users.noreply.github.com>
|
Fixed — changed |
|
✨ Thanks for submitting this fix, which proposes a way to update the HuggingFace endpoint and tighten Discord DELETE permissions in the network policy presets. Possibly related open issues: |
## Summary - Document `nemoclaw credentials list` and `nemoclaw credentials reset` commands in commands reference (#1597) - Add `--dry-run` flag documentation for `policy-add` (#1276) - Update policy presets table: remove `docker` (#1647), add `brave` and `brew`, update HuggingFace endpoint (#1540) - Document `NEMOCLAW_LOCAL_INFERENCE_TIMEOUT` env var for local providers (#1620) - Document `NEMOCLAW_PROXY_HOST`/`NEMOCLAW_PROXY_PORT` env vars (#1563) - Add troubleshooting entries for Docker group permissions (#1614), sandbox survival after gateway restart (#1587), and proxy configuration - Regenerate `nemoclaw-user-*` skills from updated docs ## Test plan - [x] `make docs` builds without warnings - [x] All pre-commit and pre-push hooks pass - [ ] Verify rendered pages in docs site preview 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added `nemoclaw credentials list` command to display stored credential names * Added `nemoclaw credentials reset <KEY>` command with `--yes` flag to remove credentials * Added `--dry-run` flag for policy-add to preview endpoint changes * New policy presets: `brave` and `brew` * New configuration options: `NEMOCLAW_LOCAL_INFERENCE_TIMEOUT`, `NEMOCLAW_PROXY_HOST`, and `NEMOCLAW_PROXY_PORT` * **Documentation** * Expanded troubleshooting guides for Docker permissions, sandbox connectivity, local inference timeouts, and proxy configuration <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two policy preset fixes in one PR.
1. HuggingFace endpoint update (fixes #1453)
The
api-inference.huggingface.coendpoint referenced inhuggingface.yamlnow returns HTTP 410 Gone — HuggingFace has migrated their Inference Providers API torouter.huggingface.co.Updated the preset to use the current endpoint.
2. Discord DELETE method restriction (fixes #1433)
The Discord preset allowed
DELETEon/**, which is broader than needed for an inference agent. This permits deleting channels, roles, webhooks, guild members, and other resources an agent should never touch.Scoped DELETE to message and reaction paths only:
DELETE /api/v*/channels/*/messages/*— delete own messagesDELETE /api/v*/channels/*/messages/*/reactions/*— remove reactionsSigned-off-by: Benedikt Schackenberg 6381261+BenediktSchackenberg@users.noreply.github.com
Summary by CodeRabbit