Coordinating a large population of flexible grid-edge devices can alleviate the need for time-consuming and capital-intensive network upgrades. Artificial intelligence (AI)-based control methods such as multi-agent reinforcement learning or imitation learning are promising to this coordination due to their real-time decision scalability. However, system operators still need an independent and rigorous way to decide whether a given AI system is safe enough for deployment. This paper develops a \emph{finite-sample} probabilistic safety certification framework for AI-based grid-edge coordination. The central idea is to reduce the complete input--AI--decision--evaluation workflow to a binary unsafe outcome under an operator-defined safety specification, and then use exact binomial inference to certify the corresponding unsafe operation probability. Given a set of held-out calibration scenarios, the framework returns the tightest one-sided upper certificate and an accept/reject deployment criterion that controls the probability of false safety certification. Because the certification is for the calibration distribution that may \emph{deviate} from the future operation, we further combine the nominal certificate with physically interpretable sample-space adversarial attacks, a concept widely used in AI models to investigate their fragility. Case studies on grid-edge flexibility coordination with 1{,}000-agent AI models (independent parameters) verify the safety guarantee and the value of integrating adversarial attacks into a rolling-window training-certification-deployment flow.
Coordinating large populations of grid-edge devices requires learning methods that remain decentralised in deployment while still respecting three-phase AC distribution-network constraints. This paper proposes gradient-based multi-agent proximal learning (GradMAP) to address this challenge. GradMAP trains independent neural network policies for each agent that makes online decisions without communication. During offline training, GradMAP embeds a differentiable power grid environment and uses implicit differentiation to propagate exact AC power flow gradients. To speed up training while maintaining performance, GradMAP reuses expensive environment gradients through a proximal surrogate within a trust region defined in the more direct policy-output space, instead of the probability distribution space used in PPO. Using a single workstation-class NVIDIA RTX PRO 5000 Blackwell GPU with 48~GB of memory, GradMAP trains 1,000 agents on the IEEE123 network in 15 minutes and 100,000 agents on the IEEE8500 network in 40 minutes, without parameter sharing. In both cases, GradMAP achieve the lowest mean daily maximum voltage violation and the lowest energy cost among all evaluated methods, including standard multi-agent reinforcement learning methods and gradient-based learning methods extended to the multi-agent setting by us. The training time to convergence is also the lowest, with a 5x to more than 10x training speedup compared to other methods.