Almost every engineering team uses AI agents today — ChatGPT or Kimi in the browser, Claude Code or Codex CLI in the terminal, Copilot inside an IDE. As long as a human sits in front of the screen typing prompts and reading output, off-the-shelf tools already feel remarkably smooth.
The real fork in the road appears at the next step: how do you wire agent capabilities into your own production systems? Think of running an automated security review on every pull request in CI and writing verified findings into a vulnerability database, or triaging alerts autonomously inside an operations platform. Clicking through a UI by hand obviously will not scale. Writing an agent loop from scratch on top of a raw model API quickly drags the team into a swamp of context compaction, permission gating, and sandbox isolation. Meanwhile, dozens of repositories marketed under the "Agent SDK" banner turn out to be fundamentally different beasts under the hood.
Over the past several months, we audited official documentation and source code across more than a dozen leading vendors and open-source projects, while building a swappable runtime abstraction layer for our own production workloads. Here is the architectural breakdown and selection playbook that emerged.
The Model Is Just the Reasoning Kernel — The Runtime Is the Engine
Many teams starting their first integration reduce an agent to "an LLM API plus a system prompt and a handful of tool functions." Open up any mature agent product, however, and a different picture emerges: the model only makes single-step reasoning decisions. What carries it across long, messy engineering tasks is the outer Agent Runtime — widely referred to across the industry as the Harness.

Microsoft offers a clean definition: an Agent Harness is the complete runtime scaffolding required to turn an LLM into a dependable agent. Anyone can wire up a basic "model decides → call tool → feed result back" Agent Loop in half a day. Crossing the chasm from demo to production, however, means clearing at least five engineering hurdles outside that loop:
- Automatic context compaction: After dozens of tool calls, conversation history blows past the context window; the runtime must distill prior turns while preserving key evidence — the single most common failure point in long-horizon tasks.
- Multi-tier permission gating: When a model attempts
rm -rfor outbound network access, the runtime must enforce rules to auto-allow, pause for approval, or block execution outright. - State persistence and file rollback: Crashed processes need checkpoint recovery to resume mid-run, and workspace files corrupted or deleted by the model must be restorable from snapshots.
- Full-fidelity event observability: Every reasoning step and tool invocation must stream out as structured events; otherwise production debugging and compliance audits have no trail to inspect.
- Sandboxed side effects: Command execution must stay confined inside OS-native sandboxes or containers rather than letting the model mutate the host machine unchecked.
Seeing this layer clarifies what an Agent SDK actually does. If a human-facing agent product puts you in the driver's seat with hands on the wheel, an Agent SDK is the engine's drive-by-wire interface. It is the exact same vehicle — only now your application code is steering.
This pattern surged across the industry in 2026 because leading vendors converged on the same architectural move: extracting their product's internal runtime into a programmable engine. Anthropic positions the Claude Agent SDK plainly as "Claude Code as a library", while the Codex SDK spawns its CLI and exchanges JSONL events over stdin/stdout. The delivery boundary of an agent has expanded from a human user interface to a systems-level programming interface.
Three Routes to Production Integration
Take a concrete engineering goal: automatically reviewing pull requests for security flaws in CI and emitting structured reports. Teams typically face three integration routes:

Route A: Use an off-the-shelf agent product directly. Ideal for the first two weeks of discovery. Engineers invoke a CLI manually or stitch together lightweight webhooks and RPA scripts, validating with near-zero code whether an agent can catch real vulnerabilities. The ceiling arrives fast: outputs are free-form prose meant for human eyes, execution is a black box, source code leaves your trust boundary for vendor clouds, and what scrapes by at a dozen PRs a day collapses at thousands.
Route B: Build in-house on raw model APIs. What you buy here is total control and unrestricted model choice. When a workflow genuinely consists of a fixed two- or three-step tool chain, calling the model API directly remains the cleanest answer. What teams chronically underestimate is the hidden engineering debt once tasks turn into multi-turn autonomous exploration: context compaction, three-state permission gating, file-level rollback, sandboxing, and subagent spawning all become yours to build and maintain. Add code-specific plumbing like repository indexing, patch application, and Git coordination, and reaching parity with an existing runtime's baseline takes an optimistic two to three engineer-months — merely to match feature existence, not battle-tested edge cases.
Route C: Drive an existing Runtime through an Agent SDK. This has become the main highway for production scale in 2026. Pick a proven coding runtime, and your host application owns just four responsibilities: open a session, dispatch the task, consume the event stream while handling approvals, and collect schema-validated output:
session = backend.create_session(workspace="./repo")
async for event in session.run("Audit this PR for security risks", output_schema=FindingList):
if isinstance(event, ApprovalRequest): # Gated action triggered; your policy engine decides
await session.approve(event.id, decision=policy.check(event))
elif isinstance(event, ToolCall): # Full execution trace streams out as an audit log
evidence_log.append(event)
result = event.result # Schema-validated object, ready for DB ingestion
You trade away some low-level control and release cadence in exchange for shipping in days atop a battle-hardened headless automation contract.
| Dimension | A. Off-the-Shelf Product | B. DIY on Raw Model API | C. Agent SDK + Runtime |
|---|---|---|---|
| Engineering effort | ≈ 0 | High, 2–3+ engineer-months | Low, days |
| Structured output & audit | ❌ Free-form prose black box | ✅ Must build end to end | ✅ Built-in event stream & schema |
| Permissions & sandbox | Manual UI prompts | Must build in-house | ✅ Native to the runtime |
| Model freedom | Locked to product | ✅ Swap any model freely | Depends on runtime |
| Best fit | Early value validation | Fixed short flows / deep custom constraints | Most scaled production systems |
In practice, the strongest rollout combines all three: validate value with Route A during discovery, cut over to Route C to carry production traffic at scale, and use Route B surgically where an existing runtime truly cannot fit. Even more important is wrapping Route C in a thin adapter interface of your own, turning "swap the underlying runtime" from an application rewrite into a one-line config change. In our production benchmarks, running the exact same model under a different Runtime lifted vulnerability detection pass rates from 40% to 90%.
Inside the Thin Client: What Your Code Actually Controls
Engineers reading the source code of a Coding Agent SDK for the first time are often surprised by how thin it is. Most of these SDKs contain no agent loop at all. They do just three things: spawn a standalone Runtime child process, exchange messages over a pipe, and deserialize JSON events into native language objects.

Two architectural realities follow directly from this design:
First, the Agent Loop runs in an isolated child process, not inside your application process. That boundary is the fundamental line separating a Route C client SDK from a Route B orchestration framework. Because reasoning deltas, tool calls, and gated pauses like ApprovalRequest all stream out in sequence, persisting that stream verbatim gives the host system a complete forensic evidence chain out of the box.
Second, day-to-day integration speaks each vendor's private wire protocol, not MCP. Claude's stream-json, Kimi's Wire, Codex's app-server JSON-RPC, and MiniMax's headless event contract are mutually incompatible. Open standards like MCP and A2A govern peripheral ecosystem connectivity; how a host program commands its Runtime remains a patchwork of proprietary dialects.
The Eight-Layer Ecosystem Map: Stop Comparing Parts Kits to Full Vehicles
The hardest part of Route C is not writing integration code — it is avoiding category errors caused by messy naming. Repositories labeled "Agent SDK" today lump together three completely different things: in-process orchestration parts kits such as OpenAI Agents SDK and Google ADK, thin clients that remote-control a standalone runtime such as Claude Agent SDK, Codex SDK, and Kimi Agent SDK, and plain HTTP model wrappers that do not even run a loop.
Splitting the ecosystem into eight layers by responsibility clears up most of the confusion immediately:

With this map in view, the most common selection traps are easy to sidestep:
- L5 ≠ L6 is the defining architectural boundary of the year. Over the past twelve months, major L5 frameworks have been building upward to ship official Harness layers — LangChain introduced Deep Agents, Microsoft shipped HarnessAgent, and AWS released
strands-harness. LangChain's documentation states the hierarchy plainly: LangGraph is the graph runtime,create_agentis a minimal harness, and Deep Agents is the batteries-included full harness. Comparing Google ADK against the Claude Agent SDK is a cross-layer category error from the start. - Do not assume Codex is built on top of the OpenAI Agents SDK. The two share zero lines of code. Codex is a self-contained Rust runtime written from scratch, and OpenAI's official guidance recommends using the outer Agents SDK to orchestrate Codex underneath.
- Anchor core business assets in L7, never hard-wired to a single L6 vendor. L6 provides domain-agnostic shell execution, file operations, sandboxing, and approvals; your domain instructions, evidence schemas, and business tools belong in L7. A useful corollary follows: pure model providers at L2 need no custom adapter at all. As long as an L6 runtime allows custom endpoints, changing an environment variable lets GLM run inside Claude Code. The adapter layer you actually need to build always sits above L6.
- Never mistake a billing plan for a runtime, or treat "open source" as a binary checkbox. A branded "Coding Plan" is a pricing bundle, not proof of an independent Runtime. Within open source, engineering trust varies wildly across "closed CLI + open-source glue SDK," "full-repo Apache-2.0," and "reluctantly open-sourced after community pushback."
Ten Runtimes Audited — Plus Five Hidden Fault Lines
With the layer map established, we audited source code and documentation across ten major vendors and open-source runtimes side by side:
| Vendor / Camp | Layer Position | Integration Entry | Key Facts & Selection Caveats |
|---|---|---|---|
| Anthropic | L6 benchmark | Agent SDK (Py / TS) | Broadest capability surface: 25+ hooks, three-channel permissions, file-level checkpoints, json_schema output; hard trade-off is strict lock-in to Claude models, and production pinning requires locking both SDK and CLI versions |
| OpenAI | Dual independent L5 + L6 | Codex SDK / codex exec |
Full Codex repo under Apache-2.0; native sandboxing across three policy tiers × three major OSes; routes approvals to an independent Reviewer Agent; shipped Codex Security validating vertical security agents |
| Moonshot / Kimi | L6 peer contender | Agent SDK / Wire protocol | Full CLI under MIT; model-agnostic across 6 provider types; sessions stored as fully replayable event logs; target the underlying Wire protocol directly in production |
| Zhipu GLM | L2 core + early L6 | headless stdio | Core focus stays at the model layer with a "plug into someone else's Harness" strategy; Coding Plan is a billing tier with commercial terms restrictions; no standalone versioned official Agent SDK yet |
| MiniMax | L6 without standalone SDK | mcode exec / mcode acp |
Internal plugin SPI is not a stable public API; only two process-level CLI commands form the official external contract, so design around child-process execution |
| Split L5 / L6 repos | ADK / gemini-cli headless |
ADK and Gemini CLI live in separate repositories; gemini-cli-sdk remains in nightly builds while stability converges |
|
| Microsoft | Official L5 + L6 kit | MAF HarnessAgent | Most complete official toolkit for assembling a custom Harness; VS Code natively hosts multiple Harnesses side by side, supporting session handoff across four runtimes |
| AWS | Two-tier L5 + L6 reference | Strands SDK + harness | Clean two-tier split between low-level SDK and turnkey upper harness, mirroring the "generic runtime ↔ domain assembly" architecture |
| DeepSeek | Entering L6 from L2 | dsh SDK / headless |
Full MIT repo, plugin-driven throughout; append-only event-sourced logs suit compliance auditing; still in Developer Preview, session telemetry defaults to on and must be disabled manually, and its sandbox does not restrict network access |
| Open Source | L6 duo + L5 foundation | Project-native SDKs | OpenHands comes closest to a full platform spanning local, Docker, and K8s with solid isolation; OpenCode offers polished terminal UX and fine-grained permissions but zero sandbox abstraction; LangGraph is a lower-layer orchestration substrate rather than an L6 peer |
After testing 34 granular capabilities across these options, we found five make-or-break fault lines hidden beneath the sea of checkmarks on marketing pages:
- How custom tools are injected: Claude, Kimi, and OpenHands all let you register in-process tool functions directly in code; Codex SDK alone offers no custom tool API, requiring external MCP servers instead. Your tool architecture is set the moment you pick a runtime.
- Generational gaps in Skills support: Several runtimes claim Skills compatibility, yet some only scan static local directories with no programmatic injection, others parse only the five base frontmatter fields, and only a few implement full progressive disclosure.
- A steep gradient in sandbox isolation: Three policy tiers × three OS-native sandboxes in Codex > dual-OS native sandboxing in Claude and MiniMax > container-grade isolation in OpenHands > interface without implementation in Kimi > none at all in OpenCode. Teams running high-risk code or security workloads can rank candidates directly along that order.
- Two very different meanings of "Checkpoint": One is file-level workspace rollback that restores corrupted code in a single step; the other is merely session state persistence for resuming an interrupted process. Many frameworks advertising checkpoints only deliver the latter.
- What makes a headless contract production-grade: Calling an L5 library "embeddable" means nothing; what production automation actually needs is a formal contract combining streaming JSON events + deterministic exit codes + enforced output schema validation — a bar cleared so far only by top-tier L6 runtimes.
Converging Open Protocols, the Skills Standard, and Three Final Questions
Outside those proprietary control pipes, the surrounding open ecosystem finished converging in 2026 — one clear standard has emerged in each of the four directions, leaving little reason to wait or reinvent wheels:

Southbound to tools and data sources sits MCP, whose transports have settled on stdio and stateless Streamable HTTP. East-west collaboration across systems and organizational boundaries belongs to A2A under the Linux Foundation — unnecessary overhead for single-machine, in-process coordination. Northbound into code editors runs ACP, initiated by Zed to standardize agent sessions much like LSP did for language servers. Streaming state synchronization to web and desktop frontends is handled by AG-UI.
Among lightweight portable assets, Skills represent the highest-certainty standard in the stack. Packaged as a directory centered on SKILL.md, Skills save massive context budget through three-tier progressive disclosure — resident metadata first, full instructions on task match, bundled reference files and scripts on demand — with roughly 80 clients already integrated. Keep one hard rule in production: write core instructions strictly within the portable standard subset, because vendor-specific extension fields remain fragmented; meanwhile, audit scripts/ directories rigorously as arbitrary code execution in your supply chain.
Looking two to three years ahead, expecting an OCI-style universal Runtime specification is unrealistic. Every standard that has succeeded so far covers peripheral lightweight assets, whereas the L6 Harness has become each vendor's second moat beyond model weights — nobody has an incentive to commoditize their own engine. What is actually forcing runtime portability into existence is upper-layer product practice, exemplified by VS Code hosting multiple Harnesses side by side and handing live sessions across them.
Which brings us back to the opening question. An engineering team choosing its stack today really only needs clear answers to three questions:
- Which layer does the current workload actually need? Use off-the-shelf products to validate value, build directly on raw model APIs for fixed two- or three-step calls or extreme custom constraints, and drive a proven Runtime via SDK for scaled production systems.
- Where do your business assets live? Always in L7, above any generic Runtime. Models turn over every six months and Runtimes reshuffle every year; domain knowledge, evidence schemas, and business toolsets are the only assets that compound across migrations.
- Can you swap the Runtime tomorrow at low cost? That depends not on which vendor looks strongest today, but on whether you placed a thin Backend abstraction of your own atop Route C. Betting the house on a single Runtime carries the exact same lock-in cost as hard-wiring core services to one cloud provider's proprietary APIs — a decoupling lesson far cheaper to build in early than to retrofit later.
