"That is true and obviously it'll never be foolproof but in some cases a flat response when one might expect something different is the give away."
That wasn't my point. My point is not on what sarcasm is but what it is used for. At its highest level is meant for *some* of the audience not to get it or, at least, not to get it immediately because sarcasm requires mockery out of somebody or, in its light form to mock out of what somebody said (instead of the somebody himself).
For an AI wanting to get sarcasm *on others* is an easy task (in theory), provided it is among an audience, since it only needs to watch for one of two reactions (some times in quick succession):
1) Somebody says something (with or without cues)
2) Part of the audience grins
3) Few moments later the part that didn't grin goes "Oh, wait!"
The problem comes when the sarcasm is directed to the AI itself. The most it could do is apply the old poker saying: if it can't find the sucker...