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

[Feature]: Auto-Mode for Guardrails #8485

Closed
hxtomer opened this issue Feb 12, 2025 · 4 comments
Closed

[Feature]: Auto-Mode for Guardrails #8485

hxtomer opened this issue Feb 12, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@hxtomer
Copy link
Contributor

hxtomer commented Feb 12, 2025

The Feature

It would be great if users can set the "mode" of a certain guardrail to "auto" instead of defining it multiple time for each mode.
Taking this configuration as an example:

guardrails:
  - guardrail_name: aim-pre
    litellm_params:
      guardrail: aim
      mode: pre_call
      api_key: os.environ/AIM_API_KEY
  - guardrail_name: aim-during
    litellm_params:
      guardrail: aim
      mode: during_call
      api_key: os.environ/AIM_API_KEY
  - guardrail_name: aim-post
    litellm_params:
      guardrail: aim
      mode: post_call
      api_key: os.environ/AIM_API_KEY

Would be replaced with

  - guardrail_name: aim
    litellm_params:
      guardrail: aim
      mode: auto
      api_key: os.environ/AIM_API_KEY

Motivation, pitch

Aim Security's guardrails can be configured in the Aim Admin Dashboard, allowing security teams to quickly adjust guardrails based on changing company policies and new guardrails abilities. When integrated to LiteLLM, users need to hardly define the guardrail mode at their first use and future policy changes will require LiteLLM configuration adjustment. An "auto" model will allow MLOps teams to pass the responsibility for choosing a phase to run in, to the guardrail itself to happen dynamically.

Are you a ML Ops Team?

No

Twitter / LinkedIn details

https://www.linkedin.com/company/aimsecurity

@hxtomer hxtomer added the enhancement New feature or request label Feb 12, 2025
@krrishdholakia
Copy link
Contributor

Hi @hxtomer

we support mode as a List[str]

this should already solve the multiple guardrail creation problem -

guardrails:
  - guardrail_name: aim-pre
    litellm_params:
      guardrail: aim
      mode: ["pre_call", "during_call", "post_call"] 
      api_key: os.environ/AIM_API_KEY

Does that solve your problem? @hxtomer

@hxtomer
Copy link
Contributor Author

hxtomer commented Feb 13, 2025

@krrishdholakia thanks! I haven't knew that's an option :) we'll give it a try 🙂

@krrishdholakia
Copy link
Contributor

Hey @hxtomer where in docs would you have expected to see this?

@hxtomer
Copy link
Contributor Author

hxtomer commented Feb 13, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants