agent: Keep the session environment for restricted connections.