fix(policy): allow the Claude Code login host in the claude-code preset - #7680
Conversation
Claude Code exchanges its browser OAuth authorization code with platform.claude.com, which the preset never allowed, so the login the bundled skill documents first failed with "Socket is closed" while the sandbox logged "endpoint platform.claude.com:443 is not allowed by any policy". Allow GET and POST on /v1/oauth/** only; the live flow uses POST /v1/oauth/token, so the rest of the host stays closed. Fixes #7637 Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
The claude-code row said the preset allows "the OAuth paths on platform.claude.com", which understates the grant. Peer rows state their scope outright, so say that GET and POST are allowed on /v1/oauth/**. Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe Claude Code preset now permits scoped OAuth requests to ChangesClaude Code OAuth policy
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit 9686bb8 in the TypeScript / code-coverage/cliThe overall coverage in commit 9686bb8 in the Show a code coverage summary of the most impacted files.
Updated |
|
🌿 Preview your docs: https://nvidia-preview-pr-7680.docs.buildwithfern.com/nemoclaw |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Nemotron output stays in workflow artifacts and does not change the assessment above. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Summary
The bundled
claude-codenetwork-policy preset never allowedplatform.claude.com, the host Claude Code posts its browser OAuth authorization code to, so the login path the bundled skill documents first could not complete: the CLI reportedLogin failed: Socket is closedwhile the sandbox loggedendpoint platform.claude.com:443 is not allowed by any policy. The preset now allows GET and POST on/v1/oauth/**for that host, so a Pro/Max subscriber can finish the browser login with the preset as shipped.Related Issue
Fixes #7637
Changes
nemoclaw-blueprint/policies/presets/claude-code.yaml: add aplatform.claude.com:443endpoint withprotocol: restandenforcement: enforce, allowing GET and POST on/v1/oauth/**only. The reporter measured the live flow and observed onlyPOST /v1/oauth/token, so the rest of the host stays closed. Reword the presetdescription:, whichpolicy listrenders, to name the browser login.test/effective-policy-contracts.test.ts: extend the effective host list forclaude_code, and add a test that pins the new endpoint's port, protocol, enforcement, and its exact two OAuth rules so the scope cannot widen to/**unnoticed.test/helpers/vitest-watch-triggers.tsandtest/vitest-watch-triggers.test.ts: mapclaude-code.yamlto the contract test. The preset is YAML, so the import graph cannot see the dependency; the mapping is the concrete opaque-input case the helper exists for.docs/security/best-practices.mdx: update theclaude-codepreset row to name the browser login and state the allowed path scope.This adds no abstraction, configuration, fallback, migration, or compatibility path.
Type of Change
Quality Gates
npm run docsexits 0 andfern checkreports 0 errors, but it also reports 2 warnings that are present onmainand unrelated to this change, so the "builds without warnings" verification item below is left unchecked.Documentation Writer Review
docs-updateddocs/security/best-practices.mdx. The review found no blocking language findings and confirmeddocs/reference/network-policies.mdxneeds no change, because lines 178-180 enumerate no hosts, methods, or paths for this preset. It raised one wording nit: the risk cell described the grant more narrowly than the policy grants it, where peer rows such aspypiandtavilystate their scope outright. Commit 9686bb8 applies the reviewer's own proposed rewrite to that cell and is the only change after the reviewed commit 4d1f1bb.DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablenpx vitest run --project integration test/effective-policy-contracts.test.ts test/vitest-watch-triggers.test.ts— 2 files, 18 tests, all pass. Stashing the preset change alone and rerunning fails both Claude assertions, so the new coverage catches the reported defect.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Signed-off-by: Tinson Lai tinsonl@nvidia.com
Summary by CodeRabbit
Policy Updates
claude-codepreset to support browser login, telemetry, and crash-report access.platform.claude.comfor/v1/oauth/**authorization flows using GET and POST.Documentation