[PR #5352] [MERGED] fix(security): preserve Claude subscription isolation #6736

Closed
opened 2026-10-23 04:13:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5352
Author: @SpicyMarinara
Created: 8/21/2026
Status: ✅ Merged
Merged: 8/21/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/5351-claude-subscription-isolation


📝 Commits (2)

  • 1a1b8cb test(security): cover Claude SDK option isolation
  • 3aa0178 fix(security): preserve Claude subscription isolation

📊 Changes

3 files changed (+85 additions, -21 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/server/src/services/llm/providers/claude-subscription.provider.ts (+32 -21)
📝 scripts/regressions/provider-compat.regression.ts (+52 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository staging branch or a same-repository hotfix branch to main.

Linked issue

Closes #5351

Why this change

Claude Subscription is documented and implemented as a text-only provider, but raw Custom Parameters reached Agent SDK options after the provider set its isolation controls. Execution-capable values could therefore replace the intended zero-tool boundary.

What changed

  • Apply Claude Subscription Custom Parameters through a small generation-only SDK option allowlist.
  • Keep process, tool, MCP, environment, filesystem, prompt, settings, and session controls provider-owned.
  • Preserve supported model, fallback, thinking/effort, budget, beta, and structured-output overrides.
  • Add a provider-boundary regression and an Unreleased changelog entry.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Automated evidence

  • pnpm check: passed
  • Provider compatibility regression: passed
  • Security regression filter: 12 of 12 passed
  • Custom-tool isolation: passed
  • Professor Mari shell sandbox: passed with macOS Seatbelt
  • Runtime integrity: passed
  • Capability package lifecycle: passed
  • pnpm audit at low threshold: no known vulnerabilities
  • Full Node lane: 128 of 139 passed; remaining staging/environment failures include tests that correctly refused the live server writer lease and unrelated stale source assertions.

Manual verification notes

  • Manually verify a Claude Subscription connection generates successfully with benign model-generation Custom Parameters.
  • Manually verify imported local-model connections continue receiving their existing Custom Parameters. This patch does not touch OpenAI-compatible local providers.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a docs-i18n follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

CHANGELOG.md is updated. No user documentation or version-bearing files changed.

UI evidence (if applicable)

No UI changes.

Summary by CodeRabbit

  • Bug Fixes
    • Strengthened Claude Subscription settings so provider-managed session, filesystem, tool, environment, and process options can’t be overridden by custom parameters.
    • Continued supporting approved model-generation options, including fallback and budget settings.
    • Preserved caller-provided system prompts while restricting unsafe tool, skill, permission, environment, and turn-limit settings.
  • Documentation
    • Added an Unreleased changelog entry describing the updated customization behavior.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/5352 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/21/2026 **Status:** ✅ Merged **Merged:** 8/21/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/5351-claude-subscription-isolation` --- ### 📝 Commits (2) - [`1a1b8cb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1a1b8cb414346edf43f6dec588b36548f1b7a471) test(security): cover Claude SDK option isolation - [`3aa0178`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3aa01787e0005b0680231ec127b21eb02ea6d38d) fix(security): preserve Claude subscription isolation ### 📊 Changes **3 files changed** (+85 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/server/src/services/llm/providers/claude-subscription.provider.ts` (+32 -21) 📝 `scripts/regressions/provider-compat.regression.ts` (+52 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target staging. Only SpicyMarinara may promote this repository staging branch or a same-repository hotfix branch to main. ## Linked issue Closes #5351 ## Why this change Claude Subscription is documented and implemented as a text-only provider, but raw Custom Parameters reached Agent SDK options after the provider set its isolation controls. Execution-capable values could therefore replace the intended zero-tool boundary. ## What changed - Apply Claude Subscription Custom Parameters through a small generation-only SDK option allowlist. - Keep process, tool, MCP, environment, filesystem, prompt, settings, and session controls provider-owned. - Preserve supported model, fallback, thinking/effort, budget, beta, and structured-output overrides. - Add a provider-boundary regression and an Unreleased changelog entry. ## Validation - [ ] pnpm check passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed CONTRIBUTING.md ### Automated evidence - pnpm check: passed - Provider compatibility regression: passed - Security regression filter: 12 of 12 passed - Custom-tool isolation: passed - Professor Mari shell sandbox: passed with macOS Seatbelt - Runtime integrity: passed - Capability package lifecycle: passed - pnpm audit at low threshold: no known vulnerabilities - Full Node lane: 128 of 139 passed; remaining staging/environment failures include tests that correctly refused the live server writer lease and unrelated stale source assertions. ### Manual verification notes - Manually verify a Claude Subscription connection generates successfully with benign model-generation Custom Parameters. - Manually verify imported local-model connections continue receiving their existing Custom Parameters. This patch does not touch OpenAI-compatible local providers. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the docs-i18n branch updated to match, or a docs-i18n follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) CHANGELOG.md is updated. No user documentation or version-bearing files changed. ## UI evidence (if applicable) No UI changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Strengthened Claude Subscription settings so provider-managed session, filesystem, tool, environment, and process options can’t be overridden by custom parameters. * Continued supporting approved model-generation options, including fallback and budget settings. * Preserved caller-provided system prompts while restricting unsafe tool, skill, permission, environment, and turn-limit settings. * **Documentation** * Added an Unreleased changelog entry describing the updated customization behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:13:13 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6736
No description provided.