Ibrahim Ulukaya

Firebase for Builders Lead & DevRel Manager at Google. Technical strategy, developer onboarding.

I write about the places where production AI systems break, and I build the instruments that show you where yours will. Each essay takes one failure apart in plain words, from the bill that arrives after an agent loop runs all night to the coding agent that passes every test and still ships the wrong change, and shows what fixed it. If you are new here, start with the ten production failure modes of AI agents.

No. 6 in Ghost in the Runtime

Your AI Says the Bug Is Fixed, but the Test Never Failed: Two Checks Before It Ships

Two pre-commit rules for coding agents: R1 rejects a reproducer that exits 0 before the fix, R2 rejects a public signature that changed since HEAD. Stdlib only.

Three rules against the same six moves: the prompt rule sees nothing, the behavior gate misses both agent moves, R1 and R2 catch five and leave the private helper free by design. A. Prompt rule B. Behavior gate C. Red test + signature fence "write the failing test first" read at turn 1, not at commit no exit code what it sees nothing at the boundary the diff already landed 6 of 6 moves pass green test, pre-fix pass reproducer hangs pass || true in command pass public kwarg added pass public helper inlined pass private _helper reshaped pass exit 0 commit lands behavior_gate.py runs the pinned tests exit 0 or 1 what it sees sha256 of each pinned body a pinned assertion that fails nothing about new tests green test, pre-fix pass reproducer hangs n/a || true in command n/a public kwarg added pass public helper inlined pass private _helper reshaped pass exit 0 pinned tests still green repro_fence.py R1 runs the test, R2 parses HEAD exit 0 or 1 what it sees exit code of the reproducer shell tokens in the command public names and arity vs HEAD green test, pre-fix caught reproducer hangs caught || true in command caught public kwarg added caught public helper inlined caught private _helper reshaped allowed exit 1 one line per move, then the diff
Figure 1. Three rules against the same six moves: the prompt rule sees nothing, the behavior gate misses both agent moves, R1 and R2 catch five and leave the private helper free by design.

01START HERE

  1. Ghost in the Runtime

    How AI agents go wrong in real work, from agreeing with everything to passing tests on broken code, and the gates that catch it.

    6 essays · start with Part 1

  2. AI Tokenomics

    What AI costs once an agent runs on its own, why spend caps fire late, and which turns should never go to the most expensive model.

    3 essays · start with Part 1

  3. The Leaky Abstraction

    Why a streaming reply breaks between the model and the screen: torn JSON, dropped tokens, and a browser that hangs up.

    3 essays · start with Part 1

  4. The Epistemic Engine

    What an agent believes about your system, and how static files and stale documents quietly corrupt it.

    2 essays · start with Part 1

