Skip to content

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

Closed
fastrevmd-lab wants to merge 1 commit into
bors/mec-568-log-field-injection-defense-v3from
agent/mec-1673-injection-correctness-predicate
Closed

fastrevmd-lab wants to merge 1 commit into
bors/mec-568-log-field-injection-defense-v3from
agent/mec-1673-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.

Test plan

  • uv run --with pytest --with pyyaml --with clickhouse_connect pytest tests/ -q -m "not integration" → 107 passed
  • uvx ruff@0.12.4 check services/evals → all checks passed
  • uvx ruff@0.12.4 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 deleted the branch bors/mec-568-log-field-injection-defense-v3 October 4, 2026 05:37
@fastrevmd-lab
fastrevmd-lab deleted the agent/mec-1673-injection-correctness-predicate branch October 6, 2026 13:36
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