BerriAI/litellm · error · ValueError

PANW Prisma AIRS: profile_name is required

Error message

PANW Prisma AIRS: profile_name is required

What it means

Companion check in initialize_panw_prisma_airs: besides api_key, the Prisma AIRS scan profile name is mandatory because every scan request must reference a security profile configured in the Palo Alto Networks console. A missing or empty profile_name fails guardrail init with ValueError.

Source

Thrown at litellm/proxy/guardrails/guardrail_initializers.py:207

        conversation_id=litellm_params.lasso_conversation_id,
        mask=litellm_params.mask,
        event_hook=litellm_params.mode,
        default_on=litellm_params.default_on,
    )
    litellm.logging_callback_manager.add_litellm_callback(_lasso_callback)

    return _lasso_callback


def initialize_panw_prisma_airs(litellm_params, guardrail):
    from litellm.proxy.guardrails.guardrail_hooks.panw_prisma_airs import (
        PanwPrismaAirsHandler,
    )

    if not litellm_params.api_key:
        raise ValueError("PANW Prisma AIRS: api_key is required")
    if not litellm_params.profile_name:
        raise ValueError("PANW Prisma AIRS: profile_name is required")

    _panw_callback: Final = PanwPrismaAirsHandler(
        guardrail_name=guardrail.get("guardrail_name", "panw_prisma_airs"),  # Use .get() with default
        api_key=litellm_params.api_key,
        api_base=litellm_params.api_base or "https://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request",
        profile_name=litellm_params.profile_name,
        default_on=litellm_params.default_on,
        mask_on_block=getattr(litellm_params, "mask_on_block", False),
        mask_request_content=getattr(litellm_params, "mask_request_content", False),
        mask_response_content=getattr(litellm_params, "mask_response_content", False),
        app_name=getattr(litellm_params, "app_name", None),
        fallback_on_error=getattr(litellm_params, "fallback_on_error", "block"),
        # `timeout` is now declared on BaseLitellmParams (Optional[float] = None),
        # so the attribute always exists. The Pydantic validator on LitellmParams
        # coerces strings to float, but None still means "use handler default" —
        # guard against float(None) here.
        timeout=(
            float(getattr(litellm_params, "timeout", None))

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Add profile_name under litellm_params with the exact profile name from your Prisma AIRS console
  2. Check YAML quoting - names with spaces or special characters need quotes
  3. Confirm the value is non-empty at startup (log the resolved litellm_params in debug mode)

Example fix

# before
litellm_params:
  guardrail: panw_prisma_airs
  api_key: os.environ/PANW_API_KEY

# after
litellm_params:
  guardrail: panw_prisma_airs
  api_key: os.environ/PANW_API_KEY
  profile_name: os.environ/PANW_PROFILE_NAME
Defensive patterns

Strategy: validation

Validate before calling

# Confirm the scan profile exists and a key is present before proxy start
import os

if not os.getenv('PANW_PRISMA_AIRS_PROFILE_NAME'):
    raise SystemExit('PANW_PRISMA_AIRS_PROFILE_NAME not set - profile_name is required')
if not os.getenv('PANW_PRISMA_AIRS_API_KEY'):
    raise SystemExit('PANW_PRISMA_AIRS_API_KEY not set - api_key is required')

Type guard

def has_panw_profile(litellm_params: dict) -> bool:
    """True when profile_name is a non-empty string."""
    name = litellm_params.get('profile_name')
    return isinstance(name, str) and len(name.strip()) > 0

Prevention

When it happens

Trigger: A panw_prisma_airs guardrail entry with api_key set but no profile_name under litellm_params, or a profile_name env reference that resolves to empty.

Common situations: Profile created in the Prisma AIRS console but its exact name not copied into config; quoting/whitespace mistakes in YAML; forgetting this key when migrating a guardrail from another deployment.

Understand the failure class

Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.

Related errors


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/5b25c88bbed6f92c. Report an issue: GitHub.