Microsoft Agent Framework: choosing where to intercept calls
jesseliberty.com
In Microsoft Agent Framework, ChatClient middleware intercepts messages exchanged with the LLM, while agent middleware operates on the agent’s overall run, including session, identity, or token-budget management. This distinction helps place logging or modification at the right level.
The C# example adds function-invocation middleware to log calls to the Researcher agent’s Tavily tool, without changing the other agents. The trace shows the function name and its arguments.
