Constant safety mannequin deployment with FPR calibration


In our earlier Dynamic AI Safety weblog and the underlying CAMLIS 2025 paper, we described a launch platform constructed to maneuver new protections into manufacturing with out disrupting buyer workflows. Such a platform is a requirement for safety techniques as a result of the fixed evolution and adaptation of adversaries require an identical response loop from distributors like Cisco.

Speedy detection-model churn creates potential downstream disruptions for purchasers, who all of a sudden, and with out figuring out it, begin utilizing a more recent model of the mannequin that behaves in a different way from the earlier iteration. One main variable between deployments is mannequin aggression: the newer mannequin is healthier however can also be deployed extra aggressively, breaking workflows that appeared advantageous just a few hours in the past.

Preserving the aggression stage between releases is one thing we deal with throughout each mannequin replace. If a buyer chooses a blocking tier that flags about 1 in 1,000 requests, a mannequin retrain shouldn’t silently flip that into 1 in 200 or 1 in 20,000. The detector could enhance beneath, however the buyer’s false-positive finances ought to stay the identical.

Completely different downstream customers additionally function at totally different factors on that tradeoff. A SOC operating aggressive blocking sits removed from a device that solely enriches logs, so it isn’t sufficient to protect one threshold throughout releases. The entire vary of working factors, from very aggressive to very conservative, has to hold the identical which means from one mannequin model to the subsequent.

It is a frequent downside for anybody deploying detection fashions, so we’re open-sourcing our resolution for FPR calibration that may be utilized earlier than a mannequin is launched to reduce the prospect of buyer disruption. The strategy works offline on benign scores and ships a bounded sklearn artifact together with the mannequin. The code is at github.com/cisco-ai-defense/fpr-model-calibration, and the paper describing the technical particulars might be downloaded right here.

Why false-positive charge is the appropriate contract

False-positive charge (FPR) is the fraction of benign visitors that will be flagged at a threshold. For a mannequin rating threshold, FPR estimates how a lot professional exercise the edge will interrupt in manufacturing.

FPR calibration differs from chance calibration, which estimates Pr(assault | rating). For a lot of safety fashions, that chance is dependent upon an assault distribution that’s uncommon, adversarial, and quickly shifting. Attackers change techniques when detectors enhance. The constructive class a mannequin sees throughout coaching is due to this fact a file of previous assaults, not a secure pattern of future assaults.

FPR calibration relies upon solely on benign visitors. In lots of manufacturing safety settings, benign visitors is extra plentiful, simpler to measure, and tied on to false-positive hurt. If the calibrated rating says a request is a 1-in-1,000 benign occasion, the product workforce can motive about alert quantity without having to know tomorrow’s assault prevalence.

What a calibrated rating means

The calibrator maps uncooked mannequin scores onto a set rating contract. The calibrated rating contract maps frequent working tiers to focus on FPRs:

The size is logarithmic as a result of manufacturing FPR choices are logarithmic. Transferring from 1% to 0.1% and from 0.1% to 0.01% are each tenfold reductions in benign alerts. A linear rating axis would compress the low-FPR area coated by the 0.50, 0.70, and 0.85 working tiers.

With the rating contract in place, coverage thresholds keep secure throughout mannequin releases. A coverage can block at 0.50, alert at 0.30, and enrich logs at 0.10. When the mannequin workforce ships a brand new detector model, it ships a brand new calibrator with it. The coverage thresholds preserve their FPR which means though the uncooked mannequin scores beneath modified.

How a lot knowledge is sufficient?

One frequent gotcha when estimating the efficiency of detection fashions is simply how a lot knowledge you really have to correctly calibrate, and even measure, a mannequin. Whereas assaults can appear to be all over the place in public check units, in apply they’re very uncommon, normally beneath 0.1% of visitors. At these charges, the mannequin must be extraordinarily correct to maintain the false-positive charge sensible, and calibrating it requires much more benign knowledge than one would count on.

A standard-approximation rule of thumb offers about 16 / p benign samples for plus-or-minus 50% relative precision at 95% confidence, the place p is the goal FPR. For frequent working factors, the tough pattern counts are:

Pattern measurement dominates low-FPR error in apply, and extra benign knowledge is the one path to tighter estimates.

Validation on a public benchmark

We validated the tactic on the general public Credit score Card Fraud Detection benchmark (284,807 transactions, 492 fraud circumstances), becoming the calibrator on a held-out benign subset:

The takeaway is easy: so long as the benign distribution stays pretty fixed between calibration and manufacturing, a mannequin might be calibrated very precisely.

What adjustments for product groups

An FPR-calibrated launch consists of the detector, the calibrator, and both calibrated-score serving or uncooked thresholds derived from the calibrator. Coverage thresholds preserve their FPR which means, prospects preserve their false-positive finances, and the mannequin can enhance beneath.

The identical contract additionally makes detector scores simpler to match throughout classes. If a prompt-injection detector and a data-leakage detector each emit calibrated rating 0.50, every rating means the identical factor about benign rarity. Compound insurance policies nonetheless want their very own FPR measurement, however their inputs not combine unrelated uncooked rating scales.

Getting began

Match the calibrator with fit_calibration_pipeline:

from fpr_model_calibration import fit_calibration_pipeline
import joblib

pipeline = fit_calibration_pipeline(benign_scores, n_knots=10000)
joblib.dump(pipeline, “calibration.pkl”)

Manufacturing inference calls the serialized sklearn pipeline:

pipeline = joblib.load(“calibration.pkl”)
calibrated = pipeline.predict(raw_scores.reshape(-1, 1))

FPR calibration offers mannequin releases a secure rating contract with out changing contemporary benign knowledge, drift monitoring, or detection-quality analysis. For safety techniques that retrain beneath adversarial stress, that contract lets detectors enhance whereas coverage thresholds preserve their FPR which means.

Hyperlink to the open supply GitHub repo might be discovered right here:
https://github.com/cisco-ai-defense/fpr-model-calibration

and the preprint:
https://arxiv.org/abs/2607.05481

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles