Middleware order is important
Place ASP.NET Core middleware in the order that matches routing, security, and endpoint behavior.
Place ASP.NET Core middleware in the order that matches routing, security, and endpoint behavior.
Do not let prompt instructions decide what data or actions a user is allowed to access.
Add traces, metrics, and logs while the system is still easy to reason about.