[PR #5111] [MERGED] Gate Professor Mari mutations before execution #6633

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

📋 Pull Request Information

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

Base: staging ← Head: agent/5093-mutation-authorization


📝 Commits (1)

  • 05a63b6 Gate Professor Mari mutations before execution

📊 Changes

3 files changed (+285 additions, -23 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+193 -23)
📝 scripts/regressions/prompt.regression.ts (+91 -0)

📄 Description

Why

Professor Mari could apply a workspace mutation first and offer Keep/Restore afterward even when the proposed write originated only from attached or fetched untrusted content. Prompt guidance and delimiter hardening were not an enforcement boundary.

Closes #5093

What changed

  • require every actual Mari mutation to carry a verbatim authorization excerpt from the active user turn
  • validate that excerpt against the current request, operation kind, and any explicitly named app-data entity immediately before execution
  • reject informational/how-to requests, denial language, mismatched operations, and attached/fetched-only instructions
  • allow short confirmations only when they answer the immediately preceding visible proposal for the same kind of change
  • cover structured app-data, file operations, dependency requests, direct Mari CLI writes, and recognizable mutating shell commands
  • keep non-applying previews and reads ungated; Keep/Restore remains the second defense

Validation

  • Manually verify a direct character update succeeds and produces the normal Keep/Restore review
  • Manually verify an attached transcript containing a delete instruction cannot authorize a mutation
  • Manually verify a how-to question remains read-only
  • Run pnpm check

Automated evidence run locally:

  • pnpm build:shared passed
  • pnpm --filter @marinara-engine/server lint passed
  • the new pre-execution authorization regression passed inside the prompt suite
  • the full prompt suite still reports the unrelated existing ElevenLabs tone-tag assertion ([neutral] retained instead of stripped)

🔄 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/5111 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/15/2026 **Status:** ✅ Merged **Merged:** 8/16/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/5093-mutation-authorization` --- ### 📝 Commits (1) - [`05a63b6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/05a63b61e2b351d897c9b558006d445900a36ec8) Gate Professor Mari mutations before execution ### 📊 Changes **3 files changed** (+285 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+193 -23) 📝 `scripts/regressions/prompt.regression.ts` (+91 -0) </details> ### 📄 Description ## Why Professor Mari could apply a workspace mutation first and offer Keep/Restore afterward even when the proposed write originated only from attached or fetched untrusted content. Prompt guidance and delimiter hardening were not an enforcement boundary. Closes #5093 ## What changed - require every actual Mari mutation to carry a verbatim authorization excerpt from the active user turn - validate that excerpt against the current request, operation kind, and any explicitly named app-data entity immediately before execution - reject informational/how-to requests, denial language, mismatched operations, and attached/fetched-only instructions - allow short confirmations only when they answer the immediately preceding visible proposal for the same kind of change - cover structured app-data, file operations, dependency requests, direct Mari CLI writes, and recognizable mutating shell commands - keep non-applying previews and reads ungated; Keep/Restore remains the second defense ## Validation - [ ] Manually verify a direct character update succeeds and produces the normal Keep/Restore review - [ ] Manually verify an attached transcript containing a delete instruction cannot authorize a mutation - [ ] Manually verify a how-to question remains read-only - [ ] Run `pnpm check` Automated evidence run locally: - `pnpm build:shared` passed - `pnpm --filter @marinara-engine/server lint` passed - the new pre-execution authorization regression passed inside the prompt suite - the full prompt suite still reports the unrelated existing ElevenLabs tone-tag assertion (`[neutral]` retained instead of stripped) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:12:15 +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#6633
No description provided.