# Agent profiles

> 將角色化為資料——每個 agent 皆包含提示詞、模型預設值及排序 tool 清單。

在 Enterprise 中，[agent](https://pentagi.com/zh-tw/docs/glossary/#agent) 由 **agent profile** 定義：包含其角色、基礎提示詞、模型預設集及可使用的 [tools](https://pentagi.com/zh-tw/docs/glossary/#tool)。planner agent 會為每個 [subtask](https://pentagi.com/zh-tw/docs/glossary/#subtask) 選擇合適的 [agent profile](https://pentagi.com/zh-tw/docs/glossary/#agent-profile)，確保執行的專家 agent 與工作內容相符。

## [內建 agent profiles](https://pentagi.com/zh-tw/docs/enterprise/agent-profiles/#built-in-profiles)

| 群組        | Agent profiles                                                                                                 |
| --------- | -------------------------------------------------------------------------------------------------------------- |
| 工作 agents | `universal`、`pentester`、`coder`、`installer`、`researcher`、`recon`                                               |
| 互動式       | `assistant`                                                                                                    |
| 管線        | `planner`、`subagent_planner`、`generator`、`refiner`、`reporter`、`enricher`、`report_planner`、`composer`、`reviser` |

[Plugins](https://pentagi.com/zh-tw/docs/glossary/#plugin) 可以提供專屬的 agent profiles，您也可以在 **Settings → Agent Profiles** 中建立自訂 agent profiles——管理員可為所有人建立，其他使用者則僅限為自己建立。

作用中的設定檔具有 **On**、**Default** 和 **Off** 開關：管理員可設定 **Default for users**，而每位使用者均可針對內建設定檔在 **My state** 下覆寫此設定，或針對自訂設定檔在 **My override** 下覆寫。**Default** 會遵循 `PROFILES_ENABLEMENT_MODE` — `auto`（預設值）會將設定檔提供給 planner，而 `manual` 僅在切換為 **On** 時才會提供。若未啟用任何作用中的設定檔，[task](https://pentagi.com/zh-tw/docs/glossary/#task) 將會停止並顯示錯誤。

![設定中的 agent profiles](https://pentagi.com/images/product/ee-agent-profiles.webp)

## [規劃器與執行監控器](https://pentagi.com/zh-tw/docs/enterprise/agent-profiles/#planner-and-execution-monitor)

在每個 subtask 開始之前，`planner` 會選擇工作用的 agent profile、plugins 以及一份簡短的檢查清單。它始終會執行——Enterprise 沒有 `AGENT_PLANNING_STEP_ENABLED`——使用該 [flow](https://pentagi.com/zh-tw/docs/glossary/#flow) 之 [provider](https://pentagi.com/zh-tw/docs/glossary/#provider) 的 `adviser` 模型，而在三次無效回應之後，則會回退至 `universal`。

執行監控預設為開啟（`EXECUTION_MONITOR_ENABLED`）。當連續對同一個工具呼叫 20 次（`EXECUTION_MONITOR_SAME_TOOL_LIMIT`）、自上次檢查以來已進行 40 次 [tool call](https://pentagi.com/zh-tw/docs/glossary/#tool-call)（`EXECUTION_MONITOR_TOTAL_TOOL_LIMIT`），或達到 subtask 時間預算的一半及四分之三時，系統會透過 `simple_json` 模型進行簡短檢查，以判斷 agent 是否陷入停滯。僅在此情況下，adviser 才會檢視 agent 的工作——適用於具備 `advice` tool 的 agent profile，且預算剩餘時間至少還有五分鐘。

## [Sub-agents 與預算](https://pentagi.com/zh-tw/docs/enterprise/agent-profiles/#sub-agents-and-budgets)

工作 agents 可以透過 `spawn_agent` 在 subtask 內啟動 [sub-agents](https://pentagi.com/zh-tw/docs/glossary/#sub-agent) 以進行平行作業，透過 `agent_status`、`agent_wait` 和 `agent_log` 追蹤它們，並使用 `agent_stop` 停止它們。系統會將時間預算從 task 下放至各 subtask，並限制每個 task 的 subtasks 數量及同時執行的 sub-agents 上限，以確保委派過程可控。請在啟動 flow 時設定這些參數，並同時選擇摘要器的目標上下文預設集——Compact、Balanced 或 Spacious。

新 flow 的預設值來自 `AGENT_TIME_BUDGET_SECONDS`（10800，每個 task 的 agent 工作時間為三小時）、`AGENT_MAX_SUBTASKS`（每個 task 15）、`AGENT_MAX_CONCURRENT_SUBAGENTS`（10）和 `SUMMARIZER_PRESET`。在執行中的 flow 上，請於 **Preferences** 下變更這些設定；變更將從下一個 task 開始生效。將 **Concurrent sub-agents** 設為 **Disabled** 會從 flow 的每個 agent（包含 [assistant](https://pentagi.com/zh-tw/docs/glossary/#assistant)）移除 sub-agent tool。