agents/prod
11
Practice · Chapter 11

How AI agents are actually used

Enough theory — this chapter is what real agents do, how they're built under the hood, and what happened when big companies shipped them. The headline: over 56% of developers now use AI coding tools daily. But the interesting part is that they're all the same handful of primitives from the last ten chapters, rearranged.

1 · Coding agents — win by self-verifying

Coding is where agents got real first. Claude Code lives in the terminal with file/shell/git access, navigates by grepping and reading files, and — crucially — runs the tests to verify its own work before committing. (Strikingly, only ~1.6% of its codebase is AI decision logic; ~98.4% is deterministic infrastructure.) Cursor builds a semantic index of the repo; Devin works autonomously in a sandbox and opens PRs (one example: 47 files migrated in ~20 min, tests passing). The superpower isn't writing code — it's checking it.

grep / read edit run tests commit ✓ tests fail → fix & retry
The loop that makes coding agents trustworthy: they don't just write — they run the tests and fix what broke.

2 · Computer-use agents — how they "see and click"

Some agents operate software that has no API — they drive the actual screen. The loop is pure perception-action: get a screenshot, use vision to find the UI element, return pixel coordinates for a click, execute it in a sandboxed VM, get a fresh screenshot, repeat. Watch it run:

Interactive · the computer-use loop
Cancel
Submit
The agent reads a downscaled screenshot, locates the target, returns coordinates, and the host clicks. Because it reads on-screen content, it's vulnerable to prompt injection — Anthropic runs classifiers on screenshots to trigger confirmation. These agents are still slower/less reliable than humans (OSWorld: ~38% vs ~72%).

3 · The case studies, with real numbers

Klarna · support (OpenAI)
2.3M
chats in month one = ~700 agents' work; 11 min → <2 min; ~$40M impact.
Morgan Stanley · knowledge
98%
advisor adoption of a GPT-4 RAG assistant over ~100k docs; access 20% → 80%.
JPMorgan Chase
450+
AI use cases in production; an M&A-memo agent: hours → under 30 seconds.
LinkedIn · Hiring Assistant
plan-execute
a supervisor + specialized sub-agents, reusing existing messaging infra for orchestration.
The honest lesson (Klarna)

It's not a pure success story. By May 2025 Klarna walked back the AI-first approach to a hybrid human+AI model — the AI was strong on routine volume but weak on the long tail (fraud, disputes), hurting CSAT. Average-case metrics looked great while long-tail failures quietly damaged trust. Design for the long tail, not the demo.

4 · The pattern behind the patterns

Notice how few primitives are actually in play — the domain changes the tools, data, and risk controls, but the skeleton barely changes:

same parts → looptoolscontextmemoryguardrails → different agents SupportRAG + tools + handoff Codingsandbox + verify AnalyticsSQL + validate
Master the skeleton (the reference architecture) and you can build in any vertical.
Carry into Chapter 12 & 13

Next: a field map of 100+ real deployments across ten industries (Ch12), then the operations discipline — eval, observability, security, cost — that separates a demo from a product (Ch13).