Thats my understanding of the events but that includes "not in the movie" Lore added by novelisations.
From my understanding, Ash was put there specifically to ensure the ships crew reacted "correctly" to events so that WY would get what they wanted to happen - i.e. make sure they react correctly once they "discover" the origin of the signal after MOTHER alerted them to it, then make sure they follow standard WY orders to set-down to investigate, then make sure a specimen is brought back onboard (Ash allowing Kane inside goes against the standard WY orders that Ripley quotes), and then once Kane is aboard, Ash's role was to do everything he can to ensure the specimen survives (stops Parker killing it at the dinner table etc) until his role is exposed. If he hadn't been exposed by Ripley, I think he would have eventually been forced to kill the crew anyway when they wanted to set a self-destruct sequence going.
As we later find out from Bishop, WY Androids are programmed with the 3 laws of robotics, but clearly Ash wasn't, which means that the people who made Ash (or programmed him at least) knew the potential outcome of the situation before they put him onboard the Nostromo, because a normal Android couldn't have done the same things due to the 3 laws stuff.
Of course its all just expansions to a film which never actually spelled out exactly "when" WY knew, which leaves the doors wide open for interpretation and debates like these.