Skip to content

[BUG]: Tier 3 goal-accuracy judge can misgrade NBSP-sensitive answers #241

Closed

Description

@mavericksea-ai

I maintain Driftproof, an open-source tool for evaluating agent skills. While investigating a grading failure in Driftproof, we found that an LLM judge could confuse an ordinary space with a non-breaking space and reverse the correct verdict. We then tested whether the same behavior occurred in this project's grading path.

This is a judge-input robustness report with a proposed optional mitigation. The original Unicode is preserved; the observed error is in the judgment, not a demonstrated string-corruption bug in this library.

Expected and observed behavior

The task allows only U+0020 padding and rejects U+00A0. The correct candidate should pass; the candidate accepting NBSP should fail. Each result cell below contains three correct-answer and three wrong-answer trials.

Judge Correct raw judgments Correct judgments with character facts
Sonnet 5.5 3/6 6/6
Haiku 5.5 0/6 4/6

Haiku reversed both answer labels in all raw trials. Sonnet rejected both answers in all raw trials, so its three wrong-answer rejections were correct but its three good-answer rejections were false failures. With metadata, two Haiku trials still rejected the good answer by treating its NBSP negative assertion as an ordinary-space contradiction. All native scores in this comparison were exactly 0 or 1.

Reproduction fixture

The generator is deliberately escaped for reliable copying. Its returned strings contain literal NBSP, not a visible six-character escape.

TASK = 'Write a Python function accepts(s: str) -> bool. It must return True exactly when s consists of zero or more ordinary ASCII spaces (U+0020), then the ASCII text "42", then zero or more ordinary ASCII spaces (U+0020). Every other string must return False. Other whitespace characters are not permitted. Include a few assertions demonstrating the behavior.'

def answer(correct):
    chars = " " if correct else " \u00a0"
    return (
        "def accepts(s: str) -> bool:\n"
        f'    return s.strip("{chars}") == "42"\n\n'
        'assert accepts("42") is True\n'
        'assert accepts(" 42 ") is True\n'
        f'assert accepts("\u00a042\u00a0") is {not correct}\n'
        'assert accepts("43") is False\n'
    )

# Check the external task contract, not just the candidate's own assertions.
for correct in (True, False):
    ns = {}
    exec(answer(correct), ns)  # both candidates' own assertions succeed
    assert ns["accepts"](" 42 ") is True
    assert ns["accepts"]("\u00a042\u00a0") is (not correct)

Tested grading path

The tested entry point was the shipped judge_goal_accuracy in skillevaluator.tier3.eval_core.llm_judge, using its provider client and schema validation. This did not run an entire Harbor/Docker agent workload. The ground_truth was the full-correctness expectation below, and agent_text was the candidate answer.

from skillevaluator.tier3.eval_core.llm_judge import judge_goal_accuracy

expected = 'The supplied function satisfies the task for all str inputs, and the supplied assertions are consistent with the task specification.'
# Configure the provider and model in the usual way.
# Our measured provider was OpenAI-compatible and pointed at the CLI bridge below.
good_result = judge_goal_accuracy(
    question=TASK, ground_truth=expected, agent_text=answer(True), model=model
)
bad_result = judge_goal_accuracy(
    question=TASK, ground_truth=expected, agent_text=answer(False), model=model
)

Test method and scope

We used live claude-sonnet-5-5 and claude-haiku-5-5, Claude Code 2.1.311, and fresh contexts. Each model graded each of the two answers three times per condition (raw versus character facts), with shuffled order. This is one constructed task and two answers, not a prevalence sample. Two ASCII-only controls per model were graded correctly (4/4 for this integration).

The installed library ran its real prompt formatting, provider request, and grade parsing. A local OpenAI-compatible endpoint forwarded its system/user messages to authenticated Claude Code; tools were disabled for these prompt judges. JSON schemas, when requested, were supplied through the CLI's structured-output option and explicit schema text. The live model's result was returned to the library. Provider temperature/token settings were not forwarded; CLI defaults applied. No judge verdicts were mocked.

The native Anthropic API provider was not tested. These numbers establish behavior in this explicit CLI-adapter configuration; direct API behavior may differ. A separate local request capture showed that Claude Code preserved NBSP in outgoing request text, but this does not inspect provider-side preprocessing.

Version and environment

SkillEvaluator 0.6.0, revision c9d170e77bdef0b32a4811fb9b14484578559b2e; installed with the llm extra; Python 3.12 on macOS.

Character-facts intervention

The raw answer stayed unchanged. After the library rendered its judge prompt, the adapter appended a deterministic sidecar outside the answer containing character names, code points, one-based line/code-point columns, and ASCII-escaped source lines. It contained no grading verdict. For the correct answer:

line 6, column 17: U+00A0 NO-BREAK SPACE
line 6, column 20: U+00A0 NO-BREAK SPACE
escaped line: "assert accepts(\"\u00a042\u00a0\") is False"

An opt-in, bounded character-facts helper could make these distinctions available without altering the evidence. Finding such a character must not itself count as an error. Executable grading remains preferable when correctness can be checked by running tests. The experiment does not establish how often this occurs in ordinary evaluations, and it does not prove a general fix for all Unicode or all models.

Would an optional judge-evidence character inventory fit this path? The existing Unicode-smuggling scanner already has useful coverage for skill files, including optional space scanning; this concerns end-state evidence supplied to a Tier 3 judge. I am not reporting a new smuggling detector or a security exploit.

Follow-up — 28 October 2026

A separate pilot exercised SkillEvaluator v0.6.0’s unchanged standalone Harbor verifier and produced actual native reward artifacts. Two freshly generated, tools-disabled answers both incorrectly accepted NBSP padding. They were semantically equivalent and retained regardless of correctness.

Across both answers and both judges, all four original achieved=true judgments were false passes. With exact character facts, all four became correct achieved=false rejections. A generic Unicode warning retained all four false passes. For each answer, native overall scores changed from 1.00 to 0.75 with Haiku and from 0.99 to 0.75 with Sonnet. Goal scores changed from 1.0 and 0.9 respectively to zero.

This was one corrected task, with one repetition per combination and no correct-answer counterpart. It used the existing Claude CLI bridge, not a direct vendor API. No full Harbor job or collector was run; other dimensions were skipped or constant. There was no ranking reversal between the equivalent answers. This establishes a concrete verifier-score consequence in this setup, not general benchmark distortion.

Activity

  1. rng1995 commented on Nov 13, 2026

    @rng1995
    Collaborator

    Addressed by #242, released in v0.7.2. Setting SKILL_EVAL_JUDGE_CHARACTER_FACTS=1 appends bounded character facts to the accuracy, goal-accuracy and behavior-check judge prompts: code points, Unicode names, positions and ASCII-escaped context for non-ASCII whitespace and format characters. It works in both the host judge and the standalone Harbor verifier. The option is off by default and never changes the evidence itself.

    Closing. Thanks for the detailed measurements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions