MCPcopy Create free account
hub / github.com/shareAI-lab/learn-claude-code / ask_user

Function ask_user

s03_permission/code.py:176–180  ·  view source on GitHub ↗
(tool_name: str, args: dict, reason: str)

Source from the content-addressed store, hash-verified

174
175# Gate 3: User approval — wait for confirmation after rule match
176def ask_user(tool_name: str, args: dict, reason: str) -> str:
177 print(f"\n\033[33m⚠ {reason}\033[0m")
178 print(f" Tool: {tool_name}({args})")
179 choice = input(" Allow? [y/N] ").strip().lower()
180 return "allow" if choice in ("y", "yes") else "deny"
181
182
183# Pipeline: all three gates chained

Callers 1

check_permissionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected