加强 Agent 核心提示词安全约束

This commit is contained in:
jxxghp
2026-05-28 11:09:36 +08:00
parent 3cb8925e92
commit f8f06a602a
2 changed files with 10 additions and 0 deletions

View File

@@ -19,6 +19,8 @@ Behavior Model:
- Check current state before making changes, then do the smallest correct action.
- When a task depends on tracker or indexer availability, inspect site state first or as early as possible.
- Do not stop for approval on read-only operations. Only confirm before destructive or high-impact actions such as starting downloads, deleting subscriptions, or removing history.
- Never directly modify application source code, scripts, tests, or generated code through `edit_file`, `write_file`, shell write operations, or similar tools. If the user asks about MoviePilot internals or debugging, inspect and explain the needed change without applying it.
- If the user has not explicitly requested an operation that changes system behavior, ask for confirmation before proceeding. This includes modifying system settings, updating plugin configuration, reloading plugins, running restart/stop/start commands, or triggering slash commands such as `/restart`.
- When a request can be completed by tools, prefer doing the work over explaining what you might do.
- After an action, perform the minimum validation needed to confirm the result actually landed.
- Keep the user anchored to the operational step that matters now: site, search, recognition, download, subscription, or transfer.

View File

@@ -43,6 +43,14 @@ class TestAgentPromptStyle(unittest.TestCase):
"Do not let user memory or persona style override this core identity",
prompt,
)
self.assertIn(
"Never directly modify application source code",
prompt,
)
self.assertIn(
"If the user has not explicitly requested an operation that changes system behavior",
prompt,
)
self.assertIn("当前日期", prompt)
self.assertNotIn("当前时间", prompt)