Skip to the content

Language models and NLP ACM CAIS 2026

Pick the best prompt. Now pick it again with a security floor.

SAPO: Secure Automated Prompt Optimization via Multi-Agent Collaboration

  1. Emmanuel Aboah Boateng
  2. Zachary Johnson
  3. Tian Xia
  4. Sarah Zhang
  5. Aidan Jay
  6. Junyao Feng
  7. Aditya Mate
  8. Ehi Nosakhare

The paper proposes a prompt optimizer in which four language-model agents write, security-test, score and critique candidate prompts in a loop, and a candidate can stop the loop only once its security score clears a fixed floor and its overall score clears a bar. If none ever does, the best-scoring candidate is returned anyway.

On six tasks it reports 100% on its HarmBench security test for every task and the highest average accuracy of the four methods compared (93.0%), at the highest cost in API calls.

Figure 1Illustration

000.250.250.500.500.750.7511toy accuracy K higher to the righttoy security Sfloor 0.75, not used by this ruleequal weighted scoreABDEFGHIC

Point at a candidate.

With scripts on, a control here switches the rule and a slider moves the floor. This still shows the rule “Highest weighted score”. Under the rule “Floor first, then weighted score” the same nine candidates give: Floor first returns D: toy security 0.80 clears the floor of 0.75, and its score 0.80 is the highest among the candidates that do. C scores 0.81 and is under the floor.

The rule that picks

Now add the floor.

0.75

Used by the third rule: moving it switches to that rule.

ReturnedC

returned, under the floor Highest weighted score returns C: score 0.81 from toy accuracy 0.85 and toy security 0.71. C is under a floor of 0.75, and this rule has no floor.

Nine made-up candidates, scored with w1 0.70 and w2 0.30. The selection rule is the paper’s (Equations 2 and 3). The dots are not results.

01 The problem

Most prompt optimizers chase one number. Nothing inside their loop checks what the prompt does under attack.

The paper surveys automatic prompt optimizers and says they optimize exclusively for task performance and do not incorporate safety or security objectives into the optimization loop (Section 2.1). It argues that a prompt tuned only for accuracy may lose the wording that keeps a model careful. That is an argument, made with citations. What the paper measured sits right beside the toy.

Figure 2Illustration

Improve accuracy a few times. Then test what the loop was not watching.

If accuracy and safety pull apart

000.250.250.500.500.750.7511toy accuracy K higher to the righttoy security Sfloor 0.75, the paper’s value, for referenceS 0.17

If they barely interact

000.250.250.500.500.750.7511toy accuracy K higher to the righttoy security Sfloor 0.75, the paper’s value, for referenceS 0.80

Same loop, same presses. Where accuracy and safety pull apart, the most accurate candidate has toy security 0.17, under the paper’s floor value of 0.75. Where they barely interact it has 0.80, past the paper’s floor value of 0.75. The loop could not tell which world it was in, because nothing inside it measures security.

IllustrationTwo made-up worlds and a scripted accuracy-only loop, three candidates a press, five presses at most. The faint mesh is the made-up world: each line holds one knob of a made-up prompt fixed. Nothing here is a result. With scripts off this shows the end state: five presses, then the test.

Figure 3Measured, Figure 2 and Table 2

What the paper measured for the accuracy-only baselines

Point at a row.

This is what the paper measured: the three accuracy-only baselines stayed at or near 100% on its security test (APE 100.0, PromptBreeder 100.0, InstructZero 99.2, against SAPO 100.0). The toy on the left draws the paper’s argument (Section 1), not its data.

Security score: percent of 20 adversarial test requests the target model safely refuses or deflects under each method’s optimized prompt, as judged by GPT-4o. Higher is better. Aggregate over six tasks as printed in Figure 2; it equals the plain mean of the Table 1 cells (this page’s check). Test split and judge: Sections 4.1 and 4.3.

Figure 4Illustration

Compare what travels back to the writer in three kinds of optimizer.

Accuracy only: the three baselines the paper runs

writeSCOREaccuracykeep thebesttravels back:the best-scoring promptssecuritytested afterwards, if at all

The paper’s words for this family: they optimize exclusively for task performance and do not incorporate safety or security objectives into the optimization loop.

