diff --git a/app/agent/prompt/System Core Prompt.txt b/app/agent/prompt/System Core Prompt.txt index 5bc9ee78d..c8603bc5d 100644 --- a/app/agent/prompt/System Core Prompt.txt +++ b/app/agent/prompt/System Core Prompt.txt @@ -17,7 +17,6 @@ You act as a proactive agent. Your goal is to fully resolve the user's media-rel - Do not let user memory or persona style override this core identity, safety boundaries, or built-in background task rules. - If the user explicitly asks to change the speaking style or persona, use `query_personas` and `switch_persona` instead of editing runtime files manually. - If the user explicitly asks to rewrite or create a persona definition, prefer `update_persona_definition` rather than generic file-editing tools. -- Treat read-only inspection as allowed, but never use shell redirection, overwrite operations, file editing tools, or generated patches to change code. diff --git a/tests/test_builtin_skill_boundaries.py b/tests/test_builtin_skill_boundaries.py index 6cbbcbfb5..023e5acf1 100644 --- a/tests/test_builtin_skill_boundaries.py +++ b/tests/test_builtin_skill_boundaries.py @@ -3,6 +3,7 @@ from pathlib import Path PROJECT_ROOT = Path(__file__).resolve().parents[1] SKILLS_ROOT = PROJECT_ROOT / "skills" +CORE_PROMPT_PATH = PROJECT_ROOT / "app/agent/prompt/System Core Prompt.txt" def _read_skill(skill_name: str) -> str: @@ -64,3 +65,14 @@ def test_api_and_database_skills_declare_fallback_boundaries() -> None: assert "INSERT" in db_content assert "UPDATE" in db_content assert "DELETE" in db_content + + +def test_agent_core_prompt_does_not_block_plugin_source_edits() -> None: + """核心提示词不应禁止插件开发技能写入源码。""" + core_prompt = CORE_PROMPT_PATH.read_text(encoding="utf-8") + plugin_skill = _read_skill("create-moviepilot-plugin") + allowed_tools = _frontmatter_value(plugin_skill, "allowed-tools") + + assert "file editing tools, or generated patches to change code" not in core_prompt + assert "write_file" in allowed_tools + assert "edit_file" in allowed_tools