There was a great Twilight Zone original-series episode that was basically just that: https://en.wikipedia.org/wiki/The_Old_Man_in_the_Cave
Spoiler: it didn't end well for the clanker or the humans.