Encrypted control lets a cloud server run a plant's feedback controller on scrambled data it cannot read. The tool that makes this possible is fully homomorphic encryption (FHE), a family of schemes that support arithmetic directly on encrypted numbers. Every encrypted operation adds a little mathematical noise, and a controller that updates its internal state at every time step multiplies forever. The encrypted state therefore has to be periodically "refreshed", either by bootstrapping (re-encrypting on the server with an approximate polynomial) or by architectural workarounds. Before deployment, someone has to choose a set of cryptographic knobs: the ring dimension, the modulus chain, the fixed-point scale, the bootstrapping polynomial degree and how often to bootstrap. Today that choice is either made by hand for control loops, or made automatically by tools built for neural-network inference that maximize numerical precision. This proposal argues that precision is the wrong target for feedback control. Prior control theory shows that closed-loop stability depends on the relative error that bootstrapping injects, not the absolute error cryptographers usually report. So the right parameters are the cheapest ones that certify a target closed-loop performance bound, and these can be found by exhaustive, verified search because control loops are tiny compared to neural networks.
The application is electrochemical nitrate-to-ammonia conversion, a candidate replacement for part of fossil-fired Haber-Bosch ammonia production. Here the control stakes are concrete. Pushing current past the catalyst's selective window hands the electrons to hydrogen evolution, and real wastewater feeds swing from thousands of ppm down to tens of ppm. We will build a parameter selector that takes a controller, a plant model and a security level, and returns the lowest-latency encrypted configuration whose certified closed-loop gain stays within a chosen margin of the unencrypted controller. We test it on the existing chemical batch reactor benchmark and on a new nitrate electrolyzer simulation with current saturation and feed disturbances.
Core Claim
For dynamic encrypted controllers, a parameter selector that optimizes a certified closed-loop performance bound will reach the same certified performance as a precision-maximizing selector or a conservative default, at substantially lower per-step latency and modulus budget. It will also expose which architecture (bootstrapping, finite-impulse-response approximation, or resets) is cheapest at a given performance target. Written out, the selector solves
$$\min_{\theta} \; t(\theta) \quad \text{s.t.} \quad \lambda(\theta) \ge 128,\;\; t(\theta) \le h,\;\; \gamma_{\text{cert}}\big(\varepsilon_{\text{rel}}(\theta), T\big) \le (1+\delta)\,\gamma_{\text{nom}}.$$
Here $\theta$ collects ring dimension $N$, modulus chain $Q$, scale $\Delta$, bootstrapping polynomial degree $d$ and bootstrapping period $T$. The term $t(\theta)$ is measured per-step server latency, and $\lambda(\theta)$ is the security level from a lattice estimator. The sampling interval $h$ can itself be a decision variable. The bound $\gamma_{\text{cert}}$ is the $\ell_2$-gain certified by a linear matrix inequality (LMI, a convex feasibility test) given the relative bootstrapping error $\varepsilon_{\text{rel}}(\theta)$. The target is the nominal unencrypted gain $\gamma_{\text{nom}}$ plus tolerance $\delta$.
Relation to Prior Work
Two papers by Schlor and Allgöwer supply the certificate we reuse. Bootstrapping Guarantees models CKKS bootstrapping error as a sector-bounded uncertainty, shows that relative error is what matters for stability, and gives a lifted LMI test that accounts for periodic bootstrapping. That test tightens the $\ell_2$-gain bound on a second-order plant from 5.13 to 3.97, against an empirical 1.88. Comparison and performance analysis of dynamic encrypted control approaches puts bootstrapping, finite-impulse-response (FIR) approximation, state resets and re-encryption into one robust-control comparison on a chemical batch reactor. In both papers the cryptographic parameters are fixed by hand, for example a degree-25 polynomial. We turn their certificate into the objective of a search over those parameters. Neither paper does that.
FHE-Agent and FHE-Coder supply the method template, which is staged search with deterministic security checks. They also show that raw language-model prompting fails, with zero valid AlexNet configurations in ten attempts reported by FHE-Agent. Both target feed-forward networks with known finite depth, and FHE-Agent scores configurations by precision bits and latency. We keep their lattice-estimator gating but replace precision with a closed-loop certificate. We also drop the agent: a control loop has a handful of states, so the space can be enumerated and every candidate LMI-checked.
FHECAP evaluates non-linear actuation such as saturation and dead zones by converting between two scheme families, reporting at least 1.4× speedups over polynomial approximation and 1.8× over lookup tables. Its authors leave cross-scheme parameter choice manual. We treat its piecewise saturation operator as one candidate mechanism for enforcing the electrolyzer current limit, not as the core contribution.
On the chemistry side, Electrochemical Ammonia Synthesis—The Selectivity Challenge explains why hydrogen evolution wins whenever protons and electrons are abundant relative to the nitrogen reactant. That reasoning motivates a hard current ceiling that tracks feed concentration. Gradient-concentration RuCo and Ru-TiO2 nanosphere arrays supply the operating points that calibrate our simulator: over 93% Faradaic efficiency at 1.0 A/cm² in 2000 ppm nitrate, 71 mA/cm² at 62 ppm, and 98.8% efficiency at pH 1. These papers constrain the plant model; they say nothing about control.
Research Program
The work has three parts.
First, we build a plant model for a nitrate-reduction flow cell. It combines Butler-Volmer-type current–overpotential kinetics, a competing hydrogen-evolution branch whose share grows when surface nitrate is depleted, and a first-order mass-transport boundary layer. Parameters are fit so that the stylized cell reproduces the published operating points. We will be explicit that this is a calibrated caricature, not a validated digital twin. The controller regulates ammonia production rate by adjusting cell current, under a saturation ceiling that depends on nitrate concentration. Because the certificate of Bootstrapping Guarantees holds only for linear time-invariant systems, we certify on the linearization around each operating point. We then treat the remaining kinetic nonlinearity as an additional sector bound in the same LMI. Full nonlinear guarantees, which would need integral quadratic constraints, are out of scope; nonlinear behavior is checked by simulation.
Second, we build the selector. It enumerates power-of-two ring dimensions, modulus-chain splits, scales, bootstrapping degrees and periods, and optionally the sampling interval. It discards insecure candidates with a lattice estimator, as FHE-Coder does. For each surviving candidate it measures the empirical relative bootstrapping error with an encrypted microbenchmark and solves the lifted LMI. It then returns the latency-minimal certified configuration. The same loop scores FIR and reset architectures, so the architecture choice falls out of the search instead of being fixed in advance.
Third, we analyze where the savings come from. We measure the gap between the absolute-error precision that a precision-maximizing selector demands and the relative-error tolerance the loop actually needs, and how this gap varies with the plant's time constants and the target margin $\delta$.
Baselines
The naive reference is a conservative default. It uses the largest standard 128-bit parameter set that fits the multiplication depth, with the degree-25 bootstrapping polynomial and per-step bootstrapping used by Schlor and Allgöwer. Its certified gain and measured latency define "what a careful engineer would do without search." On the batch reactor, the corresponding published bootstrapped bound is 2.0332, against a nominal unencrypted 1.8030 (Comparison and performance analysis of dynamic encrypted control approaches).
The strongest architectural competitor is the FIR approximation. Its published bound of 1.8819 on the same benchmark is the best encrypted figure reported in the file, and it needs no bootstrapping. We will reimplement it on identical plant, controller and security level, sweeping FIR horizon lengths. Beating it means finding a configuration with a certified bound at or below 1.8819 at lower or equal per-step latency on the batch reactor. On the electrolyzer it means lower steady-state tracking error under the 2000-to-62 ppm feed step, which is where FIR's lost integral action should hurt.
The strongest parameter-selection competitor is a precision-maximizing selector in the style of FHE-Agent. We reimplement its objective (maximize precision bits subject to security and latency) inside our own enumerator, so search budget and candidate space are identical. No reported result was found on Lacuna for FHE-Agent on any control or dynamical-system task. The only figures in the file are inference figures, such as an MLP improving from 17.37 to 24.82 precision bits at 0.91 s, and these are not comparable.
The key ablation keeps everything fixed but replaces the relative-error sector bound with the absolute-error bound. This isolates whether the claimed savings come from the relative-error insight rather than from search itself. Periodic resets (published 1.8869–1.9508) and the cleartext controller are included as references. All methods share one CKKS library, one machine and one security estimator.
Why not just…?
Why not just use the conservative default and check whether latency fits? This is the most serious threat. Electrolyzer bulk concentration dynamics run on seconds to hours, so even a large ring dimension with frequent bootstrapping may fit comfortably inside the sampling interval. If our search finds that the default already meets the certified target with ample slack across all tested sampling intervals, then latency savings matter only for amortized cloud cost across many reactors. We will report it that way. The experiment that settles this sweeps the sampling interval downward toward the mass-transport timescale and records where the default stops fitting while the selected configuration still does.
Why not just run FHE-Agent by unrolling the loop to a finite horizon? Unrolling turns an infinite-horizon problem into a finite-depth one, but depth then grows with operating time (hundreds of hours in the cited catalyst studies), or else forces resets. Precision bits are also not the stability criterion. The ablation and the precision-maximizing baseline test directly whether the extra bits buy any certified gain.
Why not just use FIR approximation and avoid bootstrapping altogether? On the linear batch reactor FIR currently wins on certified bound. Our search includes FIR as a candidate. If it dominates on the electrolyzer too, the selector will say so, and that is a legitimate finding. We expect it to lose under large feed swings, because it truncates integral memory, but this is a hypothesis the feed-step experiment tests rather than a premise.
Why not just keep control in cleartext on site, or re-encrypt at the plant? Neither question is about parameters. They concern whether encrypted cloud control is warranted at all, and that depends on multi-party data-sharing settings this proposal assumes rather than demonstrates. Re-encryption trades cryptographic cost for round-trip communication, which Comparison and performance analysis of dynamic encrypted control approaches documents. We include its latency as a reference under a fixed simulated network delay so readers can see the crossover.
Proposed Experiments
On the batch reactor benchmark, with the published $\mathcal{H}_\infty$ controller at $h=0.1$, we report certified $\ell_2$-gain, empirical gain over long simulations, per-step latency and modulus bits consumed for every method. On the second-order plant from Bootstrapping Guarantees, we first check that our pipeline reproduces 3.97 at degree 25. We then show how far down the degree and bootstrapping frequency can go before the bound exceeds a 10% margin over nominal.
On the electrolyzer simulator we additionally report simulated ammonia Faradaic efficiency, time spent above the current ceiling, and tracking error after a step from 2000 to 62 ppm nitrate. These are run at sampling intervals spanning the mass-transport and bulk timescales.
The decisive checks are three. First, the closed-loop-certified selector should reach the FIR bound of 1.8819 or better on the batch reactor at lower latency than the conservative default. Second, the relative-error ablation should account for most of that saving. Third, on the electrolyzer, certified configurations should keep simulated efficiency within a few points of the cleartext controller through the feed step while the default either costs more or, at short sampling intervals, fails to fit. If the first two checks fail, the relative-error insight does not translate into cheaper parameters, and the claim is wrong.
References
- Bootstrapping Guarantees: Stability and Performance Analysis for Dynamic Encrypted Control
- Comparison and performance analysis of dynamic encrypted control approaches
- FHE-Agent: Automating CKKS Configuration for Practical Encrypted Inference via an LLM-Guided Agentic Framework
- FHE-Coder: Benchmarking Secure Agentic Code Generation for Fully Homomorphic Encryption
- FHECAP: An Encrypted Control System With Piecewise Continuous Actuation
- Electrochemical Ammonia Synthesis—The Selectivity Challenge
- Gradient-concentration RuCo electrocatalyst for efficient and stable electroreduction of nitrate into ammonia
- Ru-TiO2 nanosphere arrays: Efficient nitrate reduction catalyst under strongly acidic and high-salinity conditions