I had the same thing in the carbon seat stay of a Cannondale Scalpel years ago. There was a small access hole in which I dripped some strong superglue. Just tipped the bike backwards and forwards, left it for a while… no more rattle.
I think the object was a bit of rivet from the brake mount.