For a start, ED is clearly meant to be a female mechanical companion. Second, it does exactly what it is supposed to do, engages hostile targets. Anything else, if beyond doubt, you should make it wait. Differentiating friend or foe is at user discretion, not that of an artificial intelligence. (Or at least that is how I think it has been designed.) It would be easy to change, they didn't. I think purposefully.
If that's how it's supposed to be, they broke all the other companions, because every other companion I have, when set to passive, doesn't attack everything that moves. They wait till I attack something and then start attacking as well. So obviously there are two possibilities here; 1, you are right and they have Ed-E working exactly as planned, but screwed up every other companion because their, and your, definition of passive is "shoot indiscriminately". Or 2, The other companions work as they should, and Ed-E is infact not working correctly, because they screwed up the passive/aggressive toggle.
Sounds more likely that passive, which is the opposite of shoot indiscriminately, should actually mean passive like all the other companions, which leads me to believe the problem is #2.