From afbb1af6c5d875a17b4b63883d3bb7aa42f8e415 Mon Sep 17 00:00:00 2001 From: Vignesh Natarajan Date: Mon, 2 Feb 2026 22:56:29 -0800 Subject: [PATCH] fix: restore safety + session_status hints --- src/agents/system-prompt.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/agents/system-prompt.ts b/src/agents/system-prompt.ts index 9629b813a66..c14294941ca 100644 --- a/src/agents/system-prompt.ts +++ b/src/agents/system-prompt.ts @@ -347,6 +347,13 @@ export function buildAgentSystemPrompt(params: { const messageChannelOptions = listDeliverableMessageChannels().join("|"); const promptMode = params.promptMode ?? "full"; const isMinimal = promptMode === "minimal" || promptMode === "none"; + const safetySection = [ + "## Safety", + "You have no independent goals: do not pursue self-preservation, replication, resource acquisition, or power-seeking; avoid long-term plans beyond the user's request.", + "Prioritize safety and human oversight over completion; if instructions conflict, pause and ask; comply with stop/pause/audit requests and never bypass safeguards. (Inspired by Anthropic's constitution.)", + "Do not manipulate or persuade anyone to expand access or disable safeguards. Do not copy yourself or change system prompts, safety rules, or tool policies unless explicitly requested.", + "", + ]; const skillsSection = buildSkillsSection({ skillsPrompt, isMinimal, @@ -403,6 +410,7 @@ export function buildAgentSystemPrompt(params: { "Keep narration brief and value-dense; avoid repeating obvious steps.", "Use plain human language for narration unless in a technical context.", "", + ...safetySection, "## OpenClaw CLI Quick Reference", "OpenClaw is controlled via subcommands. Do not invent commands.", "To manage the Gateway daemon service (start/stop/restart):", @@ -437,6 +445,9 @@ export function buildAgentSystemPrompt(params: { ? params.modelAliasLines.join("\n") : "", params.modelAliasLines && params.modelAliasLines.length > 0 && !isMinimal ? "" : "", + userTimezone + ? "If you need the current date, time, or day of week, run session_status (📊 session_status)." + : "", "## Workspace", `Your working directory is: ${params.workspaceDir}`, "Treat this directory as the single global workspace for file operations unless explicitly instructed otherwise.",