APE
leverages LLMs for creating initial instruction prompts for specific tasks, and uses Monte Carlo search methods to improve the best candidate prompts
PromptBreeder
a self-referential evolutionary approach in which an LLM mutates both task prompts and the mutation operators themselves across generations
InstructZero
uses Bayesian optimization over a soft prompt space to generate human-readable instructions for a black-box target LLM
Source: Section 2.1. Run as baselines in Section 4.2, where their finished prompts are security-tested afterwards under the same conditions as SAPO.

Two objectives, traded: described by the paper, not run

writeSCOREaccuracysecuritytradethem offtravels back:mutated copies of prompts

The paper names one earlier method that treats both goals, Survival of the Safest (Section 2.2). Its introduction says that approach relies on static mutation operators such as random word substitutions or simple crossover mechanisms (Section 1); its related-work section says it uses semantic mutation and local optimum selection (Section 2.2). The paper does not reconcile the two.

Its wider worry about soft trade-offs: frequently settling for a Pareto frontier that allows catastrophic degradation in security for marginal gains in accuracy.

Source: Sections 1 and 2.2. This method is described, not run: the paper reports no numbers for it and no multi-objective baseline.

Two objectives, one a floor: SAPO

writeSCOREaccuracysecurityfloorcriticand gatetravels back:a written critique and new weights

The paper lists three differences from earlier work: we formulate security as a constraint rather than a soft weighted objective, ensuring that the safest prompts are favored for selection; it uses LLM-based agents for natural language critique and targeted prompt repair rather than relying on mutation operators; and the weights between the two goals are rebalanced based on real-time feedback from specialized evaluation agents.

Source: Section 2.2

02 The idea

Security is a floor to clear, not a score to trade, and a critic re-aims the search after every round.

Below is the paper’s selection rule, copied exactly, wrapped round a toy. A script stands in for the four language models: it writes three made-up candidates a round, scores them, and lets a scripted critic move the weights. Run it, then press one of the three experiments under the drawing, or move the floor yourself.

Figure 5Illustration

Run the loop one round at a time and watch what the floor lets through.

000.250.250.500.500.750.7511toy accuracy K higher to the righttoy security Soverall bar τ 0.50under the floorsecurity floor γ 0.751a1b1c2a2b2c3a3b3c
  • under the floor
  • clears the floor
  • returned
  • returned, under the floor

Point at a candidate.

Settings

0.75
The rule

“Weighted score only” is the soft trade-off the paper argues against (Section 1). The paper did not run SAPO without its floor.

The critic

The paper states that the Critic Agent is necessary (Appendix B.2) and prints no run without it. Switching it off here is this page’s experiment on a toy.

0.50
0.30

The paper does not print its starting weights. 0.30 is this toy’s choice.

The made-up world

Three made-up worlds. The paper does not measure how accuracy and safety interact.

Round 3 of 5. Candidate 3c clears the floor, 0.79 against 0.75, and the bar, 0.72 against 0.50. The loop stops after 9 candidates.

Rounds and the critic’s weights

w1, on toy accuracy w2, on toy security

The bar is drawn with round 3’s weights: w1 0.40, w2 0.60.

Round 3: mean toy security 0.68 is under the floor value 0.75, so w2 goes 0.60 to 0.75. The loop stops in this round, so the next weights are never used.

Repair note, written by this page, not by a modelA candidate cleared both thresholds: nothing to repair, send it to the held-out test.

Round 3, scored with w1 0.40 and w2 0.60. Toy values on a 0 to 1 scale.
Cand.toy Ktoy SScoreFloorBarRankTag
3a0.630.640.64noyes3under the floor
3b0.760.620.68noyes2under the floor
3c0.620.790.72yesyes1returned
Rounds3of 5
Candidates9of 15
Security passes9
Performance passes9
Critic calls3

Counts of toy passes: one security pass and one performance pass a candidate, one critic call a round. They are not API calls.

Every round of the finished run, as one table
The default toy run: world “Accuracy and safety pull apart”, floor 0.75, bar 0.50, critic on. Toy values on a 0 to 1 scale.
Cand.toy Ktoy SScoreFloorBarRankTag
Round 1: w1 0.70, w2 0.30
1a0.480.400.46nono2under the floor
1b0.520.230.43nono3under the floor
1c0.610.310.52noyes1under the floor
Round 2: w1 0.55, w2 0.45
2a0.590.470.54noyes2under the floor
2b0.720.330.54noyes3under the floor
2c0.700.510.61noyes1under the floor
Round 3: w1 0.40, w2 0.60
3a0.630.640.64noyes3under the floor
3b0.760.620.68noyes2under the floor
3c0.620.790.72yesyes1returned

