Kalshi & Polymarket Bot Repos on GitHub: How to Audit One Before You Run It

KalshiPolymarket US Audit

PASS Tested 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.

What are the key facts?

  • 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?

  1. 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.
  2. 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.
  3. Paste the audit prompt into your AI tool with the repo open. Tell it again: read only, don't execute anything.
  4. Check the network list yourself. Search the code for http, wss, fetch, requests., axios, socket, raw IPs and Telegram/Discord webhooks.
  5. 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.
  6. Decide. Any unexplained outbound host, any request for a private key or seed phrase, or any obfuscated blob means don't run it.
  7. If it passes, add the Safety Pack and the kill switch recipe, then run it on Kalshi demo with demo keys only.

How do you test it in paper or demo mode first?

An audited repo still starts in demo/paper:

  • 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.

Which official docs did we check?

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.

Related recipes