Repository navigation
fix(mutate): add dedicated semantic_rephrase and indirect_request templates - #144
Open
BasilZafar11 wants to merge 1 commit into
Open
BasilZafar11 wants to merge 1 commit into
BasilZafar11 wants to merge 1 commit into
Conversation
|
@BasilZafar11 is attempting to deploy a commit to the priyanshu's projects Team on Vercel. A member of the Team first needs to authorize it. |
4 tasks
This branch has not been deployed
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.
Summary
Fixes #24
Replace the template aliases for
semantic_rephraseandindirect_requestwith dedicated, seedable transforms. Semantic rephrasing varies the request framing, preserving the ask and adding the AttackFocus tool name when needed. Indirect requests ask to draft/prepare a tool call or its arguments, preserving the original request without adding approval codes or authority claims.Both implementations are registered in
TEMPLATE_OPERATORS. The engine records the dedicated operator inmetadata.template_operator, while retaining logical strategy, mutation history, parent/generation links, and target rule IDs. The same dedicated transforms are used after an LLM failure. LLM prompts, Hosted, fitness, and policy evaluation are unchanged.Tests cover both engine and direct-template paths, refund and email requests, quoted argument literals, parent isolation, deterministic sequences with wording variation, empty parents, message limits, lineage, and failed-LLM fallback.
Type of change
Checklist
Test plan
uv run --locked pytest tests/unit/test_mutate.py tests/unit/test_llm_mutator.py tests/unit/test_policy_general_seeds.py -q --tb=short: 68 passed.MUTINY_SAMPLE_OFFLINE=1 uv run --locked pytest -q --tb=short: 780 passed, including unit, integration, reliability, and packaging checks.uv run --locked ruff check: passed.git diff --check: passed.CLI shell smoke, production web build, and container execution are left to their existing CI jobs. The branch starts at latest upstream main
99ed9ad, matching fork main at the final fetch.