library · inferred from evidence
AgentMiddleware
A base class for custom middleware with hooks for agent behavior.
- Compose a middleware stack: PII redaction, summarization, human approval
The three prebuilt middlewares that cover most production agents: PIIMiddleware to keep sensitive data from the model, SummarizationMiddleware to bound history, HumanInTheLoopMiddleware to gate risky tool calls. Compose them in one list. No