Google added a middleware layer to Genkit this week โ€” three programmable hook points (generation calls, model calls, tool execution) where cross-cutting concerns plug into the agent loop without touching application logic. The shape will feel familiar to anyone who's written Express or Connect middleware: components stack in defined execution order, each one sees the request, can mutate it or short-circuit it, then passes control down the chain. Prebuilt middleware ships in the release: retry handling with exponential backoff, automatic model fallbacks, approval gates for sensitive tool calls, filesystem access controls, and a "skills" system for dynamic instruction injection. Genkit itself supports TypeScript, Go and Dart, with Python coming soon.

The interception model matters because it standardises something most agent shops have been hand-rolling. The model generates output, executes tools, processes results, continues until completion โ€” that's the loop, and middleware can hook in at each stage. Retry-with-backoff at the model-call layer means transient API failures don't blow up the agent run. Model fallback means primary-API rate-limit hits a degraded-but-functional backup model without orchestration glue. Approval gates at the tool-execution layer mean a human gets paged before the agent calls `delete_database` or transfers funds โ€” the kind of safety primitive builders have been writing into custom dispatchers ad-hoc. FS access controls bound the blast radius of file-touching tools. And the skills system lets you inject context-dependent instructions per invocation without rebuilding the prompt template.

Ecosystem read: this is the application-layer side of Google's agent strategy. Per Google engineer Michael Doyle in the release: Genkit targets "application-layer AI feature integration," while the Agent Development Kit (ADK) targets "complex, standalone, multi-agent systems" on dedicated infrastructure. The split lands the standard SDK-vs-platform question โ€” use Genkit when you're adding AI features inside an existing app, use ADK when you're building an agent platform. Middleware composability is exactly what makes Genkit work for the first case: retries, fallbacks, approval gates and observability hooks are the cross-cutting concerns that bedevil every agent in production, and pushing them into a hookable layer is the right architectural call. Comparison with LangChain callbacks, OpenAI Agents SDK hooks and Anthropic SDK middleware is left as an exercise โ€” the InfoQ piece doesn't make those head-to-heads.

Monday morning: if you're running Genkit, evaluate which of the prebuilt middleware components you've been writing yourself. Approval gates for sensitive tool calls in particular โ€” if your agent has any tool that could cost real money, send a message, or modify shared state, plug the gate in. The Developer UI traces middleware execution and lets you debug stack interactions, which matters because order-of-execution bugs are how middleware stacks break. If you're not on Genkit but on LangChain or a custom harness, the three-hook-point taxonomy (generation / model / tool) is portable design vocabulary โ€” your callbacks or interceptors should hit those three layers explicitly, with approval gates at the tool layer being the most underrated primitive for production safety.