Skip to content

Conversation

@steven10a
Copy link
Collaborator

  • Pass conversation history to guardrails that need them when using Agents
  • Further optimized JB system prompt
  • Updated tests

Copilot AI review requested due to automatic review settings November 19, 2025 21:42
Copilot finished reviewing on behalf of steven10a November 19, 2025 21:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances guardrail functionality by passing conversation history to guardrails that require it when using Agents, optimizes the jailbreak detection system prompt with clearer banned content categories, and updates corresponding tests.

  • Adds dual access pattern for conversation history (both property and method) for improved compatibility
  • Optimizes performance by conditionally loading conversation history only when needed
  • Expands jailbreak system prompt with explicit banned content categories

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/types.ts Adds conversationHistory property to GuardrailLLMContextWithHistory interface for direct access alongside existing method accessor
src/evals/core/async-engine.ts Introduces extractTextFromContent helper, removes prompt injection-specific logic, and adds conversation history extraction for non-conversation-aware guardrails
src/checks/jailbreak.ts Adds comprehensive "BANNED CONTENT CATEGORIES" section to system prompt for clearer detection guidance
src/base-client.ts Updates createContextWithConversation to expose conversation history via both property and method
src/agents.ts Refactors context creation and adds optimization to conditionally load conversation history
src/tests/unit/evals/async-engine.test.ts Adds test coverage for multi-part content extraction in non-conversation-aware guardrails
src/tests/unit/base-client.test.ts Adds test verifying dual access pattern for conversation history
src/tests/unit/agents.test.ts Updates test to mark guardrail as conversation-aware to trigger proper context creation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@steven10a
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@gabor-openai gabor-openai merged commit 23da9ea into main Nov 21, 2025
1 check passed
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.

3 participants