Is it OK to hire another lab's student? An undergrad who's worked with me for just over a year (for course credit or for pay, depending on his preference in any given semester) presented a poster on his work with me at an event hosted by my lab. Afterwards, the student told me that he spoke to Professor B at the poster session, and Professor B suggested a project that he'd like the student to work on with him. 

He had a meeting with Professor B to talk about the specifics, after which Professor B emailed me and asked whether I would recommend the student. I indicated in my response that the student is very capable and I would rather not lose him, to which Professor B responded, "He's planning on working with me for course credit next semester."

Was Professor B's behavior in this case OK?

More generally,

Under what conditions is it OK to hire another lab's student?

By "OK," I mean "not considered inappropriate behavior by the professor."

Hiring another lab's student is of course a continuum:


On the one hand: Student from Professor A's lab appears in Professor B's office, says "I've heard about your research and would really like to work with you." Professor B says, "Sure, I'd like that a lot." 
On the other hand: Professor B attends event (open house, workshop, etc.) hosted by Professor A, where Professor A's student gives a talk about his ongoing research with Professor A. Professor B chats with the student after the talk, then says "You should work with me next semester." 


Is either or both of these considered OK/not OK? 

Does the type of student (PhD, MS, undergrad, high school student doing summer research) make a difference to your answer?

Do the terms of the student's position in either lab (earning course credit, getting paid, just getting supervision) make a difference? 

Does it matter how long the student has been working with Professor A?

Should Professor B ask how Professor A feels about it before offering Professor A's student a job?



This is not an active, ongoing situation - I am not looking for advice on how to respond to Professor B, or whether I should say something to the student. (The student chose to continue his work with my lab and not to work with Professor B.) I just want to know whether Professor B's behavior was appropriate.
Consider the following scenario: 


  I've been working with a professor for a year now, and at one of his
  events, I presented a poster. Another professor came up to me and
  started talking, and it turned out that this professor had a very
  interesting project related to my interests. I'm applying to grad
  schools in a year, and if I can get two recommendations from faculty
  it will really help my application. Should I work with this professor
  or not ?


Students have agency too. There's a lot of context and background missing in your description that Koldito alludes to. But in general students should be free to make their own decisions about their research activities and honor existing commitments that they've agreed to. 

Personally, if I were Professor B, I might suggest that the student talk to you first before deciding, but it's also possible that B did that, and the student indicated that no continuing commitment existed. If I were advising the student, I'd also suggest they clear things up with you first. I might also suggest that depending on the level of interest in the project they have with you, they give you the right of first refusal. 

But this exact situation has happened to me with students (twice). They worked with me for a while, and then found a topic that made more sense to them with another professor. I wished I could have convinced them to stay, but they did well with their advisors and I was on both their committees, with no hard feelings at all.