Skip to content

[Bug]: Legacy policies + globalPolicies mix: silent drop instead of 400 #2467

Description

@npamudika

Please select the area the issue is related to

Area/Policies (Policies, Policy Hub, Policy Engine etc)

Please select the aspect the issue is related to

Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)

Description

This one is explicitly stated in the doc at line 76:

"A configuration that mixes a non-empty legacy policies list with the new lists is rejected."

The server returns 200 OK and silently drops the legacy policies field instead of returning a 400.

Steps to Reproduce

Create a LLM provider with a mix of legacy policies + globalPolicies as below.

curl -sk -X PUT https://localhost:9243/api/am/admin/v1/llm-providers/new-llm-provider \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <token>' \
  -d '{
    "name": "new-llm-provider",
    "apiType": "openai",
    "endpoint": "https://api.openai.com/v1",
    "globalPolicies": [
      {
        "name": "basic-ratelimit",
        "version": "v1"
      }
    ],
    "policies": [
      {
        "name": "log-message",
        "version": "v1"
      }
    ]
  }'

Severity Level of the Issue

Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)

Environment Details (with versions)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area/PoliciesIssues related to any policy, policy hub, policy engine etcAspect/APIAPI definitions, contracts, OpenAPI, interfacesSeverity/MajorType/Bug

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions