A Spring AI @Tool Is an API With a Non-Deterministic Caller. Secure It in Java.
Picture a support assistant for an online store. A customer types "Where is my order?", the model calls a lookupOrder tool, and everyone is happy. Then someone adds a refundOrder tool, because it's a two-line method and the demo looks great.
That tool is now a public API that moves money , and its caller is a language model that reads untrusted text, including text written by attackers.
This isn't hypothetical. In Moffatt v. Air Canada (2024), a Canadian tribunal held the airline responsible for wrong policy information its website chatbot gave a customer.…