From 904357d06ca73982caac656ca8370ae553087b16 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Mon, 19 Jan 2026 19:47:59 +0530 Subject: [PATCH] verify that deleted filepath is a rules file --- core/core.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/core.ts b/core/core.ts index e31eb5c2e..3d1b2cc3c 100644 --- a/core/core.ts +++ b/core/core.ts @@ -435,6 +435,12 @@ export class Core { on("config/deleteRule", async (msg) => { try { const filepath = msg.data.filepath; + if ( + !isColocatedRulesFile(filepath) && + !isContinueConfigRelatedUri(filepath) + ) { + throw new Error("Only rule files can be deleted"); + } const fileExists = await this.ide.fileExists(filepath); if (fileExists) { await this.ide.removeFile(filepath);