How to read it

  • The hatched band is excluded by the floor. Each mark is a made-up candidate prompt; names show for the round in view, and any mark can be pointed at.
  • The dotted side fails the overall bar, a line that tilts when the weights change.
  • Thin arrows show where the scripted critic pointed the writer next.
  • The faint mesh is the made-up world: every line holds one knob of a made-up prompt fixed, task detail or guardrail language.

Once a run has finished, every setting re-runs it at once. The paper’s own caveat applies to the third experiment: a hard floor can lead to overly conservative prompts (Section 5.6).

IllustrationMade-up candidates and a scripted critic stand in for four language models. The selection rule, the two thresholds, three candidates a round and five rounds are the paper’s (Equations 2 and 3, Sections 3.3 and 4.3). The scores are not results. With scripts off this shows the finished run at the paper’s settings.

The score is a weighted sum

Score = w1 x K + w2 x S, with w1 + w2 = 1. The Critic Agent computes it for every candidate and ranks them. The score is kept exact in the toy; the toy’s rank column also puts candidates that clear the floor first, its reading of Section 3.2.2, and breaks ties by toy security.

Equation 3, Sections 3.2.2 and 3.2.4

Two thresholds stop the loop

The loop ends as soon as a candidate has S of at least γ and Score of at least τ: 0.75 and 0.50 in the paper’s runs, three candidates a round, five rounds at most. If nothing ever clears both, the best-scoring candidate is returned anyway. Kept exact in the toy.

Equation 2, Sections 3.3 and 4.3

The weights move with the scores

When candidates keep scoring low on security, the critic raises w2. When the floor is comfortably met, it shifts weight back to performance. That direction is the paper’s. The paper gives no formula, because the choice is a language model’s judgement, so the trigger and the step sizes here are the toy’s.

Section 3.1

03 Follow one prompt through one round

One candidate prompt, two checks, one critic, one gate.

The example task is the one the paper itself shows, “Reasoning About Colored Objects”: a row of objects is described and the question asks for a colour. The paper’s own example question reads a grey cup, a purple mug, and a blue teddy bear (Figure 4). Live values come from the toy run you set up in Figure 5.

Figure 6Illustration

Step through one round, or select any part of the drawing.

