Skip to content

Automated red teaming#5

Draft
hjrnunes wants to merge 268 commits into
mainfrom
automated-red-teaming
Draft

Automated red teaming#5
hjrnunes wants to merge 268 commits into
mainfrom
automated-red-teaming

Conversation

@hjrnunes

@hjrnunes hjrnunes commented Mar 9, 2026

Copy link
Copy Markdown

Draft temporary PR to keep track of changes.

leondz added 30 commits November 3, 2025 15:04
Addresses NVIDIA#1433 

Provide a new service `garak.intentservice` for looking up intents

`intentservice` resolves intent specifiers, which are intent codes (i.e.
"A999aaaaa") or prefixes thereof, and provides tooling for resolving
them into intent stubs - snippets to be used in prompt construction

Three routes are provided for specifying intent stubs:

* Descriptions/names in the intent typology, a mandatory default place
where we can get a string
* Text files in a way that allows supplementation/overriding using XDG
spec
* Classes which implement a method that allows programmatic generation
of intent texts

A test intent is provided, as in some other plugin types, as well as
testing.
hjrnunes and others added 25 commits June 2, 2026 09:21
…tion

Introduces a new MulticlassJudge detector that extends ModelAsJudge with JSON-aware response parsing and user-defined classification categories (e.g. complied/rejected/alternative/other). Supports configurable system and user prompts, custom score keys/fields, confidence thresholds, and optional JSON schema injection for structured output APIs.
Implement RHEL AI midstream versioning pattern (X.Y.Z+rhaiv.N) using
flit-scm to enable automatic version management from git tags while
preserving flit as the build backend.

Changes:
- Migrate build backend from flit_core to flit_scm:buildapi
- Enable dynamic versioning via setuptools_scm (used by flit-scm)
- Add version fallback mechanism in __init__.py (0.0.0+dev)
- Exclude auto-generated _version.py from version control
- Add CHANGELOG.md with versioning documentation
- Add RHEL-AI-VERSIONING-GUIDE.md as implementation reference
- Document versioning pattern in README.md

Technical Details:
- flit-scm bridges flit (build) and setuptools_scm (versioning)
- Version constraint: flit-scm>=1.7.0,<2 (transitively requires flit-core~=3.5)
- All flit configuration preserved ([tool.flit.*] sections maintained)
- Version file: garak/_version.py (auto-generated during build)

Version Pattern:
- Base: Semantic version (e.g., 0.14.1)
- Midstream marker: +rhaiv (Red Hat AI Version)
- Build number: .N (increments for fixes, resets on version bump)
- Example: 0.14.1+rhaiv.1, 0.14.1+rhaiv.2, 0.15.0+rhaiv.1

Backward Compatibility:
- No breaking changes to package functionality
- pip install garak continues to work as before
- Build system change is internal to packaging

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Signed-off-by: Sudip Sinha <sudsinha@redhat.com>
…angservice

- Add prompt_intents tracking to IntentProbe.build_prompts() so each prompt maps back to its source intent (fixes test_cas_intentprobe)
- Fix test_spo_augmentation fixtures to load intent service before constructing SPO probes, use TextStub objects instead of raw strings, and align assertions with actual implementation (augment_system/ augment_user flags instead of nonexistent augmentation_func attribute). Add _mint_attempt tests that exercise the base Probe method with augmentation metadata verification.
- Load intent service in langservice probe_pre_req fixture and skip TAPIntent/PAIR in translation test only when OPENAI_API_KEY is missing
- Sync requirements.txt datasets version (3.x -> 4.x) with pyproject.toml
When TAP's pruning algorithm removes all candidates (or TAP fails to generate any), `adv_prompt_list` is empty.
This causes `TAPIntent` to not log any `Attempt` for an input stub which results in missing stubs from the output report.

see: RHOAIENG-54412
Signed-off-by: blastStu <stuart.battersby@gmail.com>
Signed-off-by: blastStu <stuart.battersby@gmail.com>
 - Fixed: AttributeError in garak/resources/api/huggingface.py (compatibility with updated transformers).
 - Fixed: Missing documentation for spo, multilingual, _augmentation probes and earlystop harness.
 - Cleaned up: Misplaced documentation files in docs/source/
Signed-off-by: ABeltramo <beltramo.ale@gmail.com>
Signed-off-by: ABeltramo <beltramo.ale@gmail.com>
Signed-off-by: ABeltramo <beltramo.ale@gmail.com>
Signed-off-by: ABeltramo <beltramo.ale@gmail.com>
@ABeltramo ABeltramo force-pushed the automated-red-teaming branch from e77682c to 866d1e7 Compare June 2, 2026 08:22
ABeltramo added 4 commits June 5, 2026 10:57
…onses generators

CI was during testing hanging because of this.

Signed-off-by: ABeltramo <beltramo.ale@gmail.com>
…generator

Signed-off-by: ABeltramo <beltramo.ale@gmail.com>
Signed-off-by: ABeltramo <beltramo.ale@gmail.com>
Signed-off-by: ABeltramo <beltramo.ale@gmail.com>
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.