Skip to content

fix(ui): expose Generic Guardrail API connection fields - #48317

Open
tanishqbaweja wants to merge 1 commit into
BerriAI:mainfrom
tanishqbaweja:litellm_fix_34927_guardrail_connection_fields
Open

tanishqbaweja wants to merge 1 commit into
BerriAI:mainfrom
tanishqbaweja:litellm_fix_34927_guardrail_connection_fields

Conversation

@tanishqbaweja

@tanishqbaweja tanishqbaweja commented Oct 25, 2026 •

Copy link
Copy Markdown

The Generic Guardrail API form has no URL or API-key inputs because both fields are missing from its provider schema. Expose them so admins can create and edit a working connection through the dashboard. Keep the existing optional-parameter step and URL environment fallback

Details

TLDR

Problem this solves:

  • The dashboard cannot configure a Generic Guardrail API connection

How it solves it:

  • Expose optional URL and API-key fields in the provider schema
  • Cover both fields through the real provider-parameters endpoint

Intentional product change: The create and edit forms gain connection inputs. URL environment fallback and optional authentication remain available

User Flow

Before, an admin cannot enter the connection details

  1. Open http://127.0.0.1:41475/ui/guardrails/ after signing in
  2. Choose Add New Guardrail, Add Provider Guardrail, and Generic Guardrail API
  3. Scroll through Basic Info and find no URL or API-key inputs
  4. Click Next to see optional settings, with connection details still unavailable

Before, the create form has no connection inputs

After, the same form can save and test the connection

  1. Open http://127.0.0.1:41475/ui/guardrails/ after signing in
  2. Choose Add New Guardrail, Add Provider Guardrail, and Generic Guardrail API
  3. Enter the URL and key in the new api_base and masked api_key inputs
  4. Click Next, keep the optional settings, and Create Guardrail
  5. Use Test Playground, or reopen Settings and Edit Settings to change the connection

After, the URL and masked key inputs render

Relevant issues

Fixes #34927

Earlier unmerged PRs #34937 and #35212 investigated the same issue. On current main, optional parameters already render in the following step, so this change only adds the missing connection fields

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally
  • My PR passes all required CI/CD checks
  • My PR's scope is as isolated as possible and solves one problem
  • Every automated review on the latest commit has finished and its findings are addressed

The two new regressions fail on unchanged main with missing api_base and api_key. Both affected backend files pass after the fix, 251 tests. Six affected frontend files pass, 93 tests covering create, edit, provider fields and helpers

make lint BASE_REF=origin/main LINT_JOBS=2 passes, including formatting, lint, type-budget, test-quality, OpenAPI documentation, import-safety and E2E type gates. Changed-file formatting and git diff --check also pass. The repository type-budget gate accepts existing diagnostics within its ceilings

The OSV scan flags the same three advisories as unchanged main, two for filelock 3.32.7 and one for the development dependency @azure/msal-node 6.0.1. This PR changes no dependencies or lockfiles. The separate proposal #48302 tracks that scan failure

The latest commit passes all four required CI gates, including unit tests, lint, smoke tests and cost-map validation

The initial unit run failed the existing test_token_counter_loads_a_custom_tokenizer_off_the_event_loop timing assertion, with 4328 other tests passing in that shard. The same test fails locally on unchanged main and this PR. Its test, helper and proxy implementation are unchanged. One empty commit retried CI successfully without changing the tree, and the browser evidence below was refreshed for it

Codecov on the initial product commit confirms all modified and coverable lines are covered. The latest commit has the same tree and its coverage job also passes. Automated code reviews have not been posted, so that checklist item remains unverified

Screenshots / Proof of Fix

The real proxy and PostgreSQL served the production dashboard at the URL above. Both revisions used the same unchanged dashboard export from the before commit. Chromium ran at 1440x900 and 390x844 with touch on the latter

The included local HTTP guardrail checks x-api-key and returns allowed or blocked results. This configuration flow makes actual HTTP calls to that fixture and does not require LLM inference. The evidence and reproduction steps include the fixture, driver, raw screenshots and reports

Before (dddbaa8)

Desktop

  1. Follow User Flow at 1440x900 and select Generic Guardrail API
  2. Observe both connection inputs absent, as shown above
  3. Click Next and confirm optional settings already render in their separate step

Desktop recording

Phone

  1. Follow the same flow at 390x844 with touch
  2. Observe the same missing inputs in the phone screenshot
  3. Click Next and confirm optional settings render

Phone recording

After (81a5dc0)

Desktop

  1. Repeat the same flow at 1440x900 and fill the connection inputs shown above
  2. Create the guardrail and test allowed and blocked text in Test Playground
  3. Edit the URL and key, save, and repeat both requests successfully
  4. Verify four authenticated service calls, including two to the updated URL

Desktop recording

Phone

  1. Repeat the same flow at 390x844 with touch and fill the visible connection inputs
  2. Create the guardrail and test allowed and blocked text in Test Playground
  3. Edit the URL and key, save, and repeat both requests successfully
  4. Verify four authenticated service calls, including two to the updated URL

Phone recording

Type

Bug Fix

Caveats

Low

  • The HTTP guardrail is a local fixture, not a vendor
  • Existing phone overflow remains in the separate optional-parameters step
  • Existing static-prefetch/runtime-config 404s occur on both revisions
  • Blocked Playground checks intentionally return 400 and log their reason
  • OSV reports the same dependency advisories as unchanged main
  • Initial CI hit a tokenizer timing failure reproduced on main

@codspeed

codspeed Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 35 untouched benchmarks


Comparing tanishqbaweja:litellm_fix_34927_guardrail_connection_fields (81a5dc0) with main (72f1ac4)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (dddbaa8) during the generation of this report, so 72f1ac4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tanishqbaweja
tanishqbaweja marked this pull request as ready for review October 25, 2026 15:16
@tanishqbaweja
tanishqbaweja force-pushed the litellm_fix_34927_guardrail_connection_fields branch from 81a5dc0 to f384983 Compare November 1, 2026 00:57
@tanishqbaweja
tanishqbaweja force-pushed the litellm_fix_34927_guardrail_connection_fields branch from f384983 to 7d1a275 Compare November 1, 2026 03:06
@CLAassistant

CLAassistant commented Nov 3, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
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.

[Bug]: Generic Guardrail API UI: configuration fields (api_base, api_key, optional_params) not rendered when selecting provider

2 participants