Workflow
- Create a threat model and classify input, output, tool, MCP, data exfiltration, and privilege escalation risks.
- Verify the LiteLLM version, guardrail provider, mode, authorization, and failure semantics.
- Choose
pre_call、post_call、pre_mcp_calland other correct execution points. - Set protections that must be enforced to default-on; tool permissions adopt default-deny and a minimal allowlist.
- Restrict both tool names and parameters, avoiding allowing only the name while leaving high-risk arguments unchecked.
- Clearly define the fail-open or fail-closed behavior for provider errors and guardrail errors.
- Test allow, deny, mask, rewrite, provider error, and guardrail error.
When tool permission config, PII config, and test specifications are needed, read Experiments and References。
Security Baseline
- High-risk security controls adopt fail-closed unless the threat model clearly proves that degradation is acceptable.
- Do not use guardrails to replace keys, teams, model access, sandboxing, or audit logs.
- Allow rules must not use unrestricted
.*。 - Custom hooks must not log secrets, full sensitive prompts, or unmasked personal data.
Acceptance
- The threat model and each rule are traceable.
- Unmatched tools are denied by default.
- Parameter restrictions have valid and violating fixtures.
- Guardrail failure behavior is reproducible, and high-risk paths are not silently allowed.