How to stop bots from attacking me in TF2?
By default, Puppet Bots will remain motionless, but will attack if they can see you.
bot -team <teamname/number> -class <classname> -name <botname>
You can input other commands to force these bots to take certain actions. In particular, you can use
bot_forceattack 0
bot_forceattack2 0
to prevent the bot from attacking and
bot_dontmove 1
to prevent the bot from moving.
You'll need to enable cheats with sv_cheats 1
, but if you type nb_blind 1
this freezes the bots and they won't shoot or move.