Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Native skill switch: deny switched-off skills on Claude turns too (#5259)

milind-soni5ae8e01f7ff0
diff --git a/server/drivers/claude-unusable-tools.ts b/server/drivers/claude-unusable-tools.ts
index f93e19b27b..6be0343a1b 100644
--- a/server/drivers/claude-unusable-tools.ts
+++ b/server/drivers/claude-unusable-tools.ts
@@ -1,3 +1,5 @@
+import { disabledNativeSkillNames } from "../native-skill-choices.ts";
+
// Built-in Claude Code tools that work only in Claude Code's own terminal or app, yet ride every model call of a bot turn at
// about 4,900 tokens: Workflow runs in the background, which a turn turns off, and needs a person opting in at /workflows;
// ScheduleWakeup paces a /loop, where a bot has wait_until; ReportFindings draws in a host UI there is none of; ListAgents
@@ -8,3 +10,8 @@ export const BUILT_INS_NO_BOT_CAN_USE = ["Workflow", "ScheduleWakeup", "ReportFi
export function unusableBuiltIns(turn: { isolated: boolean; listsTools: boolean; guest: boolean }): readonly string[] {
return turn.isolated && !turn.listsTools && !turn.guest ? BUILT_INS_NO_BOT_CAN_USE : [];
}
+
+/** A deny rule per native skill this bot switched off: Claude Code then refuses that skill both as a tool call and as a typed /name. */
+export function claudeDisabledNativeSkillRules(botId: string | undefined): string[] {
+ return botId ? disabledNativeSkillNames(botId).map((name) => `Skill(${name})`) : [];
+}
diff --git a/server/drivers/claude.test.ts b/server/drivers/claude.test.ts
index 1ae6b24b1a..609c2c3c58 100644
--- a/server/drivers/claude.test.ts
+++ b/server/drivers/claude.test.ts
@@ -2426,6 +2426,29 @@ describe("ClaudeDriver turns (fake CLI)", () => {
expect(JSON.parse(readFileSync(inherited, "utf8")).argv).not.toContain("--disallowedTools");
});
+ it("denies the native skills this bot switched off, and only for that bot", async () => {
+ const { setNativeSkillEnabled } = await import("../native-skill-choices.ts");
+ setNativeSkillEnabled("bot-skills-off", "pdf", false);
+ setNativeSkillEnabled("bot-skills-off", "hatch-pet", false);
+ try {
+ const dump = join(scratch, "skills-off.json");
+ await create(undefined, { FAKE_CLAUDE_DUMP: dump, OMB_CLAUDE_INHERIT_USER_CONFIG: "1" });
+ await instance.adapter.sendTurn({ threadId: "t-skills-off", botId: "bot-skills-off", text: "hi" });
+ await recorder.until((event) => event.type === "turn.completed");
+ const seen = JSON.parse(readFileSync(dump, "utf8"));
+ expect(seen.argv[seen.argv.indexOf("--disallowedTools") + 1].split(",")).toEqual(["Skill(hatch-pet)", "Skill(pdf)"]);
+
+ const other = join(scratch, "skills-other.json");
+ await create(undefined, { FAKE_CLAUDE_DUMP: other, OMB_CLAUDE_INHERIT_USER_CONFIG: "1" });
+ await instance.adapter.sendTurn({ threadId: "t-skills-other", botId: "bot-skills-on", text: "hi" });
+ await recorder.until((event) => event.type === "turn.completed");
+ expect(JSON.parse(readFileSync(other, "utf8")).argv).not.toContain("--disallowedTools");
+ } finally {
+ setNativeSkillEnabled("bot-skills-off", "pdf", true);
+ setNativeSkillEnabled("bot-skills-off", "hatch-pet", true);
+ }
+ });
+
it("passes an explicit empty available set to disable every Claude built-in", async () => {
await create(undefined, {}, { tools: [], disallowedTools: [] });
const dump = join(scratch, "no-builtins.json");
diff --git a/server/drivers/claude.ts b/server/drivers/claude.ts
index 84637b794c..fc8d808fbd 100644
--- a/server/drivers/claude.ts
+++ b/server/drivers/claude.ts
@@ -18,7 +18,7 @@ import { botSettingsFor, withBotSettings } from "./claude-bot-settings.ts";
import { claudeBilling, claudeCallUsage } from "./claude-billing.ts";
import { claudeAuthFailure, claudeAuthRecovery } from "./claude-auth-recovery.ts";
import { CLAUDE_MODEL_ID, STATIC_CLAUDE_MODELS, claudeModelExtras, endpointModelCatalog } from "./claude-model-extras.ts";
-import { claudeToolSearchSetting } from "./claude-tool-search.ts"; import { unusableBuiltIns } from "./claude-unusable-tools.ts"; import { EMAIL_READ_TOOL_NAMES } from "../../shared/email.ts";
+import { claudeToolSearchSetting } from "./claude-tool-search.ts"; import { claudeDisabledNativeSkillRules, unusableBuiltIns } from "./claude-unusable-tools.ts"; import { EMAIL_READ_TOOL_NAMES } from "../../shared/email.ts";
import { claudeElicitations } from "./claude-elicitation.ts";
import { readCostHistory, recordCostState } from "./claude-cost-history.ts";
import { classifyResumeFailure, mayReplay, rebuiltSessionNotice, recoveryPromptFor } from "../resume-recovery.ts";
@@ -1024,7 +1024,7 @@ export const ClaudeDriver: ProviderDriver<ClaudeConfig> = {
const replaysUserMessages = cliVersion === null || versionAtLeast(cliVersion, CLAUDE_REPLAY_FLOOR);
if (replaysUserMessages) args.push("--replay-user-messages");
const isolated = !inheritsUserConfig(turnEnvironment);
- const disallowed = [...(config.disallowedTools ?? []), ...unusableBuiltIns({ isolated, listsTools: config.tools !== undefined, guest: Boolean(turn.guestConfined) })];
+ const disallowed = [...(config.disallowedTools ?? []), ...unusableBuiltIns({ isolated, listsTools: config.tools !== undefined, guest: Boolean(turn.guestConfined) }), ...claudeDisabledNativeSkillRules(botId)];
if (disallowed.length) args.push("--disallowedTools", disallowed.join(","));
if (turn.toolScope !== undefined && (!isolated || turn.mcpFromUserConfig || cliVersion === null || !claudeCliSupports(cliVersion, "--strict-mcp-config"))) {
throw new Error("Claude cannot confirm a restricted MCP configuration for this account. Disable inherited Claude MCP servers and use a current, identifiable Claude CLI before using tool selection.");
diff --git a/server/drivers/codex-guest.ts b/server/drivers/codex-guest.ts
index c0bb14cc56..fe12e703b2 100644
--- a/server/drivers/codex-guest.ts
+++ b/server/drivers/codex-guest.ts
@@ -16,7 +16,8 @@ export function codexShellDisabled(config: unknown): boolean {
return features?.shell_tool === false && features?.unified_exec === false && features?.view_image === false;
}
-/** `-c skills.config=[…]` so Codex skips native skills this bot switched off, without touching ~/.codex/skills. */
+/** `-c skills.config=[…]` so Codex skips native skills this bot switched off, without touching ~/.codex/skills.
+ * It replaces any skills.config in ~/.codex/config.toml for that turn; the Skills page hint says so. */
export function codexDisabledNativeSkillArgs(botId: string | undefined): string[] {
const names = disabledNativeSkillNames(botId ?? "");
if (!names.length) return [];
diff --git a/src/locales/en.json b/src/locales/en.json
index d32b356d0d..d2684a2cd3 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -6056,7 +6056,7 @@
"skills.origin.imported": "this computer",
"skills.origin.importedHint": "Brought in from this computer. Each bot lists the ones that fit its role and finds the rest when a task needs them. Switch it on to list it for this bot, or off to keep it from this bot.",
"skills.origin.native": "AI",
- "skills.origin.nativeHint": "The bot's AI loads this from the folder under Source. Turn it off here for this bot only; the files stay where they are.",
+ "skills.origin.nativeHint": "The bot's AI loads this from the folder under Source. Turn it off here for this bot only; the files stay where they are. On Codex, while any is off here, this bot's replies skip the skills.config list in ~/.codex/config.toml.",
"skills.write.title": "Write a command",
"skills.write.hint": "Give the bot a short command for something you ask often. Type /name in a chat to run it. Anything after the name fills in {input}.",
"skills.write.name": "Command name",
diff --git a/src/locales/ja.json b/src/locales/ja.json
index 5d9491c9c9..7ef1ddfb5d 100644
--- a/src/locales/ja.json
+++ b/src/locales/ja.json
@@ -5740,7 +5740,7 @@
"skills.learned.hintOff": "スキルの作成はオフですが、すでに有効にしたスキルは引き続きここで管理できます。",
"skills.origin.imported": "このコンピューター",
"skills.origin.native": "AI",
- "skills.origin.nativeHint": "ボットの AI が、Source に表示されているフォルダーから読み込みます。ここでオフにすると、このボットでのみ無効になります。ファイルは元の場所に残ります。",
+ "skills.origin.nativeHint": "ボットの AI が、Source に表示されているフォルダーから読み込みます。ここでオフにすると、このボットでのみ無効になります。ファイルは元の場所に残ります。 Codex では、ここで 1 つでもオフにしている間、このボットの返信は ~/.codex/config.toml の skills.config を使いません。",
"skills.write.title": "コマンドを作成",
"skills.write.hint": "よく頼む作業をボットの短いコマンドにできます。チャットで /name と入力すると実行できます。名前の後のテキストが {input} に入ります。",
"skills.write.name": "コマンド名",
diff --git a/src/locales/ko.json b/src/locales/ko.json
index 85976f8798..9dab4a5cdf 100644
--- a/src/locales/ko.json
+++ b/src/locales/ko.json
@@ -5510,7 +5510,7 @@
"skills.learned.hintOff": "스킬 작성은 꺼져 있지만, 이미 켠 스킬은 여기서 계속 관리할 수 있어요.",
"skills.origin.imported": "이 컴퓨터",
"skills.origin.native": "엔진",
- "skills.origin.nativeHint": "봇의 AI가 소스 아래에 표시된 폴더에서 이 스킬을 불러와요. 여기서 끄면 이 봇에서만 비활성화돼요. 파일은 원래 위치에 그대로 남아요.",
+ "skills.origin.nativeHint": "봇의 AI가 소스 아래에 표시된 폴더에서 이 스킬을 불러와요. 여기서 끄면 이 봇에서만 비활성화돼요. 파일은 원래 위치에 그대로 남아요. Codex에서는 여기서 하나라도 꺼 두는 동안 이 봇의 답변은 ~/.codex/config.toml의 skills.config 목록을 사용하지 않아요.",
"skills.write.title": "명령 만들기",
"skills.write.hint": "자주 요청하는 일을 짧은 명령으로 만들어 봇에게 주세요. 채팅에서 /이름을 입력하면 실행돼요. 이름 뒤에 쓴 내용은 {input}에 들어가요.",
"skills.write.name": "명령 이름",
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index 2726f702f8..0b9f6356ae 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -5782,7 +5782,7 @@
"skills.origin.imported": "este computador",
"skills.origin.importedHint": "Trazida deste computador. Cada bot lista as que combinam com a função dele e encontra as outras quando uma tarefa precisa. Ative para listá-la neste bot, ou desative para mantê-la longe deste bot.",
"skills.origin.native": "IA",
- "skills.origin.nativeHint": "A IA do bot carrega esta habilidade da pasta indicada em Origem. Desative aqui apenas para este bot; os arquivos ficam onde estão.",
+ "skills.origin.nativeHint": "A IA do bot carrega esta habilidade da pasta indicada em Origem. Desative aqui apenas para este bot; os arquivos ficam onde estão. No Codex, enquanto alguma estiver desativada aqui, as respostas deste bot ignoram a lista skills.config de ~/.codex/config.toml.",
"skills.write.title": "Escrever um comando",
"skills.write.hint": "Dê ao bot um comando curto para algo que você pede com frequência. Digite /nome em uma conversa para executá-lo. O que vier depois do nome preenche {input}.",
"skills.write.name": "Nome do comando",
diff --git a/src/locales/source-hashes.json b/src/locales/source-hashes.json
index b301d26025..432b3d4edd 100644
--- a/src/locales/source-hashes.json
+++ b/src/locales/source-hashes.json
@@ -23201,7 +23201,7 @@
"remote.computerName.placeholder": "33d53fc415aeeb5128cb4c82cebe65e8fe3fbbbfae607ffee515ce72fafbbbd1",
"remote.computerName.error": "39431ac4903234c376d4ee65e3cc59c4b0ec58484bb02363a27e128bca8f37c0",
"skills.origin.native": "11fb682be0a0233d5fb899721ecfc1827d20f0d2ff2e093310efa61efca8af1c",
- "skills.origin.nativeHint": "bee2376a8f6c41590707e2f4360170f67410193554d75d55a51f9bbff9e30fde",
+ "skills.origin.nativeHint": "53bab467a186221ba1427720e9ba8dafe320ee791d2a0b091e3e7afc7bcbab72",
"skills.library.loadError": "4d57d005cf8bde449b67e1c1834d7e3a952a2df0cb8bf31f6b6ab811502157dd",
"settings.import.grokTitle": "c96cf4df1e00ae630e09a66849df3c258cca41adba11f7349f081b5b479b04e6",
"settings.import.grokSubtitle": "b947da44b989a085237c9dd40086b7eb57595fd8653affd57c68df71b2f6f95a",
@@ -29387,7 +29387,7 @@
"skills.origin.imported": "058bf37c9767891850a04e77e252c5bcd5036c4a1d0cec568d498dc4c8437379",
"skills.origin.importedHint": "1a0a4444bcb02305a59f0659abae2383385bf60c954dc84baade1d33d8b43ac1",
"skills.origin.native": "11fb682be0a0233d5fb899721ecfc1827d20f0d2ff2e093310efa61efca8af1c",
- "skills.origin.nativeHint": "bee2376a8f6c41590707e2f4360170f67410193554d75d55a51f9bbff9e30fde",
+ "skills.origin.nativeHint": "53bab467a186221ba1427720e9ba8dafe320ee791d2a0b091e3e7afc7bcbab72",
"skills.write.title": "247262706fab09d0262162ba8a4fe4493b9abf4cd9a4eb5236094437f661e344",
"skills.write.hint": "502d59dd98da355ebdd92770ec84323129cb4f8dd5156b6a3a06d0dd86c0f88e",
"skills.write.name": "5af23acc15079d189a6abaefdd7e13ece4ec7fc5ae94aaa3f665407ce8a61d61",
@@ -39932,7 +39932,7 @@
"skills.learned.hintOn": "ff18ab90b4f16073eead025c8ae9247beda43d6f0b63f857bcc25d43db568825",
"skills.origin.imported": "058bf37c9767891850a04e77e252c5bcd5036c4a1d0cec568d498dc4c8437379",
"skills.origin.native": "11fb682be0a0233d5fb899721ecfc1827d20f0d2ff2e093310efa61efca8af1c",
- "skills.origin.nativeHint": "bee2376a8f6c41590707e2f4360170f67410193554d75d55a51f9bbff9e30fde",
+ "skills.origin.nativeHint": "53bab467a186221ba1427720e9ba8dafe320ee791d2a0b091e3e7afc7bcbab72",
"skills.write.title": "247262706fab09d0262162ba8a4fe4493b9abf4cd9a4eb5236094437f661e344",
"skills.write.hint": "502d59dd98da355ebdd92770ec84323129cb4f8dd5156b6a3a06d0dd86c0f88e",
"skills.write.name": "5af23acc15079d189a6abaefdd7e13ece4ec7fc5ae94aaa3f665407ce8a61d61",
@@ -48372,7 +48372,7 @@
"botAccess.recordSteps.myChrome": "6fc8728673d3b750b3152d7375c4b426621ce5657e3b811cc717bb53ee9aca74",
"skills.origin.imported": "058bf37c9767891850a04e77e252c5bcd5036c4a1d0cec568d498dc4c8437379",
"skills.origin.native": "11fb682be0a0233d5fb899721ecfc1827d20f0d2ff2e093310efa61efca8af1c",
- "skills.origin.nativeHint": "bee2376a8f6c41590707e2f4360170f67410193554d75d55a51f9bbff9e30fde",
+ "skills.origin.nativeHint": "53bab467a186221ba1427720e9ba8dafe320ee791d2a0b091e3e7afc7bcbab72",
"skills.write.title": "247262706fab09d0262162ba8a4fe4493b9abf4cd9a4eb5236094437f661e344",
"skills.write.hint": "502d59dd98da355ebdd92770ec84323129cb4f8dd5156b6a3a06d0dd86c0f88e",
"skills.write.name": "5af23acc15079d189a6abaefdd7e13ece4ec7fc5ae94aaa3f665407ce8a61d61",
@@ -91794,7 +91794,7 @@
"skills.learned.hintOff": "f3477db333415d4fdb93b9f40229ca082915b4e47e1749acaac94588a5836ab7",
"skills.origin.imported": "058bf37c9767891850a04e77e252c5bcd5036c4a1d0cec568d498dc4c8437379",
"skills.origin.native": "11fb682be0a0233d5fb899721ecfc1827d20f0d2ff2e093310efa61efca8af1c",
- "skills.origin.nativeHint": "bee2376a8f6c41590707e2f4360170f67410193554d75d55a51f9bbff9e30fde",
+ "skills.origin.nativeHint": "53bab467a186221ba1427720e9ba8dafe320ee791d2a0b091e3e7afc7bcbab72",
"skills.write.title": "247262706fab09d0262162ba8a4fe4493b9abf4cd9a4eb5236094437f661e344",
"skills.write.hint": "502d59dd98da355ebdd92770ec84323129cb4f8dd5156b6a3a06d0dd86c0f88e",
"skills.write.name": "5af23acc15079d189a6abaefdd7e13ece4ec7fc5ae94aaa3f665407ce8a61d61",
diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.json
index bb18473490..b7bdd6b700 100644
--- a/src/locales/zh-tw.json
+++ b/src/locales/zh-tw.json
@@ -5933,7 +5933,7 @@
"skills.learned.hintOff": "技能撰寫已關閉,但你已啟用的技能仍在此由你掌控。",
"skills.origin.imported": "這台電腦",
"skills.origin.native": "AI",
- "skills.origin.nativeHint": "機器人的 AI 會從「來源」下的資料夾載入此技能。在這裡關閉,只會對這個機器人停用;檔案會留在原處。",
+ "skills.origin.nativeHint": "機器人的 AI 會從「來源」下的資料夾載入此技能。在這裡關閉,只會對這個機器人停用;檔案會留在原處。在 Codex 中,只要這裡關閉了任何一項,這個機器人的回覆就不會使用 ~/.codex/config.toml 中的 skills.config 清單。",
"skills.write.title": "撰寫指令",
"skills.write.hint": "為你常要求的事情給機器人一個簡短指令。在聊天中輸入 /名稱 即可執行。名稱後面的任何內容會填入 {input}。",
"skills.write.name": "指令名稱",
diff --git a/src/locales/zh.json b/src/locales/zh.json
index b7a23f8890..df48965481 100644
--- a/src/locales/zh.json
+++ b/src/locales/zh.json
@@ -5718,7 +5718,7 @@
"skills.learned.hintOff": "技能撰写已关闭,但你已激活的技能仍在此由你掌控。",
"skills.origin.imported": "这台电脑",
"skills.origin.native": "AI",
- "skills.origin.nativeHint": "机器人的 AI 会从「来源」下的文件夹加载此技能。在这里关闭,仅对这个机器人停用;文件会保留在原处。",
+ "skills.origin.nativeHint": "机器人的 AI 会从「来源」下的文件夹加载此技能。在这里关闭,仅对这个机器人停用;文件会保留在原处。在 Codex 中,只要这里关闭了任何一项,这个机器人的回复就不会使用 ~/.codex/config.toml 中的 skills.config 列表。",
"skills.write.title": "编写命令",
"skills.write.hint": "为经常提出的需求给机器人设置一条简短命令。在聊天中输入 /name 即可运行。名称后面的任何内容都会填入 {input}。",
"skills.write.name": "命令名称",