In case you get stopped by an officer to search your bag on the subway (chances are extremely low), just keep in mind that letting them check is completely optional. You don’t have to let NYPD officers go through your bag. It’s totally up to you. All the police can do is refuse to allow you on the train.
So if a terrorist were to get stopped for an inspection, all they would have to do is say no, and get on the train somewhere else.