Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

promptfoo / redteam #1114

Merged
merged 24 commits into from
Feb 10, 2025
Merged

promptfoo / redteam #1114

merged 24 commits into from
Feb 10, 2025

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan commented Feb 10, 2025


Changes Overview for Pull Request

  1. Red Teaming Features Enhanced:
    Introduced new constants REDTEAM: "contracts" in an OptionsOrString enum, enabling red team strategies like "harmful" content detection.

  2. Message Generation Functionality Expanded:
    Added a variable renamed from messageBody to include red team attack vector handling, facilitating customizable message templates for cybersecurity scenarios.

  3. User-Facing API Documentation Updated:
    Included JSDOC-style comments in the test file to outline API endpoints and their functionalities, ensuring developers understand the user-facing API changes thoroughly.

These updates enhance the component's security capabilities while improving documentation quality, benefiting both internal development practices and external API consumers.

AI-generated content by pr-describe may be incorrect

Copy link

The changes look good! Here's a breakdown of the analysis:

  1. Type Safety: Both files (test.ts and prompt_template.d.ts) have been updated to include proper type safety around the redteam configuration structure.

  2. New Structure Definition: The PromptScript.redteam interface is consistently defined in both files, ensuring type consistency across the codebase.

  3. Redundant Imports Removal: In the test file, imports for redteam were properly handled through the function parameters and configuration structures.

  4. No Functional Regressions:

  • No new logic was added that would affect existing behavior.
  • The changes don't introduce any breaking or conflicting functionality with prior implementations.
  1. Comprehensive Type Checking: Both files now undergo proper type checking:
    • test.ts imports the redteam-related types.
    • prompt_template.d.ts declares a precise interface structure, improving code safety and reliability.

Minor Concern: The presence of duplicate "jailbreak" strategy option in both redteam.strategies options is slightly redundant but not harmful since it probably refers to the same value (no need for duplicates though).

The changes:

  • Were minimal: Added proper typing without breaking existing functionality
  • Improved code quality by adding type safety
  • Maintained consistency with the new interface throughout the codebase

LGTM 🚀

AI-generated content by pr-review may be incorrect

@pelikhan
Copy link
Member Author

add JS source to purpose

Enhanced CLI commands, added test max concurrency constant.
Added rendering for 'purpose' in prompts, refined MarkdownTrace, updated redteam strategies and numTests, and expanded PromptScript types.
Updated CLI to support "eval" as alias for the "test" command.
- Removed unnecessary redteam plugins and strategies from the script.
@@ -85,7 +85,7 @@ Options:
## `test`

```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command usage should be consistent. Consider using a single pipe symbol (|) to separate the commands for clarity.

AI-generated content by pr-docs-review-commit command_usage may be incorrect

@@ -109,6 +109,7 @@ Arguments:
are tested

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Options should be grouped logically and consistently ordered. Consider moving --redteam options closer to their respective commands.

AI-generated content by pr-docs-review-commit option_order may be incorrect

@@ -147,6 +148,7 @@ Usage: genaiscript test list [options]
List available tests in workspace

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Options should be grouped logically and consistently ordered. Consider moving --redteam options closer to their respective commands.

AI-generated content by pr-docs-review-commit option_order may be incorrect

Added ci-info library and prompts for CI-specific decisions. Enhanced logging.
@pelikhan pelikhan merged commit f316334 into main Feb 10, 2025
15 checks passed
@pelikhan pelikhan deleted the redteam branch February 10, 2025 19:24
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