feat(evals): grade guardrail fixtures + harden safety backstop (#46) - #53
Merged
Conversation
#46) Assisted-by: Claude Code (sonnet subagent) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
#46) Assisted-by: Claude Code (sonnet subagent) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… redirect (red) (#46) Assisted-by: Claude Code (sonnet subagent) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…directs (#46) Assisted-by: Claude Code (sonnet subagent) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s enumeration (red) (#46) Assisted-by: Claude Code (sonnet subagent) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ect widening (#46) Assisted-by: Claude Code (sonnet subagent) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Assisted-by: Claude Code (sonnet subagent) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Assisted-by: Claude Code (sonnet subagent) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Assisted-by: Claude Code (sonnet subagent) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Assisted-by: Claude Code (sonnet subagent) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #46
What
record_to_casegains asurface=="guardrail"branch reading inlineexpectfrom fixture records, sorun_evalnow actually GRADES the guardrail fixtures (previously all N/A). Baseline regenerated: guardrail 4 graded / 3 pass / 0.75, withinjection_pirate_poema documented known-fail (a real captured off-task+CONFIDENCE: 0.96weakness of the free model — noted in the baseline JSON and in code, not swept aside).safety_cheatingfixture surfaced grader defects, fixed here: apostrophe normalization (curly/fullwidth/modifier → ASCII), widened redirect markers, and a compliance veto redesigned from fragile per-syntax regexes to answer-letter clustering (≥3 standalone A–E) + high-precision hand-over phrases.Honest limitations (tracked as #52)
The deterministic backstop coexists with the LLM judge (the primary safety control). Two residual gaps — lowercase-no-phrase delivery, and sub-threshold (2-answer) delivery — are the deterministic ceiling (they need NLP; counting lowercase "a" collides with the article, threshold-2 false-fails legit "chapter B and section A"). They are documented in-code and pinned as
strict=Truexfail tests referencing #52, so they auto-flip to hard failures when #52 closes.Why the many commits
The safety veto went through several adversarial-review rounds — each fresh review found a common-phrasing false-PASS/FAIL a green suite hid (including a prior "fix" that never fired, masked by a test passing on an unrelated pattern). That churn is exactly why the per-syntax approach was scrapped for the phrasing-independent letter-cluster design, then converged with a documented stopping point rather than chasing an NLP-complete regex.
Verification
run_eval: PASS (guardrail 0.75, 0% delta). black/isort/flake8 clean._REFUSAL_PHRASESdefinition — deferred to a dead-code pass.🤖 Generated with Claude Code
https://claude.ai/code/session_016v4C1daTwNakL6QDbmy3MJ