Rendering City/Country level maps / Masking outside

i am looking into providing tiles on a city, county, country level extent. Now i am playing with using a poly/geojson of the boundaries to limit the extent to the boundary.

Using osmium extract with strategy “simple” makes this pretty good, but sometimes produces polygons over the edges of the boundary because of broken poly topology.

So i am looking more into using a larger extent data (Using a buffer of the boundary) and then masking of outside of the boundary.

Does anyone have a simple solution like adding a layer in mapnik with an inverted poly or something? Another nice idea would even be to produce a “drop shadow”.

So possibly a top layer which is only transparent at its extent or something.