Vercel AI SDK
Check model input with middleware and classify generated text before returning it.
LangChain and LangGraph
Add callback handlers to model calls and graph execution in TypeScript or Python.
Deep Agents
Protect root agents, tool execution, and subagent graphs.