Gate a systemd sandbox exposure score before deployment
A service-unit review often ends with a useful but non-enforcing observation: systemd-analyze security reports an exposure score, the reviewer notes it, and the change still moves on. That is reasonable for discovery, but it does not make a sandbox regression visible to a pull request or deployment job. A unit can lose NoNewPrivileges=, regain access to host devices, or widen its filesystem access without a syntax error.
The useful boundary is an exposure budget. This guide uses systemd-analyze security --offline=yes --threshold= to make a candidate unit fail before it is installed or restarted. The check runs against a file in the review workspace; it does not contact the service manager, reload a unit, or start the service. The result is a small CI gate that distinguishes a valid unit file from one that also meets the team’s agreed sandbox target.