Gatesi examples ================== Every Python example runs in TWO ways with no changes: 1. OFFLINE (default): no Worker, no key, no Telegram. It uses AgentGate.local(...), which applies the same rules as the real server, and approves automatically so you can see the whole flow in a few seconds. 2. LIVE: set two environment variables first and the very same file talks to your real Gatesi: AGENTGATE_URL = https://agentgate.YOURNAME.workers.dev AGENTGATE_KEY = agk_... (Keys tab in the viewer) Approvals then arrive on your phone. In Colab, one cell per example: import urllib.request, os BASE = "https://agentgate.YOURNAME.workers.dev" def get(name): req = urllib.request.Request(BASE + "/" + name, headers={"User-Agent": "Mozilla/5.0"}) open(name.split("/")[-1], "wb").write(urllib.request.urlopen(req).read()) get("sdk/agentgate.py"); get("examples/_common.py"); get("examples/local_test.py") # for LIVE mode, also: os.environ["AGENTGATE_URL"] = BASE; os.environ["AGENTGATE_KEY"] = "agk_..." %run local_test.py Files local_test.py the simplest tour: allow, deny, approve, budget (offline) python_function.py protect your own functions with @gate.tool openai_loop.py an OpenAI-style tool-calling loop using gate.dispatcher (model is simulated) anthropic_loop.py an Anthropic-style tool_use loop using gate.dispatcher (model is simulated) langchain_tool.py @tool over @gate.tool (needs langchain-core; skips itself if it is not installed) js_example.mjs the same ideas in JavaScript (needs agentgate.mjs next to it; Node 18+) web_request.sh plain curl, any language can do this