After studying this material, students should be able to:
Imagine you run a popular library that 20 million developers depend on every week. Every day brings:
The Math Problem:
- 100+ new issues per month
- 1,000+ open issues accumulated
- 800+ open pull requests
- 4 maintainers = impossible to keep up
The critical insight here is this:
Generating code is cheap. Human attention is not.
Even the best maintainers using AI assistants still face a bottleneck:
Every solution still routes every change
through ONE human's attention
↓
Human attention = the constraint
↓
More agents ≠ solution if human is still the bottleneck
Key Takeaway: The problem is not effort — it is architecture. You cannot solve a systems problem with individual heroics.
Before building anything, you must ask: How much automation is appropriate?
FULL AUTOMATION HUMAN-STEERED MINIMAL AUTOMATION
|__________________________|__________________________|
Ship without Human steers Firmware in
human reading agent fleet pacemakers
any code
↑
AI SDK lives
closer here
| Factor | Implication |
|---|---|
| 20M+ weekly users | One bad change = massive impact |
| Foundational infrastructure | Apps built on top depend on stability |
| Security sensitivity | Attackers actively target popular repos |
| Quality expectations | Trust is hard to earn, easy to lose |
Heavily automate the lifecycle around the human, without removing them.
The human stays in control. The factory handles everything else.
Not all changes carry equal risk. The factory must recognize this:
LOW RISK MEDIUM RISK HIGH RISK
|___________________________|___________________________|
Docs typo fix Provider capability New public API
↓ ↓ ↓
Quick glance Focused validation Deep review
The factory's job is not just to generate code — it must:
Evidence Chain Example:
✓ Feature confirmed missing (probe test)
✓ Spec fits existing architecture
✓ Backward compatible
✓ Side-effect risk: LOW
✓ Performance risk: NONE
→ Human reviewer: Quick approval appropriate
What they tried first:
Single Agent
├── classify()
├── analyze()
├── implement()
├── review()
└── backport()
Problem: Hard to debug, hard to test, hard to maintain
What they built instead:
Classifier Agent → Labels issue type with confidence score
↓
Analysis Agent → Investigates, writes spec, assesses fit
↓
Implementation Agent → Writes code, runs live tests
↓
Review Agent → Scores risk, approves or flags
↓
Human Reviewer → Reads evidence chain, merges
↓
Backport Agent → Ports change to older versions
Why this works better:
| Benefit | Explanation |
|---|---|
| Testable in isolation | Each agent has its own evals |
| Easier to debug | Failure is localized to one agent |
| Easier to improve | Update one agent without breaking others |
| Clearer reasoning | Each agent has focused prompts and context |
A public repository must assume every input is potentially hostile:
Threat Sources:
- Malicious code in pull requests
- Supply chain attacks
- Resource exhaustion attempts
- API key exfiltration
- Prompt injection attacks
Layer 1: SANDBOX
┌─────────────────────────────────┐
│ Isolated Vercel Sandbox │
│ ├── Agent code │
│ ├── Agent runtime │
│ └── Only task-specific secrets │
│ │
│ Untrusted content can shape │
│ proposals, but damage is │
│ contained here │
└─────────────────────────────────┘
↓
Layer 2: NETWORK SHIELD
┌─────────────────────────────────┐
│ Controls outbound connections │
│ Blocks paths attackers use to │
│ exfiltrate secrets │
└─────────────────────────────────┘
↓
Layer 3: HUMAN REVIEW
┌─────────────────────────────────┐
│ Nothing merges without human │
│ approval from the SDK team │
└─────────────────────────────────┘
The Progression:
Phase 1: Local CLI
→ Fast iteration
→ Easy to spot inaccuracies
→ Low overhead for experimentation
Phase 2: Managed Cloud Infrastructure
→ GitHub webhooks trigger automatically
→ Queue processes issues at scale
→ Monitoring UI tracks parallel runs
Infrastructure Stack:
| Component | Purpose |
|---|---|
| Vercel Functions | API, workers, webhook ingress |
| Vercel Queues | Task execution pipeline |
| Vercel Blob | Log storage |
| Vercel Sandbox | Isolated agent workspaces |
| Neon Postgres | Factory state and data |
Let's follow Issue #17898 — a request for blocked-domain support in OpenAI web search.
Input: Community issue text
↓
Classifier Agent runs
↓
Output:
Type: Feature Request
Confidence: HIGH
Rationale: [documented in comment]
Label: applied to issue
Classifier output + codebase context
↓
Analysis Agent runs probe:
issue-17898-type-probe.ts
↓
Probe FAILS → confirms feature is missing on main
↓
Agent builds spec:
- Add optional blockedDomains filter
- Map to provider's blocked_domains field
- Fits provider-adapter architecture ✓
- Backward compatible ✓
- Documentation changes scoped ✓
Spec from Analysis Agent
↓
Implementation Agent:
- Writes the code change
- Runs live end-to-end test
(OpenAI search with wikipedia.org blocked)
- Confirms domain is unreachable ✓
- Opens Pull Request with evidence attached
Pull Request
↓
Review Agent scores the change:
Implementation completeness: FULL ✓
Side-effect risk: LOW ✓
Performance risk: NONE ✓
Backwards-compatibility risk: LOW ✓
↓
Agent approves PR
Human (Lars) reads:
- Classification rationale
- Analysis spec and probe results
- Implementation evidence
- Review scores
↓
Reviews actual code diff
↓
Merges PR #18033 to main
Merge detected
↓
Backport Agent opens:
PR #18035 → v6 branch (clean apply)
PR #18036 → v5 branch (conflict detected)
↓
For v5 conflict:
Agent labels conflicted state
Identifies fix
Validates fix
Pushes resolution (17 minutes later)
↓
Human reviews and merges both
PRs authored by factory: 25–35% of weekly merges
Backports (v6): >50% of weekly merges
Issues closed by factory: 70–80% in July
Open issues: 1,022 → 844 (↓18%)
Open bugs: ↓25%
The factory did not replace human judgment — it multiplied human capacity:
Before factory:
Human attention → bottleneck → backlog grows
After factory:
Factory handles: classification, analysis,
implementation, review, backports
Human handles: final judgment on evidence chain
Result: Same humans, dramatically more throughput
Every factory run ends in one of four states:
| Outcome | Meaning | Response |
|---|---|---|
| Success | Ships | — |
| Flawed | Agent produced wrong output | Better prompts, better context, new eval case |
| Blocked | Environment missing something | Provision the missing resource |
| Manual | Intentional boundary | Decide if factory improvements justify removing it |
Traditional engineering job:
Write code → test code → ship code
Agentic engineering job:
Improve the factory → factory writes, tests, ships code
Every failure is signal. Every signal expands the automation boundary. The factory gets better every week.
1. SCALE THE SYSTEM, NOT THE HUMANS
Human attention is the constraint — design around it
2. MATCH AUTOMATION DEPTH TO RISK
Not everything needs the same level of scrutiny
3. ONE AGENT PER TASK
Focused, testable, debuggable, improvable
4. SECURITY IS NOT OPTIONAL
Public repos face real attackers — sandbox everything
5. BUILD INCREMENTALLY
Local CLI first, cloud infrastructure second
6. EVIDENCE CHAINS ENABLE TRUST
Humans can only review efficiently if agents document their reasoning
7. FAILURES ARE FEEDBACK
Every broken run makes the factory smarter