>>1,2A "Malevolent AI" is just a page of code it could be as smart as fire ants. Its the "Human-level Sentient AI" that is hard to create(autists trying to replicate human brains).
example:
DetectFriendOrFoe()
DestroyNearestFoe()
SpawnMoarAIbots()
AquireResources()
LongRangeScan()