connecting dc ground to neutral of AC

If the product is designed so that there is NO CHANCE of people coming into contact with any part of the circuit, then it can be acceptable to connect the circuit ground to mains neutral. The circuit is enclosed in a plastic box but there are two LEDs (1mm of their dome is sticking out of the box). Is this OK?

I wouldn’t trust the LED packaging for isolation; you could use light pipes to get them further inside the box.

Unless there is a very good reason, I would not do this. Remember that if you do this, you need to isolate any external connections while working on it - serial connections, programmers, scopes, meters, etc. AC neutral isn’t at AC ground potential (due to voltage drop) and if ever connected to a backwards-wired outlet or one with a broken neutral can be at line voltage above ground. For testing and any time it is powered up without the case, you will want to use an isolation transformer to power it, and always keep one hand behind your back.

If you go this route, look up the requirements for a double-insulated design.

/mike