Rogue couriers and Amazon Key door-entry flaw
How about giving the courier a one-time-code that way the above method won't work. Besides if losing communication with the 'cloud' prevents the door from being locked. What's stopping the perp from placing a jammer near the door and waiting for the occupant to exit the building. you could place a webcam on a nearby tree and watch from a block away in your car.