Environments and Automata I