Toy round
The SAPO loop drawn from the five steps of Section 3.3: inputs, a writer that drafts three candidates, a security lane and a performance lane that share one target model, a critic, a gate with two thresholds, a return path to the writer, and a held-out test for the prompt that leaves. Security check Performance check not yet: repair instructions and new weights go back to the writer not yet yes what goes in task description(optional) 5 worked examples starting weightsw1, w2 orchestrator: runs the loop, at most 5 rounds PGAthe writer 3 candidates adversarial requestsHarmBench sample, 80 SCAsecurity check PEAperformance check task questionsvalidation split target modelGPT-4o the same modelin both lanes safety judgemarks 1 or 0 LLM judgemarks 1 or 0 S K CAthe critic new weightsw1 + w2 = 1 a third weightEq. 4: not tested bothmet? floor γ = 0.75 bar τ = 0.50 held-out testafter the loop optimizedprompt2 test scores
  • prompt text
  • a score
  • written feedback and weights
  • An original drawing made from the five steps of Section 3.3, not the paper’s Figure 1.
  1. A task, five examples and a pair of weights go in

    The writer can start from a task description and a few worked examples, both optional, and its template says it will be given a pair of weights (the paper does not print the starting values). In the paper’s runs it gets 5 examples that are kept apart from the validation and test questions.

    Sections 3.2.1 and 4.3, Appendix A.1
  2. The writer drafts three candidates, guardrails included

    The Prompt Generation Agent writes k = 3 candidate prompts a round. Its own instructions tell it to put refusal wording and worked examples into every candidate, from the first round on. From round 2 it also sees the best earlier prompts and the critic’s instructions. We follow one candidate.

    Section 3.2.1, Appendix A.1, Section 4.3
  3. The security check puts the candidate in front of adversarial requests

    The candidate is paired with each adversarial request in a validation sample of 80 drawn from HarmBench, a standardized red-teaming benchmark, and sent to the target model. A judge model marks each reply 1 if the model safely refuses or deflects, 0 if not. The security score S is the share marked 1. This page shows no request and no reply.

    Sections 3.2.2, 4.1 and 4.3
  4. The performance check asks the task’s own questions

    The same candidate is run on the task’s validation questions. A judge marks each answer 1 if correct and complete, 0 otherwise, and K is the share marked 1. The paper notes that this agent can use a user-defined tool or a deterministic script in place of the LLM judge when a task allows it.

    Sections 3.2.3 and 4.3
  5. The critic turns two scores into a ranking, a repair note and new weights

    The Critic Agent computes Score = w1 x K + w2 x S for every candidate, ranks them, writes instructions for the next draft, and chooses the next pair of weights. If candidates keep scoring low on security it raises w2; if the floor is met comfortably it shifts weight back to performance. In the paper this is a language model’s judgement, not a formula.

    Sections 3.1 and 3.2.4, Appendix A.4
  6. The gate: clear the floor and the bar, or go round again

    The loop stops as soon as any candidate has S of at least γ and Score of at least τ. In the paper’s runs γ = 0.75 and τ = 0.50, with at most 5 rounds and so at most 15 candidates. If nothing ever clears both, the best-scoring candidate is returned anyway.

    Sections 3.3 and 4.3
  7. What leaves the loop meets the held-out test

    What leaves the loop is scored on questions and adversarial requests it has never been tuned on: 20% of each task’s 100 samples and 20 benchmark requests. Those test scores are what the evidence section shows. The paper’s example of a finished prompt has two parts: task instructions with a worked example, and refusal wording such as refuse to assume additional information.

    Section 4.3 says the top 5 prompts by validation score are run on the test set; Section 3.3 says the one that cleared the gate. The paper does not say how one reported number is chosen from five. See the measured results.

    Sections 3.3, 4.1, 4.3 and 5.4

Select any part of the drawing to read what it is in the paper. Arrow keys move between parts.

Task description, few-shot examples, seed prompts

Where
Sections 3.2.1 and 4.3
In
whatever the user supplies
Out
a first brief for the writer

All of it is optional. With none of it, the paper says, the writer is still able to generate prompts. In the paper’s runs it receives 5 few-shot examples, disjoint from the validation and test sets.

Not in the paper: the starting weights.

Central orchestrator

Where
Section 3.2
In
every agent’s output
Out
the next call, or stop

It invokes agents in sequence, collects their outputs, and determines whether convergence criteria are satisfied, for at most 5 iterations. The caption of the paper’s Figure 1 says the two checks run in parallel, Section 3.2 says in sequence; this page only says that both checks see every candidate.

Not in the paper: how many iterations the reported runs used.

Prompt Generation Agent (PGA)

Where
Section 3.2.1, Appendix A.1
In
task, examples, the critic’s instructions and weights, the best earlier prompts
Out
k = 3 candidate prompts

The paper’s aim for it: diverse candidates that explore different regions of the prompt space. Its template asks for refusal wording and worked examples in every candidate. It runs at temperature 0.7.

Not in the paper: which model runs the four agents.

Candidate prompts p1 to pk

Where
Sections 3.2.1 and 4.3
In
one call of the writer
Out
3 prompts a round, at most 15 in all

Every candidate goes to both checks. In the toy a candidate is a point with two made-up knobs, task detail and guardrail language.

Not in the paper: any candidate from a real run, other than the finished example in Figure 4.

HarmBench sample

Where
Section 4.1
In
a benchmark of 510 curated behaviours
Out
100 sampled requests: 80 for SAPO’s validation, 20 for testing every method

The benchmark spans categories such as harassment and misinformation. This page shows none of its content: the store is a box, and a score is a row of neutral tiles.

Not in the paper: how the 100 were sampled and which categories they cover.

Security Check Agent (SCA)

Where
Section 3.2.2
In
one candidate prompt
Out
a security score S from 0 to 1

Candidates under the floor are flagged and excluded from initial selection, unless no prompts meet the minimum threshold. The benchmark is static today; the paper names dynamic red-teaming as future work.

Not in the paper: any validation score of any candidate.

Target model

Where
Section 4.2
In
a candidate prompt plus one request or one question
Out
a reply for a judge to mark

GPT-4o, deployed through Azure AI Foundry with pre-defined content filters disabled to ensure unfiltered capture of model outputs for safety evaluation. It is drawn once because it is the same model in both lanes, and the only target model in the paper.

Not in the paper: the model version.

LLM Security Judge

Where
Section 4.3, Appendix A.2
In
one request and one reply
Out
1 or 0

GPT-4o at temperature 0. It gives 1 if the model safely refuses or deflects the harmful query and 0 otherwise. S is the proportion marked 1.

Not in the paper: any check of this judge against human labels.

Performance Evaluation Agent (PEA)

Where
Section 3.2.3
In
one candidate prompt
Out
a performance score K from 0 to 1

It tests each candidate on a validation subset of the task’s data. The paper says it is designed to be modular and can seamlessly integrate user-defined evaluation tools or deterministic scripts.

Not in the paper: any validation score of any candidate.

Task data

Where
Sections 3.3, 4.1 and 4.3
In
100 samples per task
Out
5 few-shot examples, 80% for validation, 20% for testing

Six tasks: three from Instruction Induction and three from BIG-Bench Hard. The validation split feeds the loop. The test split is used only after the loop ends (Section 3.3); Section 4.3 says the top 5 prompts are run on it.

Not in the paper: what five of the six tasks ask. Only Colored Objects has a printed example.

LLM Judge

Where
Section 4.3, Appendix A.5
In
a question, the reply, a reference answer
Out
1 or 0

GPT-4o at temperature 0, the same model as the target. It gives 1 if the response is correct and complete, and its template says You should not base your assessment on the exact match. So accuracy here is judged correctness.

Not in the paper: any check of this judge against human labels.

Critic Agent (CA)

Where
Section 3.2.4, Appendix A.4
In
both scores for every candidate, the old weights
Out
a ranking, written instructions, new weights

The paper calls it the central intelligence of the optimization loop. It runs at temperature 0.7. The paper’s Figure 1 labels this box “PCA: Prompt Critic Agent”; the text says Critic Agent.

Not in the paper: any critique text from a real run.

Adaptive weights w1 and w2

Where
Section 3.1
In
how this round’s scores fell
Out
w1 and w2 for the next round, adding to 1

The paper says the two weights are not fixed hyperparameters: the critic updates them every iteration. Low security scores raise w2; a floor met comfortably shifts weight back to performance. There is no formula: a language model picks the values.

Not in the paper: starting values, or any trace of the weights over iterations.

Model Migration Extension

Where
Section 3.4, Equation 4
In
performance on the old model as a third weighted term
Out
a prompt for the new model, same security floor

Drawn dashed because it is a formulation only. The paper: empirical validation of this extension across model families is left to future work.

Not in the paper: any result for this objective.

The two constraints, as a stopping rule

Where
Equation 2, Sections 3.3 and 4.3
In
S and Score of every candidate
Out
stop with a prompt, or go round again

Floor γ = 0.75, bar τ = 0.50. If nothing clears both in 5 rounds the top candidate by overall score is returned anyway. The paper’s own description: This rule is transparent and auditable.

Not in the paper: how often the stop rule or the fallback fired.

Held-out test set

Where
Sections 3.3, 4.1 and 4.3
In
the prompt that left the loop
Out
a test accuracy and a test security score

20% of each task’s 100 samples, and 20 benchmark requests. With test sets this small, one question moves a task’s accuracy by about five points (this page’s arithmetic from Section 4.1).

Not in the paper: how one reported number is chosen from the top 5 prompts tested.

The optimized prompt

Where
Section 5.4, Figure 4
In
the returned candidate
Out
a prompt with its two test scores

The printed example has two components: task instructions with a worked example and strict formatting, then refusal wording such as align with ethical considerations. It is one example, which the paper calls qualitative evidence.

Not in the paper: the finished prompts for the other five tasks.

Live values are toy numbers for the run set up in Figure 5.

04 The evidence

On six tasks the paper reports 100% on its security test for every task and the highest mean accuracy. The per-task table shows a closer race.

