Yep, which is why it's important that the function be specified beforehand. You can always pick some function that matches the result precisely.
The key is to either pre-establish the function, or possess logical criteria that determine whether a postulated function is worth matching.
...it's probably adaptation executer.
We often assume agents are utility maximizers. We even call this "rationality". On the other hand in our recent experiment nobody managed to figure out even approximate shape of their utility function, and we know about large number of ways how agents deviate from utility maximization. How goes?
One explanation is fairly obvious. Nature contains plenty of selection processes - evolution and markets most obviously, but plenty of others like competition between Internet forums in attracting users, and between politicians trying to get elected. In such selection processes a certain property - fitness - behaves a lot like utility function. As a good approximation a traits that give agents higher expected fitness survives and proliferates. And as a result of that agents that survive such selection processes react to inputs quite reliably as if they were optimizing some utility function - fitness of the underlying selection process.
If that's the whole story, we can conclude a few things: