Multiple specialist agents in LangGraph / Agent Framework need consistent correlation logging, authorization checks before tool calls, and uniform exception shaping. Duplicating this in every node is error-prone. What should you design?
Select an answer to reveal the explanation.
Short Explanation
A is the reusable-capabilities answer. Middleware for logging, authorization, and exception handling keeps cross-cutting concerns consistent across multi-agent graphs—Agent Framework, LangGraph, or custom orchestrators. B ad-hoc prints fail observability. C disabling auth is a security regression. D swallowing errors as empty 200s sabotages monitoring. Design middleware once; attach it to nodes and tool boundaries.
Full Explanation
Correct Answer — A
Middleware for reusable capabilities across the solution includes logging, authorization, and exception handling. Centralizing these concerns improves consistency for multi-agent orchestration frameworks such as Agent Framework and LangGraph.
Why B is wrong: Uncorrelated ad-hoc logs prevent trace analysis.
Why C is wrong: Removing authorization violates secure tool use.
Why D is wrong: Masking failures breaks reliability and incident response.
Exam tip: Cross-cutting agent concerns belong in middleware, not copy-paste nodes.