HomeGemini / GemmaGenkit Middlewareを発表、エージェントアプリを保護・拡張
Announcing Genkit Middleware: Intercept, extend, and harden your agentic apps
Gemini / Gemma ⚠ 古い情報の可能性

Genkit Middlewareを発表、エージェントアプリを保護・拡張 Announcing Genkit Middleware: Intercept, extend, and harden your agentic apps

元記事を読む 古い情報の可能性
AI 3 行サマリ
  • GoogleはオープンソースAI開発フレームワークGenkitに、モデル呼び出しやフロー実行へロギング・認証・レート制限・安全性チェックを差し込めるMiddleware機構を導入した。
  • 横断的関心事を一元化し、エージェント型アプリの堅牢化と運用性向上を実現する。
English summary
  • Google introduced a middleware system in Genkit, its open-source agentic AI framework, letting developers inject logging, auth, rate limiting, and safety checks into model calls and flows for more robust, maintainable apps.

GoogleはAIアプリ開発フレームワークGenkitに、新たな拡張機構「Middleware」を導入したと発表した。エージェント型アプリのリクエストやレスポンスを介在処理できるようにし、運用面の課題を共通化して解決することを狙う。

GenkitはJavaScript/TypeScriptやGo、Python向けに提供されているオープンソースのAIアプリ開発フレームワークで、GeminiやImagen、Vertex AI、さらにはサードパーティのLLMを統一的なインターフェースで扱える点が特徴だ。今回のMiddlewareは、Webフレームワークで広く使われているチェーン状の介在処理パターンをモデル呼び出しやフローの実行に持ち込むもので、入力・出力の前後に任意の処理を挟み込める。

想定されるユースケースは幅広い。リクエストやレスポンスの構造化ロギング、認証・認可、レート制限、PII(個人情報)のマスキング、セーフティポリシーの適用、コンテキスト注入、キャッシュ、コスト計測などが挙げられる。これらは従来であれば各フローや各モデル呼び出しに個別実装する必要があったが、Middlewareとして共通化することで、コードの重複を抑えつつ、エージェント挙動の一貫したガードレールを敷きやすくなると見られる。

GoogleはオープンソースAI開発フレームワークGenkitに、モデル呼び出しやフロー実行へロギング・認証・レート制限・安全性チェックを差し込めるMiddleware機構を導入した。
✨ Gemini / Gemma · 本記事のポイント

背景として、エージェントアプリは複数ステップのツール呼び出しや長いコンテキストを扱うため、観測性とセーフティの担保が難しいという課題がある。LangChainのCallbacks、LlamaIndexのイベントハンドラ、OpenAIのResponses APIに見られるガードレール機能など、競合エコシステムでも同様の関心事への対応が進んでおり、Genkit Middlewareはこの流れに沿った機能拡充と位置づけられる。

また、GenkitFirebaseやCloud Runとの統合を意識した設計になっているため、Middlewareを通じてCloud Loggingやトレーシング基盤への接続、Firebase Authを用いた認証チェックなどをシンプルに記述できる可能性がある。エージェント開発者にとっては、プロトタイプから本番運用へのギャップを縮める実務的なアップデートと言えるだろう。

Google has announced Genkit Middleware, a new extension mechanism in its open-source AI application framework aimed at making agentic apps easier to intercept, extend and harden in production.

Genkit is Google's AI app framework, available for JavaScript/TypeScript, Go and Python, that provides a unified interface over Gemini, Imagen, Vertex AI and a range of third-party LLMs. The newly announced Middleware brings a familiar chain-of-interceptors pattern, well known from web frameworks like Express or Koa, into the world of model calls and multi-step flows. Developers can now wrap inputs and outputs with arbitrary pre- and post-processing logic without rewriting each flow.

The target use cases are broad. Typical examples include structured logging of prompts and responses, authentication and authorization checks, per-user or per-key rate limiting, redaction of personally identifiable information, application of safety policies, dynamic context injection, response caching and cost or token accounting. Previously, teams often had to scatter such concerns across individual flows and model calls. By centralizing them as middleware, codebases can stay leaner while applying consistent guardrails across an entire agent.

This matters because agentic applications are notoriously hard to operate. They often chain multiple tool calls, juggle long contexts and rely on non-deterministic model behavior, which makes observability, safety and cost control central engineering concerns rather than afterthoughts. A middleware layer gives platform teams a clean seam to enforce policies that product teams might otherwise forget or implement inconsistently.

The pattern is not unique to Genkit. LangChain has long offered callbacks and runnables for similar cross-cutting concerns, LlamaIndex exposes event handlers and instrumentation hooks, and OpenAI's Responses API and Agents SDK have introduced built-in guardrails for input and output validation. Anthropic and AWS Bedrock have likewise added moderation and governance layers around their model APIs. Seen in that context, Genkit Middleware can be read as Google bringing its framework closer to feature parity with the broader agent tooling ecosystem, while leaning on its tight integration with Firebase and Google Cloud.

That integration angle is likely to be one of the more practical benefits. Because Genkit is designed to deploy naturally onto Cloud Run and Firebase, middleware components could plausibly forward traces to Cloud Logging or Cloud Trace, validate Firebase Auth tokens, or apply Vertex AI safety settings in a uniform way. Combined with Genkit's developer UI for inspecting flows and traces locally, middleware should make it easier to reason about what an agent is actually doing at each step.

For developers building production agents, the announcement is less a flashy model release and more an infrastructure-level improvement, but arguably an important one. The gap between a working prototype and a hardened, observable, policy-compliant agent service is where many AI projects stall. By formalizing an interception point, Genkit is nudging that boundary closer to something teams can address with reusable components rather than bespoke glue code. It will be worth watching how the community builds shared middleware packages, for example around evaluation, prompt caching or compliance, as the ecosystem matures.

  • SourceGoogle Developers BlogT1
  • Source Avg ★ 2.2
  • Typeブログ
  • Importance ★ 通常 (top 97% in Gemini / Gemma)
  • Half-life ⏱️ 短命 (ニュース)
  • LangEN
  • Collected2026/05/31 10:00
元記事を読む developers.googleblog.com

本ページの本文・要約は AI による自動生成です。正確性は元記事 (developers.googleblog.com) をご確認ください。

Gemini / Gemma の他の記事 もっと見る →

URL をコピーしました