Redis safe mode and review

See which Redis commands are blocked, warned or confirmed before they can affect a server.

Redis safe mode classifies commands before execution and fails closed when the engine cannot identify a command. Session-changing commands such as SELECT, MULTI, EXEC, DISCARD, WATCH, UNWATCH, SUBSCRIBE, MONITOR, SYNC and PSYNC are refused because they would change the shared connection state or turn it into a stream.

The destructive group includes FLUSHALL, FLUSHDB, SWAPDB, SHUTDOWN, DEBUG, SAVE, BGSAVE, BGREWRITEAOF, REPLICAOF, SLAVEOF, MIGRATE, RESTORE, FAILOVER, CLUSTER and LASTSAVE. Opaque script calls such as EVAL, EVALSHA, FCALL, FUNCTION and their read variants are always refused. Destructive subcommands include CONFIG SET, ACL SETUSER, CLIENT KILL, SCRIPT FLUSH, FUNCTION DELETE, MODULE LOAD, MEMORY PURGE, LATENCY RESET and XGROUP DESTROY.

In a production connection, a destructive command requires explicit confirmation and the exact resource. KEYS is refused on production connections because it scans the whole keyspace. Unknown commands are not treated as harmless reads.

The review surface explains the command, its classification and any warning before the batch runs. The app’s read-only mark adds another boundary, while an ACL user without write permissions provides the server-side guarantee.