Stop Building Your Own Agent Foundation: A Five-Way Comparison of Official Agent Runtimes - OpenAI, Anthropic, Google, and xAI Are All Free to Take
Stop building your own agent foundation: a five-way comparison of official agent runtimes from the embed-into-your-product perspective. OpenAI Codex Harness (111,646★ Apache-2.0; three entry points, thread resume, structured output - the most complete platform story) / Anthropic Claude Agent SDK (7,951★ MIT; the finest allowed_tools + can_use_tool permission model) / Google Gemini CLI (106,608★ Apache-2.0; -p headless with JSON/JSONL output and disciplined exit codes - smoothest scripting) / xAI Grok Build (25,860★ Apache-2.0; Rust TUI + headless + ACP, the newest) / OpenHands (84,748★ MIT; the only whole-platform open source). Two comparison tables (basics + six embedding capabilities), five scenario routes, and three traps (the claude-code main repo's 142,324 stars carry no open license; open Harness does not mean free models; protocol lock-in doubles migration cost per level). All stars via GitHub API on 2026-08-22; representative comparison, not a hands-on bake-off.