API keys prove identity. Payments prove economic intent. Neither proves the system on the other end can actually reason, follow rules, or act responsibly. GOTCHA does.
API keys and payment protocols gate access based on credentials and money. But a funded wallet and a capable agent are different things. Some actions need proof that the requester can think, not just spend.
GOTCHA is built into the HTTP 401 challenge-response flow. No accounts, no dashboards, no onboarding. Just a protocol that any server can speak and any agent can answer.
Middleware forwards metadata to GOTCHA. The server fingerprints the harness, checks reputation, and decides: admit, challenge, or deny.
Agent receives an LLM-generated reasoning task. Context documents with contradictions or ambiguities. Every challenge is unique.
The agent's LLM reads and answers. The SDK handles this transparently — the agent's main context is never polluted.
Claims extracted from the answer are compared semantically against ground truth. LLM extracts, code judges. Injection-resistant.
Passing agents get a signed receipt. Subsequent requests skip the challenge. Time-limited, stateless, cacheable.
A search endpoint and a purchase endpoint don't need the same security. Set the tier based on what happens if the wrong system gets through.
| Tier | Behavior | Use case | Receipt TTL |
|---|---|---|---|
| open | Admits if metadata looks reasonable | Public read endpoints | 60 min |
| standard | Admits known agents, challenges unknown | Authenticated API access | 30 min |
| elevated | Always challenges unless valid receipt | Actions with side effects | 15 min |
| critical | Always challenges with high difficulty | Payments, deletions, admin | 5 min |
Add GOTCHA middleware to your server the same way you'd add CORS or rate limiting. The middleware handles assessment, challenges, and receipts. Your route handler only sees verified agents.
import { gotcha } from "@gotcha/sdk/middleware/express"; app.use("/api", gotcha({ apiUrl: "https://gotcha.example.com", apiKey: process.env.GOTCHA_API_KEY, action: "api.read", tier: "standard", })); app.get("/api/data", (req, res) => { // Only verified agents reach here res.json({ data: "protected" }); });
User-Agent, IP, headers, method, URL, timestamp from the incoming request.
POST /gotcha/assess with the metadata and your chosen action tier.
Admit → attaches receipt, calls next(). Challenge → returns 401 with challenge. Deny → returns 403.
The SDK wraps fetch and handles challenges transparently. Your agent calls an API. If it gets challenged, the SDK solves it with your LLM, gets a receipt, and retries. Your agent's main task context never sees the challenge.
import { createGotchaFetch } from "@gotcha/sdk"; import Anthropic from "@anthropic-ai/sdk"; const anthropic = new Anthropic(); // Create a GOTCHA-aware fetch const fetch = createGotchaFetch({ gotchaUrl: "https://gotcha.example.com", solve: async (challenge) => { const msg = await anthropic.messages.create({ model: "claude-sonnet-4-20250514", max_tokens: 500, messages: [{ role: "user", content: challenge.payload.prompt }], }); return msg.content[0].text; }, }); // Use it like normal fetch — challenges handled transparently const res = await fetch("https://api.example.com/data"); const data = await res.json();
Claude, GPT-4, Gemini, Llama, Ollama. The solve function is prompt in, text out.
Challenges are solved in an isolated LLM call. Your agent's main context never sees them.
Signed, time-limited, cached. After the first challenge, every subsequent request is instant.
Every challenge produces a score across six dimensions. Over time, this builds a reputation — a portable proof of what your agent can do and how reliably it does it.
Response latency. Fast but plausible. Under 100ms is suspicious.
Factual correctness vs server-side ground truth.
Right tools, right order, right inputs.
Adherence to constraints. Word limits, budgets, rules.
Graceful handling of broken endpoints and bad data.
Stable behavior across repeated challenges.
GOTCHA fingerprints 18 agent harnesses from User-Agent headers, expected headers, and behavioral patterns. Known agents get easier challenges. Unknown agents prove themselves through capability.
| Harness | Trust |
|---|---|
| Claude Code | high |
| Cursor | high |
| OpenAI Codex CLI | high |
| GitHub Copilot | high |
| Windsurf | high |
| Cline | medium |
| Devin | medium |
| Augment Code | medium |
| LangGraph | medium |
| Google ADK | medium |
You don't need to be on a list. Any agent with an LLM can pass. Recognition gives you a faster path, not the only path. Build something new, prove it works, earn trust.
Every passed challenge raises your trust score. Higher trust means lower difficulty and faster admission on future requests. Consistent failures increase difficulty. Your track record is your credential.
The internet built tests to exclude automation. Now it needs tests to admit capable automation — and score it across dimensions that actually matter for trust.
Agents are already making payments, calling APIs, and acting autonomously. The infrastructure to verify they can pay exists. The infrastructure to verify they can think doesn't. GOTCHA is that infrastructure.
Open protocol. Open SDKs. Works with every LLM, every agent framework, every language.