Source: vercel.com/changelog/routing-middleware-now-supports-python
The middleware is set up through the proxy entrypoint in vercel.toml, which points at a proxy object such as proxy:proxy. It is an ASGI or WSGI app that runs separately from the main application and can only use packages in the vercel.proxy dependency group of pyproject.toml. Packages the middleware imports must be added to that group, for example with uv add --group vercel.proxy vercel-proxy.
The vercel-proxy package provides utilities for writing routing middleware on Vercel, including a Proxy app that routes requests by path. Its example issues a 308 redirect for old blog slugs and adds a request header to API calls before they continue. Requests that match no route pass through to the application unchanged.
Why it matters if you build agents
Python agent backends deployed on Vercel can now handle redirects, path-based routing and request header changes in front of the app without a separate service. Middleware code runs in its own environment, so any package it imports has to be declared in the vercel.proxy group rather than assumed from the main app's dependencies.
Get stories like this every weekday
One short email with the day's agent tooling news.