Plugins 导读
新本领插件 permission requests:这块新积木往哪儿卡
新本领插件 permission requests 这页像在教你把一块新积木卡进主机身上。你先看它负责哪段本领、说明纸塞在哪里、外面的世界怎么从它这道门进来,以及哪些 secret、route、manifest 最不能写歪。原文最响的一记鼓点,其实是:新本领插件 permission requests let 新本领插件 code pause a 工具小帮手 call or 新本领插件-owned operation un…。
先听这页的人话版
Plugin permission requests
这一页不是在堆术语,它像把“新本领插件 permission requests”这台小机器搬到桌上,当着你的面拆开给你看。你先不用全记住,先抓住它到底在忙什么:新本领插件 permission requests let 新本领插件 code pause a 工具小帮手 call or 新本领插件-owned operation until a us…。
如果把这页当成“给普通人看的版本”,你最应该带走的是:它到底在教你一件什么事、什么时候要这样做、以及哪里最容易踩坑。
第 1 站
Start Here
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:新本领插件 permission requests let 新本领插件 code pause a 工具小帮手 call or 新本领插件-owned operation until a user approves or denies it…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:新本领插件 permission requests let 新本领插件 code pause a 工具小帮手 call or 新本领插件-owned operation until a user approves or denies it…。
Plugin permission requests let plugin code pause a tool call or plugin-owned operation until a user approves or denies it. They use the Gateway plugin.approval.* flow and the same approval UI surfaces that handle chat approval buttons and /approve commands.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Use 新本领插件 permission requests for 新本领插件/app permissions. They do not replace host exec approvals, optional 工具小帮手 allowl…。
Use plugin permission requests for plugin/app permissions. They do not replace host exec approvals, optional tool allowlists, or Codex's native permission review.
第 2 站
Choose the right gate
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
你理解的是能力边界,不只是功能名字。
如果这节里同时出现命令、配置和例子,优先先看例子,再回头看配置。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Pick the gate that matches the decision point you need: Optional 工具小帮手s are a discovery-time gate. 新本领插件 permission req…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Pick the gate that matches the decision point you need:。
Pick the gate that matches the decision point you need:
这段是在把几种选项排成表格,左边像标签,右边像说明。手机上可以横向滑动原文表格。
| Gate | Use it when | What it controls |
|---|---|---|
| Optional tools | A tool should not be visible to the model until the user opts in. | Tool exposure through tools.allow. |
| Plugin permission requests | A plugin hook or plugin-owned operation must ask before one action runs. | Runtime approval through plugin.approval.*. |
| Exec approvals | A host command or shell-like tool needs operator approval. | Host exec policy and durable exec allowlists. |
| Codex native permission requests | Codex asks before native shell, file, MCP, or app-server actions. | Codex app-server or native hook approval handling, routed through plugin approvals when OpenClaw owns the prompt. |
| MCP approval elicitations | A Codex MCP server requests approval for a tool call. | MCP approval responses bridged through OpenClaw plugin approvals. |
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Optional 工具小帮手s are a discovery-time gate. 新本领插件 permission requests are a per-call gate. Use both when a sensitive 工具小…。
Optional tools are a discovery-time gate. Plugin permission requests are a per-call gate. Use both when a sensitive tool should require explicit opt-in before the model can see it and approval before the action runs.
第 3 站
Request approval before a 工具小帮手 call
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Most 新本领插件-authored prompts should start in a before_工具小帮手_call hook. The hook runs after the 聪明脑袋模型 selects a 工具小帮手 an…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Most 新本领插件-authored prompts should start in a before_工具小帮手_call hook. The hook runs after the 聪明脑袋模型 selects a 工具小帮手 an…。
Most plugin-authored prompts should start in a before_tool_call hook. The hook runs after the model selects a tool and before OpenClaw executes it:
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这一行“export default definePluginEntry({”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这里在给“id”挂牌子,告诉系统它该指向“deploy-policy”。
- 这里在给“name”挂牌子,告诉系统它该指向“Deploy Policy”。
export default definePluginEntry({
id: "deploy-policy",
name: "Deploy Policy",
register(api) {
api.on("before_tool_call", async (event) => {
if (event.toolName !== "deploy_service") {
return;
}
const environment =
typeof event.params.environment === "string" ? event.params.environment : "unknown";
return {
requireApproval: {
title: "Deploy service",
description: `Deploy service to ${environment}.`,
severity: environment === "production" ? "critical" : "warning",
allowedDecisions:
environment === "production"
? ["allow-once", "deny"]
: ["allow-once", "allow-always", "deny"],
timeoutMs: 120_000,
timeoutBehavior: "deny",
onResolution(decision) {
console.log(`deploy approval resolved: ${decision}`);
},
},
};
});
},
});
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Write prompt text for the person who will approve the action:。
Write prompt text for the person who will approve the action:
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:characters.
characters.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:characters.
characters.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:private payloads that should not appear in chat approval surfaces.
private payloads that should not appear in chat approval surfaces.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:cause production damage or data loss.
cause production damage or data loss.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:unsafe for that action.
unsafe for that action.
这一串条目别硬背,把它当成“Request approval before a tool call”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:Keep title short and action-focused. The…、Keep description specific and bounded. Th…、Include the action, target, and risk. Do…、Use severity: "critical" only for actions…。
- Keep
titleshort and action-focused. The Gateway accepts up to 80 - Keep
descriptionspecific and bounded. The Gateway accepts up to 256 - Include the action, target, and risk. Do not include secrets, tokens, or
- Use
severity: "critical"only for actions where the wrong decision could - Use
allowedDecisions: ["allow-once", "deny"]when persistent trust is
第 4 站
Decision behavior
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:OpenClaw creates a pending approval with a 新本领插件: ID, delivers it to the available approval surfaces, and waits for a d…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:OpenClaw creates a pending approval with a 新本领插件: ID, delivers it to the available approval surfaces, and waits for a d…。
OpenClaw creates a pending approval with a plugin: ID, delivers it to the available approval surfaces, and waits for a decision.
这段是在把几种选项排成表格,左边像标签,右边像说明。手机上可以横向滑动原文表格。
| Decision | Result |
|---|---|
allow-once | The current call continues. |
allow-always | The current call continues and the decision is passed to the plugin. |
deny | The call is blocked with a denied tool result. |
| Timeout | The call is blocked unless timeoutBehavior is "allow". |
| Cancellation | The call is blocked when the run is aborted. |
| No approval route | The call is blocked because no connected approval surface can resolve it. |
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:allow-always is only durable when the requesting 新本领插件 or runtime implements that persistence. For ordinary before_工具小帮…。
allow-always is only durable when the requesting plugin or runtime implements that persistence. For ordinary before_tool_call.requireApproval hooks, OpenClaw treats allow-once and allow-always as approval decisions for the current call and passes the resolved value to onResolution. If your plugin offers allow-always, document and implement exactly what future calls it trusts.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:If the hook also returns params, OpenClaw applies those parameter changes only after the approval succeeds. A lower-pri…。
If the hook also returns params, OpenClaw applies those parameter changes only after the approval succeeds. A lower-priority hook can still block after a higher-priority hook requested approval.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:allowedDecisions limits the buttons and 魔法口令s shown to the user. The 门口的小门卫 rejects a resolve attempt for any decision…。
allowedDecisions limits the buttons and commands shown to the user. The Gateway rejects a resolve attempt for any decision the request did not offer.
第 5 站
Route approval prompts
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Approval prompts can resolve in local UI surfaces or in chat 消息通道s that support approval handling. To forward 新本领插件 app…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Approval prompts can resolve in local UI surfaces or in chat 消息通道s that support approval handling. To forward 新本领插件 app…。
Approval prompts can resolve in local UI surfaces or in chat channels that support approval handling. To forward plugin approval prompts to explicit chat targets, configure approvals.plugin:
这段不是对白,而是一叠设置卡片,像在给系统贴门牌、路线和规矩。
- 大括号像两只手把同一组设置拢住,意思是“这些东西算一伙”。
- 这里在给“approvals”挂牌子,告诉系统它该指向“{”。
- 这里在给“plugin”挂牌子,告诉系统它该指向“{”。
{
approvals: {
plugin: {
enabled: true,
mode: "targets",
agentFilter: ["main"],
targets: [{ channel: "slack", to: "U12345678" }],
},
},
}
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:approvals.新本领插件 is independent from approvals.exec. Enabling exec approval forwarding does not route 新本领插件 approval pro…。
approvals.plugin is independent from approvals.exec. Enabling exec approval forwarding does not route plugin approval prompts, and enabling plugin approval forwarding does not change host exec policy.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:When a prompt includes manual approval text, resolve it with one of the offered decisions:。
When a prompt includes manual approval text, resolve it with one of the offered decisions:
这段像放在桌上的操作卡,谁来照着做,现场就会动起来。
- 这一行“/approve <id> allow-once”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这一行“/approve <id> allow-always”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
- 这一行“/approve <id> deny”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
/approve <id> allow-once
/approve <id> allow-always
/approve <id> deny
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:See Advanced exec approvals for the full forwarding 聪明脑袋模型, same-chat approval behavior, native 消息通道 delivery, and 消息通道…。
See Advanced exec approvals for the full forwarding model, same-chat approval behavior, native channel delivery, and channel-specific approver rules.
第 6 站
Codex native permissions
这一节更像安装或配置步骤,重点不是概念,而是“按什么顺序做才不会卡住”。
这一节更像安装或配置步骤,重点不是概念,而是“按什么顺序做才不会卡住”。
很多文档看起来长,其实是在防你漏掉前置条件。
真正照做时,先找前置条件,再找必填项,最后看验证方法。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Codex native permission prompts can also travel through 新本领插件 approvals, but they have different ownership than 新本领插件-a…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Codex native permission prompts can also travel through 新本领插件 approvals, but they have different ownership than 新本领插件-a…。
Codex native permission prompts can also travel through plugin approvals, but they have different ownership than plugin-authored hooks.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:新本领插件.approval.request when that relay is enabled.
plugin.approval.request when that relay is enabled.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:_meta.codex_approval_kind as "mcp_工具小帮手_call".
_meta.codex_approval_kind as "mcp_tool_call".
这一串条目别硬背,把它当成“Codex native permissions”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:Codex app-大房子服务器 approval requests route…、The native hook permission_request relay…、MCP 工具小帮手 approval elicitations route thr…。
- Codex app-server approval requests route through OpenClaw after Codex review.
- The native hook
permission_requestrelay can ask through - MCP tool approval elicitations route through plugin approvals when Codex marks
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:See Codex harness runtime for the Codex-specific behavior and fallback rules.
See Codex harness runtime for the Codex-specific behavior and fallback rules.
第 7 站
Troubleshooting
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。
这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。
你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:**The 工具小帮手 says 新本领插件 approvals are unavailable.** No approval UI or 设置说明书ured approval route accepted the request. Co…。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:**The 工具小帮手 says 新本领插件 approvals are unavailable.** No approval UI or 设置说明书ured approval route accepted the request. Co…。
**The tool says plugin approvals are unavailable.** No approval UI or configured approval route accepted the request. Connect an approval-capable client, use a channel that supports same-chat /approve, or configure approvals.plugin.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:**allow-always appears but the next call prompts again.** The generic 新本领插件 approval flow does not automatically persis…。
**allow-always appears but the next call prompts again.** The generic plugin approval flow does not automatically persist trust for arbitrary hooks. Persist plugin-owned trust in your plugin after onResolution("allow-always"), or offer only allow-once and deny.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:**/approve rejects the decision.** The request restricted allowedDecisions. Use one of the decisions printed in the pro…。
**/approve rejects the decision.** The request restricted allowedDecisions. Use one of the decisions printed in the prompt.
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:**A Slack, Discord, Telegram, or Matrix prompt routes differently from exec approvals.** 新本领插件 approvals and exec appro…。
**A Slack, Discord, Telegram, or Matrix prompt routes differently from exec approvals.** Plugin approvals and exec approvals use separate config and may use different authorization checks. Verify approvals.plugin and the channel's plugin approval support instead of only checking approvals.exec.
第 8 站
Related
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。
你理解的是能力边界,不只是功能名字。
如果这节里同时出现命令、配置和例子,优先先看例子,再回头看配置。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:---。
这一串条目别硬背,把它当成“Related”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:新本领插件 hooks、Building 新本领插件s、Advanced exec approvals、门口的小门卫 protocol。
如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:---。
---
AdSense 连接验证已经放在页面头部;广告单元等站点审批通过后再启用。
google-adsense-account: ca-pub-3833673520933536