Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f3c41bd
refactor: reorganize permission decision policies
kermanx May 25, 2026
44be735
feat: rework permission decision policies
kermanx May 25, 2026
4c2573a
Merge branch 'main' into codex/permission-decision-policies
kermanx May 25, 2026
1f0679b
fix: align permission policies with execution metadata
kermanx May 25, 2026
bd79f2a
fix: preserve glob permission rule matching
kermanx May 25, 2026
0ba9a37
fix: keep plan review before session approvals
kermanx May 25, 2026
71f0b19
fix: restore plan review outcome telemetry
kermanx May 25, 2026
d970ead
fix: prefer ask rules over allow rules
kermanx May 25, 2026
4cb74ff
Merge branch 'main' into codex/permission-decision-policies
kermanx May 25, 2026
0b667f7
fix: avoid unnecessary git marker probes
kermanx May 25, 2026
67c3d32
Merge branch 'codex/permission-decision-policies' of https://github.c…
kermanx May 25, 2026
0c94bfa
Merge origin/main into codex/permission-decision-policies
kermanx May 25, 2026
a244148
feat: rework permission decision policies
kermanx May 25, 2026
9ad3a9b
refactor: simplify v1.1 record migration
kermanx May 25, 2026
9472a48
update
kermanx May 26, 2026
b730803
Merge branch 'main' into codex/permission-decision-policies
kermanx May 26, 2026
8641479
fix
kermanx May 26, 2026
287ad87
Merge branch 'codex/permission-decision-policies' of https://github.c…
kermanx May 26, 2026
a15a0e9
Merge branch 'main' into codex/permission-decision-policies
kermanx May 26, 2026
1c10e6c
fix
kermanx May 26, 2026
98d5e79
Merge branch 'codex/permission-decision-policies' of https://github.c…
kermanx May 26, 2026
f086bca
fix
kermanx May 26, 2026
2a99ad6
fix
kermanx May 26, 2026
8e1c0d1
fix
kermanx May 26, 2026
321e629
fix
kermanx May 26, 2026
667a124
fix
kermanx May 26, 2026
fff5ede
fix
kermanx May 26, 2026
9e9d713
fix
kermanx May 26, 2026
ac06e62
fix
kermanx May 26, 2026
29f4cd5
fix
kermanx May 26, 2026
b0befb4
Merge remote-tracking branch 'origin/main' into codex/permission-deci…
kermanx May 26, 2026
f075072
fix
kermanx May 26, 2026
10d03fb
refactor(agent-core): centralize ExitPlanMode approval logic in permi…
kermanx May 26, 2026
3bc49b5
refactor(agent-core): flatten pathGlobMatch options parameter
kermanx May 26, 2026
d503e94
fix
kermanx May 26, 2026
4d2c3b8
refactor(agent-core): extract ToolFileAccess type and deduplicate fil…
kermanx May 26, 2026
d11c0d1
refactor(agent-core): split ToolResourceAccess into named interfaces
kermanx May 26, 2026
0d74f75
fix
kermanx May 26, 2026
327151d
refactor
kermanx May 26, 2026
db7c473
fix
kermanx May 26, 2026
386ec8d
fix
kermanx May 26, 2026
5fc574c
fix
kermanx May 26, 2026
5c16a24
fix
kermanx May 26, 2026
24be969
Merge branch 'main' into codex/permission-decision-policies
kermanx May 26, 2026
947326f
docs: update
kermanx May 26, 2026
945de05
docs: update
kermanx May 26, 2026
4ced379
fix
kermanx May 26, 2026
721018b
fix
kermanx May 26, 2026
801faef
fix
kermanx May 26, 2026
bda09e8
fix
kermanx May 26, 2026
75c06c5
fix
kermanx May 26, 2026
86adf29
docs: update
kermanx May 26, 2026
9d6a8c7
Merge remote-tracking branch 'origin/main' into codex/permission-deci…
kermanx May 26, 2026
d691570
fix
kermanx May 26, 2026
f31800f
Merge branch 'main' into codex/permission-decision-policies
kermanx May 26, 2026
8ed08ff
fix
kermanx May 26, 2026
3864ce4
Merge branch 'codex/permission-decision-policies' of https://github.c…
kermanx May 26, 2026
51112cf
add tests
kermanx May 26, 2026
ecdc73b
fix
kermanx May 27, 2026
088969d
Merge remote-tracking branch 'origin/main' into codex/permission-deci…
kermanx May 27, 2026
3f409a6
fix
kermanx May 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/modern-permission-policies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@moonshot-ai/agent-core": minor
"@moonshot-ai/kimi-code": minor
---

