From 3a792333840d420e5935d80706293c495c8390da Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sat, 11 Apr 2026 17:01:36 +0800 Subject: [PATCH] feat: update computer access hints and add detailed configuration instructions --- .../en-US/features/config-metadata.json | 6 +- .../i18n/locales/en-US/features/welcome.json | 3 +- .../ru-RU/features/config-metadata.json | 4 +- .../i18n/locales/ru-RU/features/welcome.json | 99 +++++++------ .../zh-CN/features/config-metadata.json | 22 +-- .../i18n/locales/zh-CN/features/welcome.json | 3 +- dashboard/src/views/WelcomePage.vue | 1 + docs/.vitepress/config.mjs | 2 + docs/en/use/computer.md | 139 ++++++++++++++++++ docs/zh/use/computer.md | 137 +++++++++++++++++ 10 files changed, 349 insertions(+), 67 deletions(-) create mode 100644 docs/en/use/computer.md create mode 100644 docs/zh/use/computer.md diff --git a/dashboard/src/i18n/locales/en-US/features/config-metadata.json b/dashboard/src/i18n/locales/en-US/features/config-metadata.json index 20528f57c..334b378f6 100644 --- a/dashboard/src/i18n/locales/en-US/features/config-metadata.json +++ b/dashboard/src/i18n/locales/en-US/features/config-metadata.json @@ -152,11 +152,11 @@ }, "agent_computer_use": { "description": "Agent Computer Use", - "hint": "Allows the AstrBot to access and use your computer or an sandbox environment to perform more complex tasks. See [Sandbox Mode](https://docs.astrbot.app/use/astrbot-agent-sandbox.html), [Skills](https://docs.astrbot.app/use/skills.html)", + "hint": "Allows the AstrBot to access and use your computer or an sandbox environment to perform more complex tasks. See: [Computer Use](https://docs.astrbot.app/use/computer.html).", "provider_settings": { "computer_use_runtime": { "description": "Computer Use Runtime", - "hint": "sandbox means running in a sandbox environment, local means running in a local environment, none means disabling Computer Use. If skills are uploaded, choosing none will cause them to not be usable by the Agent." + "hint": "Environment allowed for Agent usage. `local` means the local machine environment, `sandbox` means the sandbox environment, and `none` means no environment is allowed." }, "computer_use_require_admin": { "description": "Require AstrBot Admin Permission", @@ -1637,4 +1637,4 @@ "helpMiddle": "or", "helpSuffix": "." } -} \ No newline at end of file +} diff --git a/dashboard/src/i18n/locales/en-US/features/welcome.json b/dashboard/src/i18n/locales/en-US/features/welcome.json index 7c1232774..e9b933c20 100644 --- a/dashboard/src/i18n/locales/en-US/features/welcome.json +++ b/dashboard/src/i18n/locales/en-US/features/welcome.json @@ -37,7 +37,8 @@ "providerDefaultUpdated": "Default chat provider in config file \"default\" has been set to {id}", "computerAccessUpdateFailed": "Failed to update Agent computer access", "computerAccessAllowed": "Agent is now allowed to access and use the computer", - "computerAccessDenied": "Agent is no longer allowed to access and use the computer" + "computerAccessDenied": "Agent is no longer allowed to access and use the computer", + "step3HelpItem3": "For more detailed control, configure the Computer Access options under Settings -> General -> Computer Access." }, "resources": { "title": "Resources", diff --git a/dashboard/src/i18n/locales/ru-RU/features/config-metadata.json b/dashboard/src/i18n/locales/ru-RU/features/config-metadata.json index 2ff332c0b..ce817c4a9 100644 --- a/dashboard/src/i18n/locales/ru-RU/features/config-metadata.json +++ b/dashboard/src/i18n/locales/ru-RU/features/config-metadata.json @@ -152,11 +152,11 @@ }, "agent_computer_use": { "description": "Использование компьютера (Agent Computer Use)", - "hint": "Позволяет AstrBot получать доступ к вашему компьютеру или песочнице для выполнения сложных задач. См. [Режим песочницы](https://docs.astrbot.app/use/astrbot-agent-sandbox.html), [Навыки](https://docs.astrbot.app/use/skills.html)", + "hint": "Позволяет AstrBot получать доступ к вашему компьютеру или песочнице для выполнения сложных задач. Подробнее: [Использование компьютера](https://docs.astrbot.app/use/computer.html).", "provider_settings": { "computer_use_runtime": { "description": "Среда выполнения (Runtime)", - "hint": "'sandbox' означает запуск в изолированной среде, 'local' — локально на вашем ПК, 'none' — отключено. Если навыки загружены, выбор 'none' сделает их недоступными для агента." + "hint": "Среда, к которой разрешён доступ Agent: `local` — локальная среда компьютера, `sandbox` — изолированная песочница, `none` — запретить доступ к любым средам." }, "computer_use_require_admin": { "description": "Требовать права администратора AstrBot", diff --git a/dashboard/src/i18n/locales/ru-RU/features/welcome.json b/dashboard/src/i18n/locales/ru-RU/features/welcome.json index 8936518e9..f1b085130 100644 --- a/dashboard/src/i18n/locales/ru-RU/features/welcome.json +++ b/dashboard/src/i18n/locales/ru-RU/features/welcome.json @@ -1,50 +1,51 @@ -{ - "greeting": { - "morning": "Доброе утро, добро пожаловать в AstrBot", - "afternoon": "Добрый день, добро пожаловать в AstrBot", - "evening": "Добрый вечер, добро пожаловать в AstrBot", - "newYear": "С Новым Годом!" - }, - "subtitle": "Сначала пройдите базовое руководство. Настройку платформ и провайдеров моделей можно завершить позже.", - "announcement": { - "title": "Объявление" - }, - "onboard": { - "title": "Быстрый старт", - "subtitle": "Вы можете выполнить первичную настройку прямо здесь.", - "step1Title": "Настройка AI моделей", - "step1Desc": "Выберите и настройте AI провайдеров для AstrBot.", - "step2Title": "Настройка платформ", - "step2Desc": "Подключите AstrBot к QQ, Lark, WeChat, Telegram и другим мессенджерам.", - "step3Title": "Разрешить Agent использовать компьютер", - "step3Desc": "Укажите, может ли Agent получать доступ к этому компьютеру и использовать его.", - "step3HelpTitle": "Сведения о доступе", - "step3HelpItem1": "Agent сможет получать доступ к каталогу рабочего пространства и использовать его, при этом рабочие каталоги разных пользователей изолированы друг от друга, а также использовать Skills для выполнения более сложных задач.", - "step3HelpItem2": "Для администраторов AstrBot Agent дополнительно сможет выполнять shell-команды, запускать Python-код и получать доступ ко всем локальным каталогам на этом компьютере.", - "step3HelpClose": "Закрыть", - "step3SelectLabel": "Доступ к компьютеру", - "step3Allow": "Разрешить", - "step3Deny": "Запретить", - "configure": "Настроить", - "save": "Сохранить", - "skip": "Пропустить", - "pending": "Ожидает", - "completed": "Готово", - "skipped": "Пропущено", - "platformLoadFailed": "Ошибка загрузки конфигурации платформ", - "providerLoadFailed": "Ошибка загрузки конфигурации провайдеров", - "providerUpdateFailed": "Ошибка обновления провайдера по умолчанию в файле default", - "providerDefaultUpdated": "Провайдер {id} установлен по умолчанию в файле default", - "computerAccessUpdateFailed": "Не удалось обновить доступ Agent к компьютеру", - "computerAccessAllowed": "Agent теперь может получать доступ к компьютеру и использовать его", - "computerAccessDenied": "Agent больше не может получать доступ к компьютеру и использовать его" - }, - "resources": { - "title": "Ресурсы", - "githubDesc": "Поставьте нам звезду на GitHub!", - "docsTitle": "Документация", - "docsDesc": "Официальная документация AstrBot.", - "afdianTitle": "Afdian", - "afdianDesc": "Поддержите команду AstrBot через Afdian." - } +{ + "greeting": { + "morning": "Доброе утро, добро пожаловать в AstrBot", + "afternoon": "Добрый день, добро пожаловать в AstrBot", + "evening": "Добрый вечер, добро пожаловать в AstrBot", + "newYear": "С Новым Годом!" + }, + "subtitle": "Сначала пройдите базовое руководство. Настройку платформ и провайдеров моделей можно завершить позже.", + "announcement": { + "title": "Объявление" + }, + "onboard": { + "title": "Быстрый старт", + "subtitle": "Вы можете выполнить первичную настройку прямо здесь.", + "step1Title": "Настройка AI моделей", + "step1Desc": "Выберите и настройте AI провайдеров для AstrBot.", + "step2Title": "Настройка платформ", + "step2Desc": "Подключите AstrBot к QQ, Lark, WeChat, Telegram и другим мессенджерам.", + "step3Title": "Разрешить Agent использовать компьютер", + "step3Desc": "Укажите, может ли Agent получать доступ к этому компьютеру и использовать его.", + "step3HelpTitle": "Сведения о доступе", + "step3HelpItem1": "Agent сможет получать доступ к каталогу рабочего пространства и использовать его, при этом рабочие каталоги разных пользователей изолированы друг от друга, а также использовать Skills для выполнения более сложных задач.", + "step3HelpItem2": "Для администраторов AstrBot Agent дополнительно сможет выполнять shell-команды, запускать Python-код и получать доступ ко всем локальным каталогам на этом компьютере.", + "step3HelpClose": "Закрыть", + "step3SelectLabel": "Доступ к компьютеру", + "step3Allow": "Разрешить", + "step3Deny": "Запретить", + "configure": "Настроить", + "save": "Сохранить", + "skip": "Пропустить", + "pending": "Ожидает", + "completed": "Готово", + "skipped": "Пропущено", + "platformLoadFailed": "Ошибка загрузки конфигурации платформ", + "providerLoadFailed": "Ошибка загрузки конфигурации провайдеров", + "providerUpdateFailed": "Ошибка обновления провайдера по умолчанию в файле default", + "providerDefaultUpdated": "Провайдер {id} установлен по умолчанию в файле default", + "computerAccessUpdateFailed": "Не удалось обновить доступ Agent к компьютеру", + "computerAccessAllowed": "Agent теперь может получать доступ к компьютеру и использовать его", + "computerAccessDenied": "Agent больше не может получать доступ к компьютеру и использовать его", + "step3HelpItem3": "Для более тонкой настройки перейдите в «Конфигурация → Основные настройки → Доступ к компьютеру»." + }, + "resources": { + "title": "Ресурсы", + "githubDesc": "Поставьте нам звезду на GitHub!", + "docsTitle": "Документация", + "docsDesc": "Официальная документация AstrBot.", + "afdianTitle": "Afdian", + "afdianDesc": "Поддержите команду AstrBot через Afdian." + } } diff --git a/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json b/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json index 15be50564..2e6edb4a1 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json +++ b/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json @@ -154,11 +154,11 @@ }, "agent_computer_use": { "description": "使用电脑能力", - "hint": "让 AstrBot 访问和使用你的电脑或者隔离的沙盒环境,以执行更复杂的任务。详见: [沙盒模式](https://docs.astrbot.app/use/astrbot-agent-sandbox.html), [Skills](https://docs.astrbot.app/use/skills.html)。", + "hint": "让 AstrBot 访问和使用本机环境或者隔离的沙盒环境,以执行更复杂的任务。详见: [电脑使用](https://docs.astrbot.app/use/computer.html)。", "provider_settings": { "computer_use_runtime": { "description": "运行环境", - "hint": "sandbox 代表在沙箱环境中运行, local 代表在本地环境中运行, none 代表不启用。如果上传了 skills,选择 none 会导致其无法被 Agent 正常使用。" + "hint": "允许 Agent 访问的环境。local 为本机环境,sandbox 为沙箱环境,none 为不允许任何环境。" }, "computer_use_require_admin": { "description": "需要 AstrBot 管理员权限", @@ -1115,22 +1115,22 @@ "hint": "仅在使用 qwen3-rerank 模型时生效。建议使用英文撰写。" }, "nvidia_rerank_api_base": { - "description": "API Base URL" + "description": "API Base URL" }, "nvidia_rerank_api_key": { - "description": "API Key" + "description": "API Key" }, "nvidia_rerank_model": { - "description": "重排序模型名称", - "hint": "请参照NVIDIA Docs中模型名称填写。" + "description": "重排序模型名称", + "hint": "请参照NVIDIA Docs中模型名称填写。" }, "nvidia_rerank_model_endpoint": { - "description": "自定义模型端点", - "hint": "自定义URL末尾端点,默认为 /reranking" + "description": "自定义模型端点", + "hint": "自定义URL末尾端点,默认为 /reranking" }, "nvidia_rerank_truncate": { - "description": "文本截断策略", - "hint": "当输入文本过长时,是否截断输入以适应模型的最大上下文长度。" + "description": "文本截断策略", + "hint": "当输入文本过长时,是否截断输入以适应模型的最大上下文长度。" }, "launch_model_if_not_running": { "description": "模型未运行时自动启动", @@ -1639,4 +1639,4 @@ "helpMiddle": "或", "helpSuffix": "。" } -} +} \ No newline at end of file diff --git a/dashboard/src/i18n/locales/zh-CN/features/welcome.json b/dashboard/src/i18n/locales/zh-CN/features/welcome.json index ff968c2b9..0b58306ee 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/welcome.json +++ b/dashboard/src/i18n/locales/zh-CN/features/welcome.json @@ -37,7 +37,8 @@ "providerDefaultUpdated": "已将 default 配置文件的默认对话提供商设置为 {id}", "computerAccessUpdateFailed": "更新 Agent 电脑访问权限失败", "computerAccessAllowed": "已允许 Agent 访问和使用电脑", - "computerAccessDenied": "已禁止 Agent 访问和使用电脑" + "computerAccessDenied": "已禁止 Agent 访问和使用电脑", + "step3HelpItem3": "如需更多细化权限与能力配置,可前往 配置文件 -> 普通配置 -> 使用电脑能力 继续设置。" }, "resources": { "title": "相关资源", diff --git a/dashboard/src/views/WelcomePage.vue b/dashboard/src/views/WelcomePage.vue index a4872c3b0..c6c497819 100644 --- a/dashboard/src/views/WelcomePage.vue +++ b/dashboard/src/views/WelcomePage.vue @@ -177,6 +177,7 @@
  1. {{ tm('onboard.step3HelpItem1') }}
  2. {{ tm('onboard.step3HelpItem2') }}
  3. +
  4. {{ tm('onboard.step3HelpItem3') }}
diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs index 5f6e1d242..abf3bb069 100644 --- a/docs/.vitepress/config.mjs +++ b/docs/.vitepress/config.mjs @@ -163,6 +163,7 @@ export default defineConfig({ { text: "内置指令", link: "/command" }, { text: "工具使用 Tools", link: "/function-calling" }, { text: "技能 Skills", link: "/skills" }, + { text: "使用电脑能力", link: "/computer" }, { text: "SubAgent 编排", link: "/subagent" }, { text: "主动型 Agent 能力", link: "/proactive-agent" }, { text: "MCP", link: "/mcp" }, @@ -404,6 +405,7 @@ export default defineConfig({ { text: "Built-in Commands", link: "/command" }, { text: "Tool Use", link: "/function-calling" }, { text: "Anthropic Skills", link: "/skills" }, + { text: "Computer Use", link: "/computer" }, { text: "SubAgent Orchestration", link: "/subagent" }, { text: "Proactive Tasks", link: "/proactive-agent" }, { text: "MCP", link: "/mcp" }, diff --git a/docs/en/use/computer.md b/docs/en/use/computer.md new file mode 100644 index 000000000..09fcd87ad --- /dev/null +++ b/docs/en/use/computer.md @@ -0,0 +1,139 @@ +# Computer Use + +Computer Use controls whether an Agent can execute code, access files, run Shell commands. + +## Mode Selection + +In WebUI, open: + +- `Config -> General Config -> Use Computer Capabilities` + +The key option is `Computer Use Runtime`: + +- `none`: disables Computer Use; Shell, Python, filesystem, and related tools are not mounted. +- `local`: executes on the host machine where AstrBot is running. Use this when the Agent needs local files, command-line tools, or local dependencies. +- `sandbox`: executes inside an isolated sandbox. Use this when you want to reduce host risk or provide automation capabilities to multiple users. + +If you are not sure which mode to choose, prefer `sandbox`. Use `local` only when direct host access is required. + +## Local Mode + +`local` mode mounts Computer Use tools into the host environment where AstrBot runs. The Agent can call the host Shell, host Python, and host filesystem tools. + +This means the Agent's boundary is close to the AstrBot process itself. What it can access depends on the system permissions, runtime user, working directory, and operating-system restrictions of the AstrBot process. + +### Workspace + +In `local` mode, AstrBot prepares a workspace for each session: + +```text +data/workspaces/{normalized_umo} +``` + +`{normalized_umo}` is derived from the current session's `unified_msg_origin`; characters unsuitable for filenames are replaced with `_`. + +Relative paths passed to local filesystem tools are resolved under this workspace. For example: + +```text +notes/todo.txt +``` + +is resolved as: + +```text +data/workspaces/{normalized_umo}/notes/todo.txt +``` + +The local Shell tool also runs with this workspace as its current working directory. + +> [!NOTE] +> The local Python tool executes code through AstrBot's current Python environment. When Python code reads or writes files, use explicit absolute paths or prepare files through filesystem tools in the workspace first. + +### Local Tools + +`local` mode mainly provides: + +- `Shell`: executes host shell commands. Windows follows `cmd.exe` semantics; Linux/macOS follow Unix-like shell semantics. +- `Python`: executes Python code in AstrBot's current Python environment. +- `File read`: reads text, image, spreadsheet, and other supported files. +- `File write`: writes UTF-8 text files; relative paths default to the current workspace. +- `File edit`: replaces exact text in files. +- `Grep search`: searches file contents through ripgrep. + +`local` mode does not mount sandbox upload/download tools, and it does not provide browser automation. Browser automation belongs to the sandbox runtime and requires a sandbox profile with the `browser` capability. + +The local Shell tool includes basic blocking for dangerous commands such as `rm -rf`, `sudo`, `shutdown`, `reboot`, and `kill -9`. This is not a complete security sandbox and should not be treated as one. + +### Permission Model + +Computer Use has a separate option: + +- `Require AstrBot admin permission` + +This option is enabled by default. + +When enabled: + +- Admin users can use Shell, Python, file read, file write, file edit, and Grep search in `local` mode. +- Non-admin users cannot use Shell or Python. +- Non-admin users can only use file read, write, edit, and search inside restricted directories. + +Allowed directories for non-admin users in `local` mode include: + +- `data/skills` +- Current session's `data/workspaces/{normalized_umo}` +- AstrBot temporary directories +- `.astrbot` under the system temporary directory + +If `Require AstrBot admin permission` is disabled, regular users behave much closer to admins for Computer Use tools. Do not disable it unless you understand the risk. + +Admin IDs can be configured in: + +- `Config -> Other Config -> Admin ID` + +Users can get their own ID with `/sid`. + +## Sandbox Mode + +`sandbox` mode runs execution actions inside an isolated environment instead of directly on the AstrBot host. + +Inside the sandbox, the Agent can still use Shell, Python, and filesystem tools. If the selected sandbox profile supports the `browser` capability, AstrBot also mounts browser automation tools. + +With Shipyard Neo, the sandbox workspace root is usually: + +```text +/workspace +``` + +Filesystem tools should usually receive relative paths, for example: + +```text +result.txt +``` + +instead of: + +```text +/workspace/result.txt +``` + +For sandbox deployment, profiles, TTL, persistence, and browser capabilities, see [Agent Sandbox Environment](/en/use/astrbot-agent-sandbox). + +> [!NOTE] +> Even in `sandbox` mode, `Require AstrBot admin permission` still affects access to Shell, Python, browser, upload/download, and related tools. The exact behavior depends on your configuration. + +## Skills + +Skills are reusable instruction bundles for Agents. They are usually stored under `data/skills`, and each Skill contains a `SKILL.md`. + +The relationship between Skills and Computer Use is: + +- Skills tell the Agent what to do. +- Computer Use decides whether the Agent can execute those steps. + +For example, a Skill may ask the Agent to read files, run scripts, and generate a report. If `Computer Use Runtime` is `none`, the Agent may see the Skill instructions, but it cannot call Shell or Python to execute them. + +In `local` mode, the Agent reads local Skills. +In `sandbox` mode, AstrBot attempts to sync local Skills into the sandbox so the Agent can execute them there. + +For more details, see [Anthropic Skills](/en/use/skills). diff --git a/docs/zh/use/computer.md b/docs/zh/use/computer.md new file mode 100644 index 000000000..bf0c6ecfc --- /dev/null +++ b/docs/zh/use/computer.md @@ -0,0 +1,137 @@ +# 使用电脑能力 + +电脑能力(Computer Use)决定 Agent 是否可以在 AstrBot 运行环境中执行代码、访问文件、调用 Shell。 + +## 模式选择 + +在 WebUI 中进入: + +- `配置 -> 普通配置 -> 使用电脑能力` + +核心配置项是 `Computer Use Runtime`: + +- `none`:不启用电脑能力,不给 Agent 挂载 Shell、Python、文件系统等工具。 +- `local`:在 AstrBot 所在机器上执行,适合需要访问本机文件、命令行工具或本地依赖的场景。 +- `sandbox`:在隔离沙盒中执行,适合希望降低本机风险、或让多用户使用自动化能力的场景。 + +## Local 模式 + +`local` 模式会把电脑能力挂载到 AstrBot 所在的主机环境。Agent 可以调用本机 Shell、本机 Python,以及本机文件系统工具。 + +这意味着 Agent 的能力边界接近 AstrBot 进程本身:它能访问什么,取决于 AstrBot 进程的系统权限、运行用户、工作目录和操作系统限制。 + +### Workspace + +在 `local` 模式下,AstrBot 会为每个会话准备一个 workspace: + +```text +data/workspaces/{normalized_umo} +``` + +其中 `{normalized_umo}` 来自当前会话的 `unified_msg_origin`,并会将不适合文件名的字符替换为 `_`。 + +本地文件工具的相对路径会解析到这个 workspace 下。例如: + +```text +notes/todo.txt +``` + +会被解析为: + +```text +data/workspaces/{normalized_umo}/notes/todo.txt +``` + +本地 Shell 工具执行时,也会把当前工作目录设置为这个 workspace。 + +> [!NOTE] +> 本地 Python 工具会调用 AstrBot 当前 Python 环境执行代码。编写会读写文件的 Python 代码时,建议使用明确的绝对路径,或先通过文件工具在 workspace 中准备文件。 + +### 本地工具 + +`local` 模式主要提供以下工具: + +- `Shell`:执行本机 shell 命令。Windows 下使用 `cmd.exe` 语义,Linux/macOS 下使用类 Unix shell 语义。 +- `Python`:使用 AstrBot 当前 Python 环境执行 Python 代码。 +- `文件读取`:读取 workspace 或允许路径中的文本、图片、表格等文件。 +- `文件写入`:写入 UTF-8 文本文件;相对路径默认落在当前 workspace。 +- `文件编辑`:按精确字符串替换文件内容。 +- `Grep 搜索`:使用 ripgrep 能力搜索文件内容。 + +`local` 模式不会挂载沙盒上传/下载工具,也不会提供浏览器自动化工具。浏览器能力属于沙盒运行时,需要使用支持 `browser` capability 的沙盒 profile。 + +本地 Shell 内置了基础危险命令拦截,例如 `rm -rf`、`sudo`、`shutdown`、`reboot`、`kill -9` 等。但这不是完整安全沙箱,不能把它当作安全边界。 + +### 权限模型 + +电脑能力还有一个独立开关: + +- `需要 AstrBot 管理员权限` + +默认情况下这个开关是开启的。 + +开启后: + +- 管理员可以使用 `local` 模式下的 Shell、Python、文件读取、文件写入、文件编辑和 Grep 搜索。 +- 非管理员不能使用 Shell 和 Python。 +- 非管理员只能在受限目录内使用文件读取、写入、编辑和搜索。 + +非管理员在 `local` 模式下允许访问的目录包括: + +- `data/skills` +- 当前会话的 `data/workspaces/{normalized_umo}` +- AstrBot 的临时目录 +- 系统临时目录中的 `.astrbot` + +关闭“需要 AstrBot 管理员权限”后,普通用户在电脑能力工具上的行为会接近管理员。除非你非常清楚风险,否则不建议关闭。 + +管理员 ID 可在: + +- `配置 -> 其他配置 -> 管理员 ID` + +中配置。用户可通过 `/sid` 获取自己的 ID。 + +## Sandbox 模式 + +`sandbox` 模式会把执行动作放到隔离环境中,而不是直接在 AstrBot 主机上运行。 + +在沙盒中,Agent 仍然可以使用 Shell、Python、文件系统工具;如果所选沙盒 profile 支持 `browser` capability,还会挂载浏览器自动化工具。 + +使用 Shipyard Neo 时,沙盒 workspace 根目录通常是: + +```text +/workspace +``` + +文件工具一般应传入相对路径,例如: + +```text +result.txt +``` + +而不是: + +```text +/workspace/result.txt +``` + +沙盒部署、profile、TTL、数据持久化、浏览器能力等内容请参考:[Agent 沙盒环境](/use/astrbot-agent-sandbox)。 + +> [!NOTE] +> 即使在 `sandbox` 模式下,“需要 AstrBot 管理员权限”仍会影响 Shell、Python、浏览器、上传下载等工具的调用权限。具体权限取决于你的配置。 + +## Skills + +Skills 是给 Agent 使用的“任务说明书”,通常存放在 `data/skills` 下,每个 Skill 都包含一个 `SKILL.md`。 + +电脑能力和 Skills 的关系可以理解为: + +- Skills 告诉 Agent 应该怎么做。 +- 电脑能力决定 Agent 能不能执行这些步骤。 + +例如,一个 Skill 可能要求 Agent 读取文件、运行脚本、生成报告。如果 `Computer Use Runtime` 是 `none`,Agent 可以看到 Skill 的说明,但无法真正调用 Shell 或 Python 完成执行。 + +在 `local` 模式下,Agent 会读取本地 Skills。 +在 `sandbox` 模式下,AstrBot 会尝试把本地 Skills 同步到沙盒中,让 Agent 在沙盒内按 Skill 指令执行。 + +更多内容请参考:[技能 Skills](/use/skills)。