Skip to content

Conversation

aaron-ang
Copy link
Contributor

@aaron-ang aaron-ang commented Sep 5, 2025

Summary

This change ensures that input guardrails receive the original user input rather than the input combined with session history. Input guardrails should validate the user's current message, not the entire conversation context, as they are designed to check if the new input is appropriate rather than validating the full conversation history.

In addition, I created some helper functions that abstract duplicated chunks of code across run and _start_streaming methods.

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format (skipped file changes since they are unrelated to the PR)
  • I've made sure tests pass

@seratch seratch added feature:core enhancement New feature or request labels Sep 5, 2025
@seratch seratch requested review from seratch and rm-openai September 8, 2025 05:21
Copy link
Collaborator

@rm-openai rm-openai left a comment

Choose a reason for hiding this comment

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

Passing the input history was intentional. Some input guardrails only operate on the newest message, and they can just filter the inputs. But others operate in the context of the overall conversation, and this would be a regression for them.

(LMK if there's a use case that's not covered, happy to discuss how we can enable it)

@seratch seratch marked this pull request as draft September 12, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature:core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants