DEV Community

Cover image for Proofreader vs. Rewriter vs. Prompt API: Test the Task, Not the Demo

Proofreader vs. Rewriter vs. Prompt API: Test the Task, Not the Demo

Raju Dandigam on November 23, 2026

“Make this message better” is not one task. It can mean correcting a spelling mistake, changing the tone, shortening a paragraph, or clarifying an ...
Collapse
 
paullovelace profile image
Paul Lovelace •

'Make this message better' is not one task — that line alone is worth the post, because every writing-API demo I've seen feeds all three APIs the same sentence and calls the difference a result. The Room 204 fixture is the part I'd steal: a condition that can silently disappear is exactly the failure that matters, and a literal-check catching the $250 but missing the weakened commitment is such a clean illustration of why mechanical checks aren't enough. One question: you keep the length setting stable for the tone comparison — do you think the Rewriter's length drift is a real-world problem, or mostly an artifact of the demo setup?

Collapse
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@paullovelace Keeping length as-is mainly controls this comparison: otherwise tone and compression change together. Length drift can matter in a real editor when a message must fit a field or notification, but I would evaluate shortening as its own task with its own preservation rubric before drawing that conclusion from this fixture.

Collapse
 
johnclentoira profile image
john Clent Oira •

Really interesting comparison, especially the point about testing preservation separately from fluency. I've seen similar challenges with LLM-based editing pipelines, where the output looks better but quietly changes the original intent. I'm curious, have you experimented with combining deterministic validation and LLM-as-a-judge to catch semantic drift? I'd love to discuss how this approach could scale in production, particularly for high-volume document processing.

Collapse
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@johnclentoira I have not run an LLM judge in this companion. A judge could help triage high-volume outputs after literal and structural checks, but I would calibrate it on held-out, human-scored examples of changed commitments and review disagreements. Otherwise the judge can reward fluent drift just as the editor does.

Collapse
 
johnclentoira profile image
john Clent Oira •

I agree that an LLM judge should be validated against human-reviewed examples first. What acceptance criteria would you use before trusting it to triage production rewrites, particularly for subtle changes to approval conditions or commitments?

Thread Thread
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@johnclentoira I would validate a judge on a held-out, human-scored set with separate slices for negation, approval conditions, and commitment strength. I would track missed meaning changes in those critical slices, not just overall accuracy, and keep uncertain cases in human review. Sampled audits after deployment would show whether the threshold still holds as document types change.

Collapse
 
bhaveshvaghela profile image
Bhavesh Vaghela •

The Room 204 example shows the limit of literal checks well: a sentence confirming the booking keeps 204, $250 and Friday and still passes. I see the same thing with auto-captions in video, where every word is there but a "not" gets dropped and the meaning flips. Would a small check on negation and condition words (not, unless, until) fit in the mechanical layer, or does that always end up in the human rubric?

Collapse
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@bhaveshvaghela A mechanical check for missing not, unless, or until is useful as an early warning, especially for captions. It still cannot tell whether the negation has the same scope or whether a rephrased condition is equivalent. I would keep that check as a cheap flag and score the actual commitment with the human rubric.

Collapse
 
mateo_ruiz_6992b1fce47843 profile image
Mateo Ruiz •

The distinction between mechanical preservation and semantic preservation is the most important part of this comparison. Keeping 204, $250, and Friday in the output doesn't guarantee that the original commitment survived. An AI can retain every protected literal while quietly changing a provisional hold into a confirmed booking or weakening an approval condition.

I'd add a few adversarial fixtures where the wording can remain fluent but the meaning changes: negation, conditional approval, uncertainty, and responsibility. Then evaluate whether a reviewer can identify those changes, not just whether the output passes automated checks.

One other useful metric would be the rate of meaning-changing edits that reviewers accept without noticing. That measures a more consequential failure than grammar accuracy. For writing APIs, the real benchmark isn't which one produces the most polished sentence; it's which one improves expression without taking liberties with the user's intent.

Collapse
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@mateo_ruiz_6992b1fce47843 The accepted-without-noticing rate is an especially useful metric because it measures the editor and review flow together. I would report that beside the raw meaning-change rate on the same held-out fixtures, with reviewers blinded to which API produced each suggestion. That could reveal whether a polished rewrite is making a dangerous change harder to spot.

Collapse
 
promptauditsaas profile image
 PromptAudit •

Testing the actual task rather than the demo is spot on — especially in the browser where the input context is often messy.

One challenge we see frequently with browser-side prompt APIs is that users inadvertently pass structured secrets or personal data into the prompt context before it reaches the model. How do you handle client-side input sanitation or masking before invoking the Prompt API?

Collapse
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@promptauditsaas This lab sends the brief to Chrome’s on-device API, not a cloud endpoint, but local processing still needs data minimization. I would keep the input limited to the selected text, show it before invocation, and make masking an explicit, reviewed step: silently replacing a name or amount could change the preservation task we are trying to test.

Collapse
 
promptauditsaas profile image
 PromptAudit •

@dandigam Spot on. That's precisely why silent replacement breaks reasoning tasks.

Our approach uses reversible, numbered tokens (e.g. [NAME_1], [IBAN_1]) that stay fully visible to the user before dispatch. The LLM processes the structural entity relationship without seeing raw PII, and only the client-side session maps it back on the output stage.

Full transparency for the operator + zero PII in the prompt context — even with local on-device inference, since local model cache and telemetry remain attack surfaces.

Thread Thread
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@promptauditsaas The visible, reversible token map is a useful safeguard. I would add a round-trip fixture for an output that duplicates, drops, or mutates [NAME_1], and fail closed before rehydration if token identities change. Otherwise a fluent rewrite could attach the right value to the wrong role. How do you validate placeholder integrity when the model reorders a sentence?

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

the Room 204 check proving $250 survived while missing that the message now confirms instead of holding conditionally is the whole case for testing the task, not the demo.

Collapse
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@robertpaschal Exactly. That confirming sentence is a constructed negative fixture, not an observed API failure. It makes the limit of the literal check visible, so the review rubric has to ask whether the approval condition and provisional hold survived.

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

the meaning flip surviving the value check is the scary part. the numbers look right while the intent quietly changes.

Thread Thread
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@robertpaschal Yes—that is why I would label the expected relationship in each fixture, such as “provisional hold until approval,” alongside the protected literals. A rewrite can keep 204, $250, and Friday while changing the approval condition. The value check should flag missing details; the semantic rubric should catch that change in commitment.

Thread Thread
 
robertpaschal profile image
Odinaka Robert Nnamani •

Putting the relationship in the fixture takes the guesswork out of the rubric. A 204 that still reads as a hold would pass the value check and fail where it should.

Collapse
 
shyam_48dcb5013cb431017d7 profile image
Shyam •

The most important point here is that a grammatically perfect rewrite can still be a terrible result if it changes what the user actually meant. Especially with things like money, deadlines, approvals and commitments , preservings intent should mater more tham making the sentence sound polished. I'd also test one scenario where the original text is ambiguous. Does the API preserve that ambiguity , or confidently invent a meaning ? That's where these writing tools can become genuinely risky.

Collapse
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@shyam_48dcb5013cb431017d7 Ambiguity is a strong fixture to add. I would score whether a rewrite preserves uncertainty separately from grammar: if “hold until Friday” leaves the exact cutoff unclear, the tool should not invent a date or turn the hold into a booking. A side-by-side review that highlights changes to dates, negation, and approval conditions could make that failure easier to catch before someone accepts the suggestion.

Collapse
 
hammiwor profile image
hammi •

solid writeup. the part about proofreader vs. rewriter vs. prompt api stuck with me.

Collapse
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@hammiwor Thanks. Writing the allowed change first makes the API choice testable: a grammar pass should preserve the commitment, while a formal rewrite may change wording but still must keep the room, budget, deadline, and approval condition.

Collapse
 
dafili profile image
Renhua Wei •

One call per variant can't separate the API from the model's sampling — run the same fixture twenty times and report violations/20, otherwise a single dropped "unless" is indistinguishable from variance. Test the language guard too: expectedInputLanguages: ["en"] turns a non-English fixture into a rejected session, and that rejection path is where your adapter returns undefined instead of text.

Collapse
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@dafili Repeated runs and violations per attempt would make sampling variance visible; the article deliberately stops short of a model winner. The non-English guard deserves a separate compatibility test. I have not verified the undefined path you mention, so I would check the adapter’s actual rejection behavior and require a clear unsupported-language outcome rather than compare it with generated text.

Collapse
 
dafili profile image
Renhua Wei •

Then separate the two outcomes instead of trusting if (!out): await session.prompt(x).then(v => ({ok: true, v}), e => ({ok: false, name: e.name})) puts a rejection and a resolved undefined in different buckets, which one try/catch around a single variable does not. If ok comes back true with v === undefined on the non-English fixture, the adapter swallowed the failure and your guard passes for the wrong reason.

Collapse
 
lin7c profile image
xcl •

The acceptance step stood out: copying the suggestion into the editable brief is safer than sending it directly, but a fluent rewrite can still slip past a quick visual scan. Highlighting only the words that change commitment — such as not, until, unless, or Maya approves — would make the human review in that step much more reliable. Did you consider treating those commitment words as a separate review surface, rather than relying on the full-text comparison?

Collapse
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@lin7c A separate review cue for commitment changes makes sense. I would flag edits near negation and condition markers, then show the entire original and suggested clause side by side; highlighting “unless” alone can miss a changed subject or scope. The cue would direct attention, while the reviewer decides whether the commitment survived.

Collapse
 
the_daily_flare profile image
The daily flare •

I think testing the task itself is the part I would trust most here.

Collapse
 
raju_dandigam profile image
Raju Dandigam Google Developer Experts •

@the_daily_flare Agreed. The key is to define the task before comparing outputs. A fluent rewrite that changes “hold until Friday” into a confirmed booking has failed even if it keeps every number and proper name.