> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devinenterprise.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Devin Local

> 在 Devin Desktop 中使用 Devin 本地智能体：它基于 Devin CLI 智能体运行框架，支持子 Agent、沙箱隔离、规划模式、工作树和权限控制。

Devin Local 是我们的新一代智能体运行框架，与 [Devin CLI](https://cli.devin.ai) 共用同一套框架。

它在你的机器上运行，可访问你的本地文件、工具和环境，是 Devin Desktop 的主要本地智能体。

> [card] [模式](https://docs.devinenterprise.com/zh/desktop/devin-local/modes.md)
>
> Code、智能、Ask、Plan 和 Bypass Permissions 模式，以及如何先规划再实现。

> [card] [自定义设置](https://docs.devinenterprise.com/zh/desktop/devin-local/customizations.md)
>
> 插件、技能、MCP 服务器、钩子和规则，以及用于查看会话已加载内容的界面。

> [card] [权限](https://docs.devinenterprise.com/zh/desktop/devin-local/permissions.md)
>
> 允许、询问和拒绝规则，批准请求，以及 MCP 工具权限。

> [card] [工作树](https://docs.devinenterprise.com/zh/desktop/devin-local/worktrees.md)
>
> 在 git worktree 中运行会话，并将其更改合并回你的 workspace。

## 主要功能

### 令牌效率

Devin 本地智能体以提示缓存为核心进行设计，因此大多数任务能以更少的令牌达到相同的效果。

### 子智能体

Devin 本地智能体可以创建独立的[子 Agent](https://docs.devinenterprise.com/zh/cli/subagents.md) 来处理子任务，既可在前台运行，也可在后台运行。子智能体与父智能体共享工具和代码库上下文，但各自拥有独立的对话链。

子智能体功能由 `Devin Settings` 中的 **Subagents (Preview)** 开关控制。

除内置配置外，你还可以在 `agents/` 下用 Markdown 文件定义自己的子 Agent，支持以下两种布局：

* **单文件**：`agents/<name>.md`，文件名即该 Profile 的标识符。
* **目录**：`agents/<name>/AGENT.md`，目录名即该 Profile 的标识符。

关于系统会在哪些位置查找这些目录以及如何配置 Profile，请参阅[子 Agent 文档](https://docs.devinenterprise.com/zh/cli/subagents.md)。

### 沙箱隔离

Devin 本地智能体支持操作系统级沙盒。启用后，沙盒会强制执行以下限制：

* **文件系统隔离** — 可写路径由您的[权限范围](https://docs.devinenterprise.com/zh/desktop/devin-local/permissions.md)派生而来，`Read(...)` 拒绝规则会对沙盒中运行的命令隐藏相应路径
* **网络过滤** — 通过域名允许列表和拒绝列表控制智能体可访问的目标

企业管理员可以通过[团队设置](https://cli.devin.ai/docs/enterprise/team-settings#sandbox-enforcement)在整个组织范围内强制执行沙盒行为，包括要求所有用户使用沙箱模式，以及配置组织级的域名过滤规则。

### 快速审查

[快速审查](https://docs.devinenterprise.com/zh/desktop/quick-review.md)是 Devin 本地智能体提供的专用子 Agent，可帮助你快速获取对更改的反馈。

## 切换智能体

如果你尚未选择首选智能体，新选项卡默认使用 Devin Local。如果你无法使用 Devin Local，选项卡会改用第一个可选的 [ACP 智能体](https://docs.devinenterprise.com/zh/desktop/acp.md)；如果没有任何可用的智能体，则显示默认的新选项卡界面，直到有智能体可用为止。你可以随时通过 Devin Desktop 右下角的智能体选择器，更改*新*对话所使用的智能体——即使 Devin Local 仍在连接中，也可以选择它。

![](https://mintcdn.com/cognitionai-enterprise/GYcs1r0Vcxr5GSpj/desktop/assets/windsurf/devin-local-agent-switcher.png?fit=max\&auto=format\&n=GYcs1r0Vcxr5GSpj\&q=85\&s=1cad3484e17401835dd3315895bd5edd)

### Agent 设置

如果智能体选择器中没有出现 Devin Local，你可能需要在 `Devin Settings` 中启用它：

1. 按 `Cmd+Shift+P` (macOS) 或 `Ctrl+Shift+P` (Windows/Linux) 打开命令面板
2. 打开 `Devin User Settings`
3. 点击 “Agents” 选项卡
4. 打开 “Devin Local” 智能体的开关
5. 重启 Devin Desktop

![](https://mintcdn.com/cognitionai-enterprise/GYcs1r0Vcxr5GSpj/desktop/assets/windsurf/devin-local-agent-settings.png?fit=max\&auto=format\&n=GYcs1r0Vcxr5GSpj\&q=85\&s=620d7ea9aafb29cb923dc685fd729df5)

### 企业管理员

Devin Local 是 Devin Desktop 从服务器获取的随附智能体。它是否出现在智能体选择器中，由团队设置中的 **Devin Local Agent** 选项控制：

* 在 **Team** 及其他非 Enterprise 套餐中，它默认可用 (除非个别成员的此项访问权限已被禁用) 。
* 在 **Enterprise** 套餐中，它默认开启，管理员可为成员关闭。

企业管理员可在团队设置仪表板中管理此项设置：

* **Devin 企业管理员**：**Settings → Enterprise → Devin Desktop** (`app.devin.ai/org/{orgName}/settings/desktop`) 。在 **Features** 下，使用 **Devin Local Agent** 开关 (“Allow members to use the Devin Local agent in Devin Desktop and delegate tasks to Devin's terminal agent via ACP”) 。
* **Windsurf 企业管理员**：前往 [Windsurf 仪表板](https://windsurf.com/team/settings)。

开启此设置后，所有成员重启 Devin Desktop 即可在智能体选择器中看到 Devin Local，无需进行任何用户级配置或自定义 [ACP 注册表配置](https://docs.devinenterprise.com/zh/desktop/acp.md#team-registry-configuration)。

## 受限模式

当 workspace 以**受限模式**打开时，其中的智能体将不可用：Devin Local 和所有 [ACP 智能体](https://docs.devinenterprise.com/zh/desktop/acp.md)均会被禁用，[钩子](https://docs.devinenterprise.com/zh/desktop/devin-local/customizations.md#hooks)既不会加载，也不会运行。

workspace 退出受限模式后，智能体即可恢复使用。

## 会话分享

在 Devin Desktop 中，从已完成对话轮次下方的操作菜单中选择 **Share conversation**；在 Devin CLI 或其他 ACP 客户端中，运行 `/share`。agent 会上传经过脱敏处理的 transcript (secrets 已隐去，系统提示和工具定义已移除) ，并返回一个可与团队共享的链接。仅当你的组织允许会话分享、你使用 Devin 账户 (而非仅限 Windsurf 的账户) 登录，且客户端支持共享时，才会提供共享功能。

## 分析

Devin Local 的活动数据会记录在 [`cascade_runs`](https://docs.devinenterprise.com/zh/desktop/accounts/api-reference/cascade-analytics) 数据源 (模型用量、已发送消息和额度消耗) 、[`cascade_tool_usage`](https://docs.devinenterprise.com/zh/desktop/accounts/api-reference/cascade-analytics) 数据源 (Code Edit、Run Command、Search Web 和 MCP Tool 等各工具的调用次数) 、[`cascade_lines`](https://docs.devinenterprise.com/zh/desktop/accounts/api-reference/cascade-analytics) 数据源 (Agent 每日编写的代码行数) ，以及 Custom Analytics API 的 [Cascade 数据源](https://docs.devinenterprise.com/zh/desktop/accounts/analytics-api#cascade-data)中。

Devin Local 不会跟踪建议代码行或“模式”：编辑操作仅在你批准后才会执行，因此已接受的代码行数等于建议的代码行数，且 `cascade_runs` 中的 `mode` 字段不会被填充。

Devin CLI 不会报告[混合部署](https://devin.ai/blog/self-hosted-deployment-maintenance-mode)的分析数据。

## 企业级管控

企业管理员可以通过[团队设置](https://windsurf.com/team/settings)配置 Devin Local agent，其中包括[仅适用于 Devin Local agent 的新控制项](https://cli.devin.ai/docs/enterprise/team-settings)：

* **沙盒强制执行** - 要求所有用户使用沙盒模式，并配置组织范围内的域名过滤规则
* **细粒度权限** - 通过更细化的权限控制 Agent 可执行的操作
* **网络强制执行** - 通过允许和拒绝的域名来控制网络访问

组织的会话分享控制项同样生效：当组织禁用分享时，Devin Local agent 不会提供 **Share conversation** 或 `/share`。

此外，还可以使用“Enable Cascade”控制项来完全禁用旧版 Cascade agent，以确保你的团队遵循 Devin CLI 中提供的新控制项。

### 不支持的企业级管控

以下旧版企业级管控在 Devin Local agent 中不可用：

* **将工具调用限制在工作区内** - 默认情况下，Devin Local agent 只能读取/编辑工作区内的文件。
  自定义[权限](https://cli.devin.ai/docs/reference/permissions)是更灵活的替代方案，可用于实现相同的规则。
* **全局工具调用已禁用** - 如果你之前完全禁用了工具调用，请改为为 Devin CLI 编写等效的[权限策略](https://cli.devin.ai/docs/reference/permissions)。

如果你尚未实现企业级 CLI 权限配置，以下旧版控制项仍会作为回退继续生效：

* **自动运行终端命令** - Devin Local agent 使用自己的[权限模型](https://cli.devin.ai/docs/reference/permissions)，而不是自动执行级别；我们建议使用这种方式，但旧控制项仍会作为回退继续生效。
* **终端允许列表** - 为 Devin CLI 配置等效的[权限策略](https://cli.devin.ai/docs/reference/permissions)，以允许特定终端命令。
* **终端拒绝列表** - 为 Devin CLI 配置等效的[权限策略](https://cli.devin.ai/docs/reference/permissions)，以拒绝特定终端命令。

## 延伸阅读

* [Devin CLI 快速入门](https://cli.devin.ai/docs)
* [必备命令](https://cli.devin.ai/docs/essential-commands)
* [扩展性概述](https://cli.devin.ai/docs/extensibility)
* [团队设置](https://cli.devin.ai/docs/enterprise/team-settings)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.