kimi-code icon indicating copy to clipboard operation
kimi-code copied to clipboard

`kimi web` Manual mode ignores user-configured `[[permission.rules]]` allow rules (over-prompts)

Open aconcepcion opened this issue 4 months ago • 2 comments

Environment: kimi-code 0.29.0, macOS (arm64), kimi web --no-open, session in Manual mode.

Summary: Permanent permission rules in ~/.kimi-code/config.toml are honored by the CLI engine but not by kimi web sessions: allow-listed MCP tools still raise "APPROVAL REQUIRED" prompts in the web UI.

Repro:

  1. Add to ~/.kimi-code/config.toml: [[permission.rules]] / decision = "allow" / pattern = "mcp__<server>__<read_tool>" (exact tool name, no glob). kimi doctor validates it.
  2. Confirm the CLI engine loads rules — e.g. a deny rule on the same tool fires in kimi -p with "was denied by permission rule".
  3. Start kimi web --no-open, open a new session (Manual mode), send a prompt that triggers the allow-listed tool.
  4. Expected: the tool runs without an approval prompt (the user-configured-allow policy precedes the fallback-ask). Actual: "APPROVAL REQUIRED — Approve mcp__…" for the allow-listed tool.

Fail-safe direction (over-prompting, not under-prompting), but it breaks the permanent-permissions feature for web-UI users.

aconcepcion avatar Jul 23 '26 07:07 aconcepcion

Hi, I'd like to work on this issue.

My initial investigation suggests that the permission rules are parsed successfully, but are not loaded into the agent-scoped permission rules service in agent-core-v2. As a result, the policy chain falls through to fallback-ask.

I plan to add a focused fix and tests for the config-to-agent rule loading path. Please let me know if someone is already working on this or if this approach conflicts with the intended design.

gunnlace avatar Jul 28 '26 21:07 gunnlace

Same root cause confirmed in the VS Code extension — and since extension 0.70 runs sessions on agent-core-v2 by default (#2916), this bug now hits every extension session, not just kimi web.

Symptom here: in manual mode all Bash tool calls prompt for approval even with matching [[permission.rules]] allow entries (including a blanket pattern = "Bash" allow) — a bare pwd still prompts. Reloading the window, restarting VS Code, and editing config.toml make no difference; doctor sees the config fine. Rolling back via kimi.useAgentCoreV1 = true + window reload restores correct behavior with the same config (rules fire, no prompts); extension 0.67 (v1) was fine.

Full repro and details filed as #3435. Hope #2337 can get a review — happy to re-test on v2 once it lands.

bubu-taozi avatar Sep 01 '26 14:09 bubu-taozi