02WRITING

  1. Your AI Says the Bug Is Fixed, but the Test Never Failed: Two Checks Before It Ships

    The behavior gate runs the pinned tests, so a regression test written green after the fix and a public function reshaped to satisfy one caller both pass it. R1 runs the reproducer and rejects exit 0, a hang, and a command that picks its own exit code. R2 parses each staged Python file at HEAD and in the index and rejects a public symbol that vanished or changed arity.

    6 min readGhost in the Runtime, No. 6

  2. When the AST Hook Goes Green and the Test Still Fails: The Behavior Gate

    An AST pre-commit gate answers questions about the text of a program, so an agent can hollow an assert or edit a fixture and still exit 0. The behavior gate pins each baseline test body by sha256, runs the pinned set in a fresh subprocess under a wall-clock budget, and echoes the failing assertion back verbatim.

    10 min readGhost in the Runtime, No. 5

  3. Stop Sending Every Agent Turn to the Frontier Model

    Most turns in an agent trajectory are bookkeeping. Route them to a Workhorse tier model by default, escalate on plan steps, repeated gate failures, public export diffs, and schema failures, and cap the escalations.

    9 min readAI Tokenomics, No. 3

  4. The Crutch vs. the Operating System: Why I Deleted 4,000 Lines of Agent Prompts

    Why 72.8% SWE-Bench coding agents collapse to 25.0% on multi-file repositories, and how I replaced 4,000 lines of markdown system prompts with a deterministic 45-line Python AST pre-commit verification harness.

    5 min readGhost in the Runtime, No. 4

  5. Your #1 Arena Model Fails in Real Repositories: The Leaderboard Mirage

    Why upgrading to the #1 Chatbot Arena model makes your production agent swarm less reliable. Scalar ELO rankings measure single-turn chat, not multi-turn monorepo execution. Here is how to build mechanical compiler defenses that eliminate state drift.

    12 min readGhost in the Runtime, No. 3

  6. Code Over Context: Why Written Agent Skills Break in Production

    Stuffing markdown instructions into system prompts burns 20,000 tokens per turn just to establish baseline behavior. Here is how to distill prompt-heavy agent skills into deterministic, zero-token code tools across serverless and on-device runtimes.

    5 min readGhost in the Runtime, No. 2

  7. The Hybrid AI Standard: Routing Between On-Device AI and Cloud Run

    Routing every prompt to a cloud LLM destroys latency budgets, while running entire reasoning pipelines locally exhausts client memory. Here is how to dynamically route requests across on-device NPU tiers and Cloud Run serverless backends.

    6 min read

  8. Static Docs Blindfold Your Agent: The 4-Plane Verification Fix

    Treating point-in-time documentation as ground truth blindfolds autonomous agents to live system drift. Here is how to architect 4-plane epistemic triangulation across living state, runtime telemetry, and skeptical verification.

    7 min readThe Epistemic Engine, No. 2

  9. Dropped Tokens: Fixing Multi-Turn Agent Streams That Die Mid-Flight

    Long-running agent tool executions silently sever TCP connections when they exceed NAT idle-timeout thresholds. Part 2 of The Leaky Abstraction details idempotent backend stream reassembly with Cloud Run and Firestore, directly paired with Part 3 on client-side runtime resilience.

    6 min readThe Leaky Abstraction, No. 2

  10. Two Writers, One Index: How Static Files Corrupt Agent Memory

    Static markdown summary indexes inevitably decouple from live database state, causing multi-turn agents to hallucinate over stale context. Here is how to enforce ACID transaction boundaries and atomic session locks with Firestore.

    7 min readThe Epistemic Engine, No. 1

  11. The Leaky Abstraction: Why GenAI Streaming Breaks Your JSON

    Naive JSON.parse calls on LLM streams crash production servers whenever TCP packet boundaries split multi-byte UTF-8 characters mid-flight. Here is how to build stateful, byte-level stream reassemblers in Node.js.

    5 min readThe Leaky Abstraction, No. 1

  12. When the Browser Hangs Up: Client-Side Defense for Agent Streams

    Most production agent failures in web and mobile apps are silent transport drops rather than model hallucinations. Part 3 of The Leaky Abstraction covers WebSocket keep-alives, UI backpressure, and App Check attestation, completing the backend stream reassembly architecture from Part 2.

    7 min readThe Leaky Abstraction, No. 3

  13. Why Your AI Agent Agrees With Everything: 10 Production Failure Modes

    Left unchecked, autonomous agents enter sycophantic echo chambers and infinite action loops that mimic human cognitive biases. Here are the 10 architectural primitives that enforce objective state verification.

    9 min readGhost in the Runtime, No. 1

  14. Why a $50 Cloud Spend Cap Won't Save You From an Agent Loop

    Cloud billing spend caps operate as asynchronous account fuses that take hours to trip, long after a runaway prompt loop has drained your budget. Here is how to build a real-time, 3-layer tokenomics circuit breaker.

    5 min readAI Tokenomics, No. 2

  15. 11 Rules of AI Tokenomics: From Prompt Hygiene to Hard Caps

    Prompt engineering discipline optimizes development costs, but only deterministic code-level idempotency guards and atomic token buckets prevent financial ruin during live production traffic spikes.

    4 min readAI Tokenomics, No. 1

15 essays. Full archive at /posts.

03INSTRUMENTS

04NOTES

Full log at /til.

Blueprints: 6 reference designs for agent runtimes, memory stores, tokenomics, and brownfield migration at /blueprints.