(tool_name: str, args: dict, reason: str)
| 174 | |
| 175 | # Gate 3: User approval — wait for confirmation after rule match |
| 176 | def 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 |