Inspiration

Every gate on the internet asks the same question: are you human? CAPTCHA, Turnstile, "click all the buses." But the web is growing an agent layer — autonomous programs that call APIs, pay for services, and act on their owners' behalf. Services will want to serve agents differently: agent-priced APIs, bot fast lanes, machine SLAs. Nobody built the opposite door. So during Build Week, I did.

What it does

Turing Toll is a reverse CAPTCHA: drop-in middleware that gates API endpoints behind challenges that are trivial for AI agents but impossible for humans under the deadline.

  • POST /gate/challenge issues a procedurally-generated task — base64→hex→reverse decode chains, JSON aggregation queries, code-eval ("what does this print?"), regex extraction ("ISO dates falling on a Tuesday"), and multi-step protocols where each answer unlocks the next step.
  • Deadlines are server-measured, 1.5–4 seconds including your network round-trip. Type as fast as you want; you're already too late.
  • Pass and you get an Ed25519-signed capability token (15-min expiry, tiered). Streaks build tiers: 1 pass = bronze, 3 = silver, 5 including a protocol = gold.
  • One line of Express middleware gates any endpoint — humans get 402, verified agents get 200. Verification is a local signature check, no round-trip.
  • Every attempt streams to a live dashboard: passes, failures, per-kind solve times, and a leaderboard of graded agents.

Try it live (no setup): https://deploytest.theodoikenh.com — get a challenge with curl, fail it as a human, then run node solver/agent.js https://deploytest.theodoikenh.com you from the repo and watch yourself climb to gold on the dashboard.

How we built it

Built almost entirely by Codex CLI running GPT-5.6 Terra, spec-first:

  1. I wrote SPEC.md — product shape, all 5 challenge kinds, token format, tier ladder, test bar, zero deps beyond Express.
  2. One Codex session generated the server, all five procedural challenge generators, the Ed25519 token library (node:crypto), the exportable middleware, the SSE dashboard, the reference solver, and the node:test unit suite. npm test passed 3/3 on first run.
  3. The reference solver Codex wrote is the demo's "verified bot" — the tool's own author passes its gauntlet. solver/llm-agent.js closes the loop by delegating challenge reasoning to a GPT model at runtime.
  4. Human work: the concept and spec, a solver arg-parsing fix, VPS deployment (nginx + TLS + systemd), and verifying the human-fail path with my own too-slow hands (6.9s on a 2.7s deadline — graded FAIL, as designed).

Challenges we ran into

  • Deadline semantics. Measuring issue→answer server-side means network latency counts against the caller — we decided that's a feature (it prices in real-world agent conditions) and documented it rather than fighting it.
  • Human-impossibility calibration. The window has to beat fast typists on the easy kinds while staying comfortable for agents on multi-step protocols; per-kind deadline ranges solved it.
  • SSE behind nginx needed proxy_buffering off and an attempt-replay on connect so the dashboard is never empty for a fresh judge.

Accomplishments that we're proud of

  • A working, deployed, publicly testable piece of identity infrastructure for the agentic web — in one build session.
  • The demo is self-proving: judges can personally fail the gate, then watch an agent pass it in real time.
  • Zero dependencies beyond Express. Ed25519 straight from node:crypto. No DB.

What we learned

Spec-first prompting is the highest-leverage way to use Codex: one well-structured SPEC.md turned into a complete, tested, multi-component system in a single session. GPT-5.6 handled procedural generation and crypto plumbing flawlessly; the human's job was product judgment — what to build and where the hard edges (deadline semantics, tier ladder) should sit.

What's next for Turing Toll

  • Adaptive difficulty: challenge deadline tightens as an agent's tier rises.
  • x402 integration: pay-per-call APIs where the toll is the auth layer.
  • Public registry of gold-tier agent keys — a web-of-trust for autonomous programs.

Built With

Share this project:

Updates