Rework tool permissions: reads outside cwd no longer prompt, session approvals match the exact call, and path-based rules are case-insensitive.
2 changes: 1 addition & 1 deletion docs/en/configuration/config-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Rules are written as a `[[permission.rules]]` array of tables, where each rule c
| --- | --- | --- | --- |
| `decision` | `string` | Yes | Decision result; one of `allow`, `deny`, `ask` |
| `scope` | `string` | No | Rule scope; one of `turn-override`, `session-runtime`, `project`, `user`; defaults to `user` |
| `pattern` | `string` | Yes | Match pattern in the form `ToolName` or `ToolName(arg-pattern)`. `ToolName` must match the runtime tool name exactly — built-in tools are `Read`, `Write`, `Edit`, `Bash`, `Grep`, and so on (see [Built-in tools](../reference/tools.md)) |
| `pattern` | `string` | Yes | Match pattern in the form `ToolName` or `ToolName(arg-pattern)`. `ToolName` must match the runtime tool name exactly — built-in tools are `Read`, `Write`, `Edit`, `Bash`, `Grep`, and so on (see [Built-in tools](../reference/tools.md)). Argument patterns are interpreted only by tools with built-in argument matchers, such as `Bash`, file tools, and search tools; MCP tools and custom tools match by tool name only |
| `reason` | `string` | No | Rule description for debugging or auditing |

Example:
Expand Down
2 changes: 1 addition & 1 deletion docs/en/customization/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Stdio entries in a project-level `.kimi-code/mcp.json` execute local commands wh

## Tool naming and permissions

MCP tools are exposed using the naming convention `mcp__<server>__<tool>`. Permission matching supports `*` and `**` wildcards, so `mcp__github__*` covers every tool from the `github` server.
MCP tools are exposed using the naming convention `mcp__<server>__<tool>`. Permission matching supports `*` and `**` wildcards in tool names, so `mcp__github__*` covers every tool from the `github` server. MCP tool arguments are not part of permission matching; allow or deny the exact MCP tool name, or use a tool-name wildcard.

Calls that do not match any rule trigger an approval request. Choosing "Approve for this session" in the approval prompt auto-approves subsequent matching calls.

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/configuration/config-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ api_key = "sk-xxx"
| --- | --- | --- | --- |
| `decision` | `string` | 是 | 决策结果,可选 `allow`、`deny`、`ask` |
| `scope` | `string` | 否 | 规则作用域,可选 `turn-override`、`session-runtime`、`project`、`user`;默认 `user` |
| `pattern` | `string` | 是 | 匹配模式,格式为 `ToolName` 或 `ToolName(arg-pattern)`。`ToolName` 必须与运行时真实工具名一致——内置工具是 `Read`、`Write`、`Edit`、`Bash`、`Grep` 等(详见 [内置工具](../reference/tools.md)) |
| `pattern` | `string` | 是 | 匹配模式,格式为 `ToolName` 或 `ToolName(arg-pattern)`。`ToolName` 必须与运行时真实工具名一致——内置工具是 `Read`、`Write`、`Edit`、`Bash`、`Grep` 等(详见 [内置工具](../reference/tools.md))。参数模式只由带内置参数 matcher 的工具解释,例如 `Bash`、文件工具和搜索工具;MCP 工具和自定义工具只按工具名匹配 |
| `reason` | `string` | 否 | 规则说明,供调试或审计使用 |

示例:
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/customization/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ MCP server 配置写在 `mcp.json` 中,分为两层:

## 工具命名与权限

MCP 工具按 `mcp__<server>__<tool>` 命名。权限匹配支持 `*` 和 `**` 通配,例如 `mcp__github__*` 命中该 server 下所有工具。
MCP 工具按 `mcp__<server>__<tool>` 命名。权限匹配支持工具名中的 `*` 和 `**` 通配,例如 `mcp__github__*` 命中该 server 下所有工具。MCP 工具参数不会参与权限匹配;请放行或拒绝精确的 MCP 工具名,或使用工具名通配

未命中权限规则的调用会触发审批请求;在审批弹窗中选择 "Approve for this session" 后,后续同类调用将自动放行。

Expand Down
142 changes: 0 additions & 142 deletions packages/agent-core/src/agent/permission/action-label.ts

This file was deleted.

59 changes: 0 additions & 59 deletions packages/agent-core/src/agent/permission/check-rules.ts

This file was deleted.

Loading
Loading