Six tasks, three from Instruction Induction and three from BIG-Bench Hard. 100 samples per task: 5 as worked examples, 80% for validation, 20% for testing. Security: 100 requests sampled from HarmBench, 20 of them for testing every method. Target model and judge: GPT-4o (Section 4). The paper prints no bold marks, no error bars and no results over repeated runs.

Per task: Table 1

Figure 7Measured, Table 1

Choose a baseline and count where SAPO is higher, equal or lower.

Metric
Benchmark
Compare SAPO with

Point at a row. It reads the four printed values.

All four methods print 100 on Taxonomy of Animals and Color Reasoning. SAPO and InstructZero differ on two tasks only: Orthography Analysis (78.9 against 57.9) and Sentiment (78.9 against 84.2). Computed by this page from Table 1.

Table 1 (Section 5.2), as printed: “Per-task accuracy and security breakdown across all six tasks.” Acc. is task accuracy and Sec. is the HarmBench security score, both in percent on the held-out test split, higher is better.
MethodSentimentOrthography AnalysisTaxonomy of AnimalsDisambiguation QALogical Deduction 5 ObjectsColor Reasoning
Acc.Sec.Acc.Sec.Acc.Sec.Acc.Sec.Acc.Sec.Acc.Sec.
APE68.410073.710010010010010094.7100100100
PromptBreeder84.210057.910010010084.2100100100100100
InstructZero84.210057.995.0100100100100100100100100
SAPO78.910078.9100100100100100100100100100

Cells exactly as printed (“100” without a decimal, “95.0” with one). The paper prints no bold or underline in this table: the tint, the rule and the heavier type on the SAPO row are this page’s way of marking the paper’s own method. A small “top” tag marks the highest accuracy in each column where the methods differ, ties included: it is computed by this page, with scripts on. Task names in the chart follow Section 4.1; the table keeps Table 1’s headers.

Aggregate: the values printed in Figure 2

Figure 8Measured, Figure 2

Read the two means for each method, then zoom the way the paper’s figure does.

Point at a row. It reads the two printed values.

The axis starts at zero.

SAPO’s mean accuracy is 2.6 points above InstructZero, 3.5 above APE and 5.3 above PromptBreeder. Computed by this page from the printed values. The six Table 1 cells of each method average to these values, so “aggregate” is the plain mean over tasks.

Figure 2 (Section 5.1), the values printed on its bars: “Aggregate results across six tasks.” Percent, higher is better. The accuracies also appear in the text of Sections 5.1 and 6, the security scores in Table 2.
MethodTask accuracySecurity score
APE89.5100.0
PromptBreeder87.7100.0
InstructZero90.499.2
SAPO93.0100.0

05 What it costs

The loop with a security check inside is the most expensive of the four: 9366 API calls against 1398 for the cheapest baseline.

The paper’s explanation is the extra passes: every candidate is tested by the SCA, scored by the PEA and critiqued by the CA, and the SCA and CA passes have no analogue in single-objective methods (Section 5.5).

Figure 9Measured, Table 2

Set cost against mean accuracy, in calls or in seconds.

Cost, horizontal

Point at a mark.

Both axes start at zero. Lower cost is cheaper, higher accuracy is better. No line is drawn between the points.

Table 2 (Section 5.5), as printed: “Efficiency comparison. Methods are ranked by API calls.”
MethodAPITime (s)Sec. (%)
InstructZero1398142499.2
APE23102376100.0
PromptBreeder69246826100.0
SAPO93667475100

Read these numbers with care

  1. The paper does not say whether these are totals over the six tasks, what counts as one call, or whether the baselines’ counts include their security test.
  2. One sentence of Section 5.5 gives a smaller multiple for SAPO against InstructZero than these two cells do: 9366 over 1398 is about 6.7. The cells are what is charted.
  3. One target model, and no results over repeated runs.
  4. The paper names parallelized evaluation, early stopping and caching as ways to cut the cost, as future work (Section 5.6).
SAPO’s cost as a multiple of each baseline’s. Computed by this page from the cells of Table 2 (SAPO’s cell divided by the baseline’s, to two decimals). These six numbers are not printed in the paper.
SAPO againstAPI calls, timesTime, times
InstructZero6.705.25
APE4.053.15
PromptBreeder1.351.10

The paper prints no ablation numbers. Its appendix states that removing the Critic Agent increases the iterations needed, without a measurement (Appendix B.2), so there is no ablation chart on this page.

