The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Merge pull request #14519 from uc4w6c/feat/add_tools_permission_guardrail
Krish Dholakia11822e63f16b
diff --cc litellm/types/guardrails.pyindex c35b0ff55a0,03cfa42a33d..d257e316d7c--- a/litellm/types/guardrails.py+++ b/litellm/types/guardrails.py@@@ -41,8 -37,9 +37,10 @@@ class SupportedGuardrailIntegrations(EnMODEL_ARMOR = "model_armor"OPENAI_MODERATION = "openai_moderation"NOMA = "noma"+ TOOL_PERMISSION = "tool_permission"++class Role(Enum):SYSTEM = "system"ASSISTANT = "assistant"@@@ -375,12 -372,20 +373,24 @@@ class NomaGuardrailConfigModel(BaseModedefault=None,description="If True, blocks requests on API failures. Defaults to True if not provided",)+ anonymize_input: Optional[bool] = Field(+ default=None,+ description="If True, replaces sensitive content with anonymized version when only PII/PCI/secrets are detected. Only applies in blocking mode. Defaults to False if not provided",+ )+ class ToolPermissionGuardrailConfigModel(BaseModel):+ """Configuration parameters for the Tool Permission guardrail"""++ rules: Optional[List[Dict]] = Field(+ default=None, description="List of permission rules for tool usage"+ )+ default_action: Optional[str] = Field(+ default="Deny",+ description="Default action when no rule matches (Allow or Deny)",+ )++class BaseLitellmParams(BaseModel): # works for new and patch update guardrailsapi_key: Optional[str] = Field(default=None, description="API key for the guardrail service"