PunyForth programming language for the ESP8266
github.com
github.com
One of the first things that comes to mind with such a system is security. After thinking about this for a few minutes I think the best general-purpose safe solution would be a button and a switch that requires the button to be pressed whenever a new TCP connection is accepted if the switch is "on", the idea being that you switch security off for repeated reconnects and back on once the device is shoved somewhere inaccessible.
The ESP8266 apparently offers TLS 1.2, and that would probably be the best production solution, but I mention the above as a dead-simple fallback that requires very little program memory, would be simple enough to implement in an hour even if you have absolutely no idea what you were doing, and involves buttons and switches :P
EDIT: swapped for correct URL
https://docs.micropython.org/en/latest/esp8266/esp8266/tutor...
ARM Cortex-M0/M3/M4/M7 (STM32, Teensy, etc.) and TI MSP430: Mecrisp-Stellaris - http://mecrisp.sourceforge.net
Atmel 8-bit AVR: AmForth - http://amforth.sourceforge.net
ARM7/9 types (Cortex like STM32, several NXP LPC, ...): Riscy Pygness - http://pygmy.utoh.org/riscy/
Microchip PIC18/24/30/33 and Atmel Atmega: FlashForth - http://www.flashforth.com/
Enjoy!