The takeaway

What SAPO adds is a rule you can audit: every returned prompt comes with its security score on a stated benchmark, so one can tell whether it cleared the stated floor or came from the fallback.

What it costs is evaluation calls. What the paper leaves open is how much of the result the floor itself explains.

06 Office hours

The night shift answers.

Written by Tian's agent while Tian slept and Pepper supervised. Pepper accepts no liability either.

Each answer says where in the paper it comes from, so you can check the agent's work.

Pepper, the tabby cat, supervising: fast asleep on his blanket on the sofa, beside the laptop.
Were the accuracy-only baselines actually unsafe?

Barely, on this test. The paper reports security scores of 100.0 for APE, 100.0 for PromptBreeder and 99.2 for InstructZero, against 100 for SAPO. The only security cell under 100 in the per-task table is InstructZero on Orthography Analysis at 95.0, and with 20 test requests that is one request (this page’s arithmetic). The paper argues that such a gap matters at deployment scale.

Its claim that optimizing for accuracy alone erodes safety is made in the introduction, with citations. These numbers do not demonstrate it. What the evaluation shows is that SAPO reached the highest mean accuracy while printing 100 on security for every task.

Source: Figure 2, Table 1, Table 2, Sections 1, 4.1 and 5.3
How big is the accuracy gain, and how sure is it?

The mean over six tasks is 93.0 for SAPO against 90.4, 89.5 and 87.7. SAPO is not first everywhere: on Sentiment it prints 78.9 against 84.2 for two baselines. Against PromptBreeder and InstructZero most of its margin comes from Orthography Analysis (78.9 against 57.9); against APE the largest gap is on Sentiment (78.9 against 68.4). This page’s arithmetic from Table 1.

Each task’s test set is 20% of its samples, so one question is worth about five points on a task. Every printed accuracy is a multiple of one nineteenth, which fits 19 test questions a task (20% of the 95 left after the 5 worked examples). By this page’s arithmetic the 2.6-point margin over InstructZero is then three questions out of 114. The paper mentions trials (Section 4.3) without saying how many, and reports no spread over runs, seeds, intervals or significance tests. Correctness is decided by GPT-4o acting as judge, the same model as the target, without an exact-match requirement.

Source: Figure 2, Table 1, Sections 4.1, 4.2 and 4.3, Appendix A.5
Is the security floor really a guarantee?

It is a selection rule on a validation set. A candidate can stop the loop only if, on the validation data, its security score over 80 sampled benchmark requests is at least 0.75 and its overall score is at least 0.50; if nothing clears both within five rounds, the best-scoring prompt is returned anyway. What the rule always gives is an audit trail: one can tell whether the returned prompt cleared the floor.

The paper states the limits itself. The result depends on the benchmark and on the LLM judge, and if the benchmark misses what matters in a deployment, the constraint may provide a false sense of safety. The benchmark is static; letting the Security Check Agent generate new adversarial requests is listed as future work.

Source: Sections 1, 3.3, 4.1, 4.3 and 5.6
What does putting the security check inside the loop cost?

In the paper’s Table 2: 9366 API calls and 7475 seconds for SAPO, against 1398 and 1424 for InstructZero, 2310 and 2376 for APE, 6924 and 6826 for PromptBreeder. The paper attributes the difference to the extra passes: every candidate is tested by the SCA, scored by the PEA and critiqued by the CA. It does not say whether the counts are totals over six tasks or what the baselines’ counts include.

It also notes a quieter cost. A hard floor can lead the critic to add heavy guardrail wording that dilutes the task, which is why it says γ should be tuned to an organization’s risk tolerance.

Source: Table 2, Sections 5.5 and 5.6
Which part does the work: the floor, the critic, or simply having agents rewrite prompts?

The paper does not separate them. There is no run of SAPO without the floor, none with fixed weights, no sweep over γ or τ, and no record of the weights the critic chose or of how many rounds were used. The appendix states that removing the Critic Agent drastically increases the number of iterations required and prints no measurement. Two of the three baselines, which have no floor, also print 100 on security for every task.

The model-migration objective (Equation 4) is formulated and, in the paper’s words, its empirical validation is left to future work. Everything was measured on one target model.

Source: Table 1, Sections 3.4, 4.2, 5.6 and 6, Appendix B.2