This release adds 3 notable features for engineering teams evaluating rollout.
✓ No known CVEs patched in this version
Topics
+1 more
Summary
AI summaryUpdates Wrap individual tool execution, What's New, and Fixes & Polish across a mixed release.
Changes in this release
| Type | Severity | Summary | CVE |
|---|---|---|---|
| Feature | Medium |
Adds pluggable middleware architecture to generation pipeline. Adds pluggable middleware architecture to generation pipeline. Source: llm_adapter@2026-06-10 Confidence: high |
— |
| Feature | Medium |
Provides genkit-plugin-django to expose Genkit flows as Django HTTP endpoints. Provides genkit-plugin-django to expose Genkit flows as Django HTTP endpoints. Source: llm_adapter@2026-06-10 Confidence: high |
— |
| Feature | Medium |
Introduces official genkit-plugin-middleware package with pre-built resilience tools. Introduces official genkit-plugin-middleware package with pre-built resilience tools. Source: llm_adapter@2026-06-10 Confidence: low |
— |
| Feature | Low |
Adds native constrained generation support in Google GenAI plugin for tool calls. Adds native constrained generation support in Google GenAI plugin for tool calls. Source: llm_adapter@2026-06-10 Confidence: high |
— |
| Feature | Low |
Adds `key` field to `ToolDefinition` for typing parity with JS SDK. Adds `key` field to `ToolDefinition` for typing parity with JS SDK. Source: llm_adapter@2026-06-10 Confidence: high |
— |
| Feature | Low |
Provides pre-built resilience middleware (Smart Retries, Model Fallbacks, Tool Approval, Filesystem Sandbox, File System Skills). Provides pre-built resilience middleware (Smart Retries, Model Fallbacks, Tool Approval, Filesystem Sandbox, File System Skills). Source: granite4.1:30b@2026-06-10-audit Confidence: low |
— |
Full changelog
Genkit Python SDK v0.7.0 Release Notes
Genkit Python SDK v0.7.0 is here! In this release, we've focused on giving you more control over the generation pipeline, adding pre-built resilience tools, and making it easier to integrate Genkit into your production web applications.
What's New
Intercept the Generation Loop with Middleware (#5253)
We've added a pluggable middleware architecture to the core generate pipeline. By subclassing BaseMiddleware and using the @ai.middleware decorator, you can run custom code at key lifecycle points in the generation process.
Configure your middleware with a custom configuration model using Pydantic:
from pydantic import BaseModel
from genkit import Genkit, BaseMiddleware
ai = Genkit()
# Configure your middleware with a custom config using Pydantic
class LoggingConfig(BaseModel):
prefix: str = "[AI]"
@ai.middleware(name="logger")
class Logger(BaseMiddleware[LoggingConfig]):
# Wrap the outer loop of the generate call (includes tools)
async def wrap_generate(self, params, ctx, next_fn):
return await next_fn(params, ctx)
# Wrap the raw model API call (inspect/mutate inputs/outputs)
async def wrap_model(self, params, ctx, next_fn):
print(f"{self.config.prefix} Running: {params.prompt}")
res = await next_fn(params, ctx)
print(f"{self.config.prefix} Response: {res.text}")
return res
# Wrap individual tool execution (inspect/mutate inputs/outputs or Interrupt)
async def wrap_tool(self, params, ctx, next_fn):
print(f"Tool {params.name} called with: {params.input}")
return await next_fn(params, ctx)
# Apply it on generate calls with full IDE autocomplete:
await ai.generate(
model='gemini-2.5-flash',
prompt='Hello!',
use=[Logger(prefix="[Veneer]")]
)
- wrap_generate: Hooks into the outer loop of the generate call, wrapping both the model execution and subsequent tool calls.
- wrap_model: Wraps the raw model API call, allowing you to inspect or mutate model input parameters and the raw generated output.
- wrap_tool: Wraps individual tool executions. You can inspect or modify inputs/outputs of tool calls, or raise an
Interruptto pause execution (e.g., waiting for user approval).
Pre-built, Production-Ready Middleware (#5253)
We also released an official genkit-plugin-middleware package so you don't have to write common resilience patterns from scratch:
- Smart Retries: Handle transient API failures with exponential backoff and randomized jitter (
Retry). - Model Fallbacks: Automatically swap to backup models if a primary provider fails or hits rate limits (
Fallback). - Tool Approval: Intercept sensitive tool calls to require user confirmation or automated validation (
ToolApproval, supporting snake_case config options from #5479). - Filesystem Sandbox: Restrict agent actions to a sandboxed directory with secure file operations like read, write, edit, and list (
Filesystem). - File System Skills: Bundle and execute groups of tools backed by simple file storage (
Skills).
Expose AI Logic as HTTP Endpoints with Django (#5408)
To make it easier to deploy AI workloads, we built genkit-plugin-django to let you expose Genkit flows as standard Django endpoints. You can find a complete example showing how to wire this up in the new django-hello sample folder.
Fixes & Polish
Weekly OSS security release digest.
The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.
No spam, unsubscribe anytime.
Share this release
About genkit
Open-source framework for building AI-powered apps in JavaScript, Go, and Python, built and used in production by Google
Related context
Related tools
Beta — feedback welcome: [email protected]