A Prisoner of Conscience - S1-E21
Continuity mistake: When Pete steals the drugs, he puts them in his pocket and drops a bag right near the door, but when the doctor comes in and finds it it's much farther away from the door than where he dropped it.
Answer: Late one night, Geoffrey used a covert listening device to overhear David explaining his barricade device to Janet which is how he figured it out.
How do we know Geoffrey really did use a covert listening device? They didn't mention him using one.
There was a scene of him using it when David told Janet about his barricade.