mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-19 03:31:50 +08:00
加强 Agent 核心提示词安全约束
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user