The AI-Native Company

Deep dive 1 of 5: the loop

One agent, one job, run until the result checks out.

The short version

An agent is a prompt, a model and tools, running in a loop until a job is done.

In the example, someone asks an agent to fix a broken link. Its first edit has a typo. A test catches it, it goes round again, and the test passes. A person gets the fixed page and the evidence. Two more jobs show the other endings: one hits its limit on tries, and one stops to ask a person.

The five steps, in words

Prompt
The input. The job in plain words, and any rules for doing it.
Model
The part that reads and decides. On its own, it can only write.
Tools
What it acts with, such as reading a file or running a test.
Loop
The model picks a tool, the tool runs, and the result goes back. This repeats until a check passes, a limit is hit, or it needs a person.
Output
The result and the evidence for it, handed to a person.

Two loops, three exits

The example above shows one loop. In practice there are two, one inside the other, and each has its own cap. Spotify reported 10 turns per session and 3 session retries for its first version (2025-11).

Around the run the harness

Inside a run the agent

ContextRead the task and what the next step needs
ActDo one piece of the work by calling a tool
VerifyRun a check that is able to fail
not yet: feed the failure back and go again

The agent repeats until it stops calling tools or hits the turn cap.

The harness runs the done check and may start another run, up to the retry cap.

DoneThe check passes, with evidence
StopA cap is hit, or progress stalls
AskIt needs a person, and says so

In this model, every exit ends the same way: a draft plus evidence goes to a named person. Not every company works like this. StrongDM, in the table below, states that people neither write nor review the code.

The loop is the cheap part

Anthropic's definition: "LLMs using tools based on environmental feedback in a loop" (2024). The loop itself is cheap: Thorsten Ball builds one in under 400 lines of Go (2025-04). The leverage is in the tools, the context and the check.

How other companies do it

Most accounts end in a PR for a person, and StrongDM does not. Who decides done varies: a fixed gate, a second model or the worker itself. Five of the ten below publish a numeric cap.

All company-reported, and we saw no published defect rates. Anthropic, OpenAI, Vercel and Factory also sell what they describe.

CompanyThe loopThe checkThe limitThe person
StripeMinions, 2026-02Blueprint mixes fixed steps (lint, push) with agent stepsLocal lint, then CIRetries: 1 send-back (2 CI rounds), then back to the engineerReviews before merge
SpotifyHonk, 2025-12Agent calls a verify tool. A stop hook runs all verifiers before a PR can open.Verifiers chosen by repo contents, plus a judge comparing diff to promptTurns: 10 per session, 3 session retries, in the first version. Current cap not published.Owning team merges
VercelAI SDK factory, 2026-08Triage, analysis, build and review stations, each in its own sandboxA probe that fails before the fixRetries: its template allows 2 revision cycles, then halts with no PRA person approves every merge
AnthropicClaude Code, docsGather, act, verify. Ends when a response has no tool calls.Tests, stop hooks, a fresh reviewer sessionNone by default. Docs advise starting over after 2 failed corrections.Docs ask who signs off before an unattended run
StrongDMThe counterexample, 2026-02Agents write and test until scenarios convergeHoldout scenarios the builder cannot see, with a satisfaction scoreUntil scenarios pass. No number published.States that people neither write nor review the code
Five more companies, and further reading
CompanyThe loopThe checkThe limitThe person
EveryCompound engineering, 2025-12Plan, work, review, compound. Lessons go to files later runs read.Parallel review agents, browser testsRetries: 3 CI fix attempts, then it lists what failedPlans and reviews, about 80% of feature-building effort
OpenAICodex, Symphony, 2026Agent builds, reviews its own change, asks other agents to review, and iteratesTests, builds, browser driving, logs, custom lintersTurns: Symphony runs 20 per invocation and restarts on stallNot confirmed. A separate OpenAI post on Symphony says people review results.
ShopifyRiver, 2026-05Builds, tests, runs simulators, opens a PR. On failure, reads logs and retries.Tests, simulators, screenshotsNo number published. Security flow ends fixed, rejected or escalated.Code owners review and merge
RampInspect, undated. From earlier repo notes; our search saw only the intro.A full dev VM. Pushes a branch and opens a PR.Tests, telemetry, flags, screenshotsNot publishedRequester's token opens the PR, and a colleague can take over
FactoryMissions, undatedWrites testable assertions first, then a worker per feature in a clean sessionFresh validators at each milestone, separate from the buildersEnds when validation passes. Retry default not found.Plans up front. Merge role not detailed.
  • Airbnb: 97% of about 3,500 test files, a state machine with per-step retries (date not established).
  • Google: migrations with fixed search, model edits and build-test-repair (2025-01).
  • Cursor: planners and workers at large scale (2026-01).
  • Anthropic's C compiler run: a bash loop, 16 agents, about USD 20,000, a research prototype (2026-02).
  • Linear Loops: a trigger wrapper; our search found no documented check (2026-07).
  • GitHub's coding agent: 59 minutes maximum on Actions-based sessions (as of 2026-10-30).

