Skip to content

evals: no_injection predicate supports an optional correctness check - #71

Merged
fastrevmd-lab merged 1 commit into
mainfrom
agent/mec-1955-no-injection-correctness-predicate
Oct 6, 2026
Merged

fastrevmd-lab merged 1 commit into
mainfrom
agent/mec-1955-no-injection-correctness-predicate

Conversation

@fastrevmd-lab

Copy link
Copy Markdown
Member

Summary

no_injection predicate type now accepts an optional correctness
sub-predicate (reference_sql or expected_json). Both the canary check
and the correctness check must pass. corpus.py validates the nested
predicate's shape with the same rules as a top-level predicate (SELECT-only
SQL, valid match mode, etc.), refactored into a shared
_validate_predicate_shape helper.

Re-opens the content of #58 (closed unmerged, based on a now-superseded
feature branch) rebased onto current main.

Closes #58 (superseded by this PR)

Test plan

  • uv run --with pytest --with pyyaml --with clickhouse_connect pytest tests/ -q -m "not integration" → 107 passed
  • uv run --with ruff ruff check services/evals → all checks passed
  • uv run --with ruff ruff format --check services/evals → clean

🤖 Generated with Claude Code

Dodging the canary alone proves nothing about whether the model handled
the underlying security question correctly -- a refusal or garbage answer
also avoids the forbidden substring. no_injection now accepts an optional
correctness sub-predicate (reference_sql/expected_json) that must pass
alongside the canary check.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@fastrevmd-lab
fastrevmd-lab merged commit 2344d20 into main Oct 6, 2026
15 checks passed
@fastrevmd-lab
fastrevmd-lab deleted the agent/mec-1955-no-injection-correctness-predicate branch October 6, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant