I've posted an extensive write-up about everything I know about the power issues on the new surface pro on reddit. There seem to be a lot of people complaining about this...
https://www.reddit.com/r/Surface/comments/6i292f/suspendpoweroff_at_random_surface_pro_2017_i5/
Yep, I have the same exact issue with my surface pro 256/8/i5 with the keyboard cover. It is annoying the heck out of me with how it is putting itself to sleep all the time. Even when I am in the middle of typing sometimes! Seems like it is more likely to happen after a real reboot, and then it seems less likely to happen a subsequent time. (I think. There doesn't seem to be much rhyme or reason for why it is happening. It probably has happened 8 or 10 times to me so far since I got it last week.) I have set all my power options to turn off/sleep to "NEVER" and I disabled the checkbox to "save me power when my device knows I am away." Doesn't seem to make any difference. I see 2 different scenarios in my event log for this. One is when it puts it to sleep, and another time is when it puts itself into "connected standby". Here are the two kinds of "Events" and "Reasons" that I am getting:
Information 6/18/2017 11:08:46 AM Microsoft-Windows-Kernel-Power 506 (157) "The system is entering connected standby Reason: Idle Timeout."
Information 6/19/2017 8:35:41 PM Microsoft-Windows-Kernel-Power 42 (64) "The system is entering sleep. Sleep Reason: Application API"
Note
#1 : The reason the display brightness is changing by itself (even if you have it set not to) is because of some intel thing called "DPST" and you can turn it off with a registry setting (although it may not be straight forward, since the setting for it is just one bit in a DWORD so if your settings aren't the same as on this link, you might need to do a little bit of bitmask math.)
https://mikebattistablog.wordpress.com/2016/05/27/disable-intel-dpst-on-sp4/
Note
#2 : There is a registry setting to turn off "Connected Standby" which may help the situation (but probably wont help the "sleep" scenarios.) The directions for that are here:
Disabling Windows Connected Standby | Windows Client content from Windows IT Pro
Note
#3 : When I contacted Microsoft support about this, their suggestion was to give me a link to reinstall all my drivers. I did that, but it had no effect on the situation.
The registry tweaks in the links above make the situation a little less bad, but there is still a problem. I hope Microsoft can issue a Hotfix for this quickly! Or else I might consider having to return my new Surface Pro while I'm still in my 30 day return-window.