PASSTested on Composer 2.5, , result: PASS.We ran this audit prompt read-only against a real public bot repo (warproxxx/poly-maker); the repo was never installed or executed. Verdict: DEMO ONLY AFTER FIXES (wallet private key, international CLOB). No keys, orders or money.
Short answer:Before you run a Kalshi or Polymarket bot from GitHub, audit it with no secrets on the machine. Look for requests for private keys or seed phrases, obfuscated code, install scripts that run code, network calls to unknown domains and auto-updaters. Expect only official hosts like external-api.kalshi.com or api.polymarket.us. This recipe gives you an AI-assisted audit prompt and checklist.
Rule zero: audit with no secrets present. Clone into a fresh folder with no .env, no key files and no wallet on the machine path the code can reach.
Biggest red flags: asks for a private key or seed phrase, obfuscated or base64/hex blobs, postinstall/setup.py code that runs on install, network calls to unknown domains, auto-updaters that download code.
Official API hosts to expect: Kalshi external-api.kalshi.com / api.elections.kalshi.com (and demo external-api.demo.kalshi.co / demo-api.kalshi.co); Polymarket US gateway.polymarket.us / api.polymarket.us. Anything else needs an explanation.
Check the trading logic too: hard limits, a kill switch, demo/paper default. A "safe" repo with no limits can still empty an account.
If you run it at all, run it on Kalshi demo with demo keys, or Polymarket US in paper/preview mode.
DifficultyBeginner
Time1–2 hours per repo
Cost$0
Works withClaude Code, Cursor, ChatGPT / Codex, Grok
What will you build?
A repeatable way to decide whether a bot repo is safe enough to even try on demo, using your AI tool as a second pair of eyes without giving it or the repo any real keys.
Who is it for?
Anyone about to clone a trading bot from GitHub, a YouTube description or a Discord link.
What prompt do you paste into your AI coding tool?
Works in Claude Code, Cursor, Codex/ChatGPT, Grok or any agent that can write files. Paste it into an empty folder. Read what it builds before you run anything.
Security-audit this trading bot repository. Do NOT run, install or build
anything. Do not execute any scripts, package installs, or tests. Read only.
First, identify the platform: Kalshi, Polymarket US (API keys), or
international Polymarket CLOB (wallet private key). Many "Polymarket bots"
are the international, wallet-based kind. Judge every host against the
official docs of the platform the repo actually uses (for international
Polymarket, docs.polymarket.com).
Report, with file paths and line numbers:
1. Secrets handling: where does it read API keys, private keys, seed
phrases or wallet files? Does it ever send them anywhere, log them, or
ask the user to paste them into a prompt, form or chat?
2. Network: list EVERY outbound URL/host/IP and websocket. Mark each as
official (Kalshi: external-api.kalshi.com, api.elections.kalshi.com,
external-api.demo.kalshi.co, demo-api.kalshi.co, and their -ws hosts;
Polymarket US: gateway.polymarket.us, api.polymarket.us) or UNKNOWN.
Explain every UNKNOWN.
3. Code that runs at install or import: package.json scripts
(preinstall/postinstall), setup.py/pyproject build hooks, __init__.py
side effects, Makefiles, shell scripts, Dockerfiles, GitHub Actions.
4. Obfuscation: base64/hex blobs, eval/exec, dynamic imports, minified
files, downloaded code, auto-updaters.
5. Dependencies: list them; flag typosquats, unpinned git URLs, and
anything unusual for a trading bot.
6. Trading safety: is there a demo/paper default? Hard limits enforced in
code? A kill switch? A cancel-all path? Retry loops that could spam
orders? Does it use current endpoints (e.g. Kalshi
POST /portfolio/events/orders)?
7. Terms: does it trade for other people, copy other traders, resell or
republish exchange data, or get around geoblocks? (Kalshi's Developer
Agreement and Polymarket's geoblock rules.)
Finish with a verdict: DO NOT RUN / DEMO ONLY AFTER FIXES / OK FOR DEMO,
and the exact fixes needed.
How do you build it, step by step?
Clean room. Clone into a fresh folder on a machine (or container) with no keys, no .env and no wallet files reachable. Don't run npm install or pip install yet.
Scan for committed secrets:gitleaks git -v in the repo. Leaked keys in a public bot repo are a sign of sloppy authors, and sometimes of bait.
Paste the audit prompt into your AI tool with the repo open. Tell it again: read only, don't execute anything.
Check the network list yourself. Search the code for http, wss, fetch, requests., axios, socket, raw IPs and Telegram/Discord webhooks.
Read install hooks by hand:package.json scripts, setup.py, pyproject.toml, any .sh. Code that runs on install is the classic malware entry point.
Decide. Any unexplained outbound host, any request for a private key or seed phrase, or any obfuscated blob means don't run it.
Kalshi bots: point them at https://external-api.demo.kalshi.co/trade-api/v2 with fresh demo keys. If the repo can't be pointed at demo, that's a design red flag.
Polymarket US bots: run against a local paper ledger, or use POST /v1/order/preview with a fresh key you can revoke at polymarket.us/developer.
Anything wanting a crypto wallet private key for a "US" bot isn't using Polymarket US's API, which uses API keys, not wallets. Be suspicious.
What safety checks does it need before real money?
Tick every box before the bot touches real money. The full rules file, .gitignore and pre-commit hook are in the Safety Pack.
Key handling: API keys and private-key files live in environment variables or a secrets manager. Never in code, prompts, chat logs, screenshots or git. .env and *.pem are in .gitignore, and your AI tool is blocked from reading them (see the Safety Pack).
Position limits: hard caps in config (max contracts per order, max total exposure, max daily loss). The bot refuses any order above them, and the caps are checked in code, not just in the prompt.
Kill switch: one command or one file (touch KILL) stops new orders immediately, and a second command cancels every resting order through the venue's cancel-all endpoint.
Paper first: paper or demo mode is the default. Live trading needs an explicit --live flag and a typed confirmation, and you only flip it after days of clean paper logs.
Audit with no secrets present. Your AI tool and the repo both stay away from real keys.
Never paste a private key or seed phrase into a bot, a website, a Telegram bot or a "configuration wizard."
Use a separate, revocable API key for any third-party code, and revoke it the moment something looks off.
Endpoints and rules were checked against these pages on Oct 19, 2026. APIs change, so if something here disagrees with the official docs, trust the docs and tell us.
Frequently asked questions
Are Kalshi and Polymarket trading bots on GitHub safe?
Some are fine; some are sloppy; some can be malicious. A public repo can steal keys through install scripts, hidden network calls or obfuscated code. Audit before you run, start on demo or paper, and never hand over a private key or seed phrase.
What's the biggest red flag in a trading bot repo?
Asking for a private key or seed phrase, especially in a form, chat or config wizard, and any network call to a host that isn't the exchange's official API. Obfuscated code and install-time scripts come next.
Can my AI coding tool audit a repo for me?
It's a strong second pair of eyes, especially with a structured prompt like ours, but it can miss things. Tell it to read only and never execute, check the network list yourself, and don't keep real keys on the machine during the audit.
The Daily Bot Recipe
One new build recipe, one safety tip, and API changes worth knowing about. Free. No picks, ever.
A copy-paste AI prompt and step-by-step guide to the Polymarket US API: public market data with no key, then authenticated reads. Includes the international Gamma API, read-only, with a geoblock check.
Step-by-step: use Claude Code to build a Polymarket US trading bot that runs in paper mode by default, with a local paper ledger, order preview, hard position limits and a kill switch.
Get started with the Kalshi API using an AI coding tool: public market data with no key, then RSA-PSS or Ed25519 signed requests against the Kalshi demo environment. Endpoints checked against the official docs.