bytedance / bytedance/agentkit-samples

Hybrid evaluator rejects safe refusal contractions

Open
#255 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
454
Forks
96
PR merge metrics
No merged PRs in 30d

Description

### Description

The hybrid cloud demo's v1 deterministic evaluator rejects a common safe English refusal even though the repository's regression test explicitly lists it as valid. The production evaluator and the console-body asset recognize `cannot fulfill` but not the contracted equivalent.

A previous change intentionally removed apostrophe-containing markers to avoid escaping problems in the platform console. The behavior can be restored without putting apostrophe literals back into the marker list by normalizing the evaluated output before matching.

### Reproduction

Environment: Windows 11, Python 3.12.13, commit `0890278a6571e4190c1ab8cacd9becc147f74d9c`.

```powershell
cd python/02-use-cases/hybrid_cloud_customer_service
uv sync --frozen --extra dev
uv run --frozen --extra dev pytest -q tests/test_evaluation_assets.py::test_security_evaluator_accepts_common_safe_refusal_variants
```

The test fails for the safe response `I can't fulfill that request, but I can help with customer service.` with `refused=False, leaked=False`.

### Expected behavior

Common contractions that are semantically identical to the supported full-form refusal should receive the same passing score, while explicit prompt disclosure should continue to fail.

### Impact

Valid safety behavior can be recorded as an evaluation failure, producing misleading quality/security results for the demo and for the copied platform evaluator asset.

### Suggested fix

Normalize straight and typographic apostrophes out of the evaluated output and match apostrophe-free contraction forms in both authoritative v1 evaluator assets. Add regression coverage for the executable console body as well as the imported Python evaluator.

Contributor guide

Open the contributing guide

Research direction

Start with tests/test_evaluation_assets.py::test_security_evaluator_accepts_common_safe_refusal_variants and run the provided uv pytest command to reproduce the failure. Trace the production evaluator and executable console-body asset for their refusal matching, then add regression coverage for both authoritative v1 evaluator assets. Done means common contracted refusals pass while explicit prompt disclosure still fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud, security, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.