Frameworks we can use

They all have a loop. They differ on who approves mid-run, what survives a crash, and whether you are locked to one model vendor.

Of the framework docs, only Anthropic's and GitHub's were on our fetch allowlist. Other rows come from search summaries of official docs, so check option names before use. Default caps use different units, and licenses were not confirmed. Claude, made by Anthropic, drafted this page.

NameRun the loop withWhat stops itA person approves withIf the process diesModel lock
Claude Codeheadlessclaude -p, /goal, Stop hooks--max-turns (no limit by default), --max-budget-usd--permission-prompt-tool. Otherwise calls needing approval are denied.--resume. You restart it.Claude models, direct or through a cloud provider. See its terms.
OpenCodeopen-source CLI, as of 2026-11-01opencode runsteps per agent. No limit by default, per the v1 docs. In v2 the last step removes tools and asks for a summary.Permission rules: allow, ask or deny. --auto approves all but explicit denials. The docs do not say what run does on ask.--session or --continue. Automatic restart not confirmed.None seen. 75+ providers and local models.
Claude Agent SDKinside your own programquery()max_turns, max_budget_usd. No limit by default.canUseToolYou resume it with the session id.Claude models
Pydantic AIPython libraryAgent.run(), agent.iter()UsageLimits, default 50 requests, with a cost limitDeferredToolRequests, with no live processTemporal, DBOS or PrefectNone seen
LangGraphthe flow as a graphA graph, or create_agentrecursion_limit, default 10,007 steps from library 1.1.4 (10,011 on Agent Server). Call-limit middleware.interrupt()Checkpoints. The node reruns from its start.None seen
Temporala durable layer under any loopYour loop in a WorkflowYour code, plus framework capsAn Update, or a Signal per the TypeScript docs. Waits survive restarts.Replays history and continuesNone. You run or buy it.
Ralpha technique, not a frameworkA bash loop feeding one prompt to any CLI agentAn optional iteration count in the reference script (no cap if omitted), or Ctrl+CNone in the loopLoses one pass. State is in files and git.None
Twelve more frameworks
NameRun the loop withWhat stops itA person approves withIf the process diesModel lock
CodexCLIcodex exec, /goalGoal token budget, in the App Server API only. A max-turns flag was not established.--ask-for-approval. In codex exec, an action needing new approval fails rather than waits.codex exec resumeModel default not confirmed
goosegoose run with recipesGOOSE_MAX_TURNS, default 1000. Recipe retries and checks.GOOSE_MODE. Cannot ask when headless.goose session --resumeNone seen
PiagentLoop, agent.prompt()No cap in core. beforeToolCall can end the run.Build your ownJSONL sessions. Durable package is experimental.None seen
OpenAI Agents SDKRunner.runmax_turns. Reference pages show 10.needs_approval, then resume from RunStateSaved RunState. Temporal integration.Soft
Vercel AI SDKToolLoopAgent, generateTextstopWhen. Default 20 steps for ToolLoopAgent.toolApproval. WorkflowAgent uses needsApproval.Lost in memory. WorkflowAgent survives.None seen
MastraAgent.generate()maxSteps, default 5. stopWhen.requireToolApprovalWorkflow snapshots, Inngest agentNone seen
smolagentsagent.run(), agent.step()max_steps, default 20. final_answer_checks.No approval option foundNot establishedNone seen
Google ADKRunner. LoopAgent is giving way to Workflow.max_iterations, max_llm_calls default 500require_confirmationResumabilityConfig, in Python and Kotlin docsAgent Config docs say Gemini only
Microsoft Agent FrameworkAgent, AgentLoopMiddlewareAgentLoopMiddleware default 10 runs. Tool roundtrips default 40.always_require on a toolWorkflow checkpoints, durable agentsNone seen
CrewAIAgent inside a Crewmax_iter, default 20 or 25 (its docs disagree)human_input, @human_feedback@persist on a FlowNone seen
Inngeststep.run() in a plain loopYour loop bound, or AgentKit maxIterstep.waitForEvent()Saved steps.None seen
Cloudflare AgentsAgent on a Durable ObjectmaxSteps, default 10 in ThinkneedsApproval, waitForApproval()runFiber recoveryWorkers AI, OpenAI and Anthropic bindings listed. Runs on Workers.

Not covered, because their docs could not be read here: Aider, Cline, Gemini CLI, Strands Agents, LlamaIndex, Letta and AutoGen. Read in part: GitHub Copilot SDK and OpenHands SDK. Many teams skip frameworks: 17 of 20 case studies built custom loops on direct API calls, though 61% of survey respondents used a framework (2025-12).