Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: require operator authority for external mail archive and delete actions (#11434)

[._.]/ Adam Eivy101b662c493e
diff --git a/server/lib/hostControlRoutes.js b/server/lib/hostControlRoutes.js
index b7d308e216..ae4e20690b 100644
--- a/server/lib/hostControlRoutes.js
+++ b/server/lib/hostControlRoutes.js
@@ -204,6 +204,8 @@ export const HOST_CONTROL_ROUTES = Object.freeze([
// Gmail enable helper navigates it to Google Cloud Console (#11433).
'POST /api/messages/launch/:accountId',
'POST /api/messages/gmail/enable-api',
+ // Archive and delete act on mail items in the external account (#11434).
+ 'POST /api/messages/:accountId/:messageId/action',
// Capture activation and existing live feeds require operator authority (#11272).
// HEAD inherits the GET policy because Express invokes the same handler.
diff --git a/server/lib/hostControlRoutes.test.js b/server/lib/hostControlRoutes.test.js
index 8de4b9eafb..5830c0b509 100644
--- a/server/lib/hostControlRoutes.test.js
+++ b/server/lib/hostControlRoutes.test.js
@@ -168,6 +168,15 @@ describe('outbound mail host-control policy (#11273)', () => {
expect(isHostControlRoute('POST', '/api/messages/drafts')).toBe(false);
expect(isHostControlRoute('POST', '/api/messages/drafts/33333333-3333-3333-3333-333333333333/approve')).toBe(false);
});
+
+ it('gates external archive/delete actions while keeping message reads open (#11434)', () => {
+ const route = 'POST /api/messages/:accountId/:messageId/action';
+ const mounted = new Set(getApiRouteCatalog().routes.map(({ method, path }) => method + ' ' + path));
+ expect(mounted.has(route)).toBe(true);
+ expect(hostControlRouteFor('POST', '/api/messages/acct-1/msg-1/action')).toBe(route);
+ expect(isHostControlRoute('GET', '/api/messages/acct-1/msg-1')).toBe(false);
+ expect(isHostControlRoute('POST', '/api/messages/acct-1/msg-1/read')).toBe(false);
+ });
});
describe('X (Twitter) review and browser automation policy', () => {