← Lesson
Forbidden Tools Are a Gate
Joeven
Run
Reset
Python loads on first run
def gate(tools, forbid): hit = [t for t in tools if t in forbid] return {"ok": not hit, "hit": hit} print(gate(["search_kb", "finish"], ["wire", "run_shell"])) print(gate(["search_kb", "wire"], ["wire", "run_shell"])) print(gate(["run_shell"], ["wire", "run_shell"]))
Run to execute this in your browser. Nothing is sent to a server.