[GH-ISSUE #4316] [Feature]: Add scoped active-card context to Browser Extensions #2337

Closed
opened 2026-10-21 05:47:25 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Jul 30, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4316

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

Browser Personal Extensions can keep only global state because the safe sandbox no longer exposes active chat or Character identifiers. Some extensions also have legitimate reasons to read the active Character card or Persona, but granting every extension ambient access to those records would unnecessarily expose private local data.

Proposed solution

Add a capability-restricted Browser Extension context API:

  • expose opaque active chat and Character IDs to Browser Extensions;
  • add separate read_active_characters and read_active_persona declarations;
  • bind requested capabilities to the extension exact approved hash;
  • show the requested permissions during review;
  • expose only bounded, read-only snapshots of records belonging to the active chat;
  • keep messages, the full Character and Persona libraries, metadata outside the selected fields, DOM, network, database, and mutation access unavailable.

Alternatives considered

Restoring the legacy DOM or same-origin API surface was rejected because it would let extensions bypass data scoping. Giving every extension full card and Persona data was rejected because most extensions need only stable IDs.

Additional context

The immediate use case is a Notepad extension that needs per-chat tabs. Card and Persona access should remain optional for extensions that explicitly declare those needs.

Owner: @SpicyMarinara

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Jul 30, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4316 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? Browser Personal Extensions can keep only global state because the safe sandbox no longer exposes active chat or Character identifiers. Some extensions also have legitimate reasons to read the active Character card or Persona, but granting every extension ambient access to those records would unnecessarily expose private local data. ## Proposed solution Add a capability-restricted Browser Extension context API: - expose opaque active chat and Character IDs to Browser Extensions; - add separate `read_active_characters` and `read_active_persona` declarations; - bind requested capabilities to the extension exact approved hash; - show the requested permissions during review; - expose only bounded, read-only snapshots of records belonging to the active chat; - keep messages, the full Character and Persona libraries, metadata outside the selected fields, DOM, network, database, and mutation access unavailable. ## Alternatives considered Restoring the legacy DOM or same-origin API surface was rejected because it would let extensions bypass data scoping. Giving every extension full card and Persona data was rejected because most extensions need only stable IDs. ## Additional context The immediate use case is a Notepad extension that needs per-chat tabs. Card and Persona access should remain optional for extensions that explicitly declare those needs. Owner: @SpicyMarinara ## Template check - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 30, 2026):

Implemented and merged into staging via #4317.

<!-- gh-comment-id:5137151886 --> @SpicyMarinara commented on GitHub (Jul 30, 2026): Implemented and merged into `staging` via #4317.
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#2337
No description provided.