API Reference¶
Complete API documentation for pydantic-ai-shields.
Infrastructure Shields¶
CostTracking— Token/USD tracking with budget enforcementToolGuard— Block tools or require approvalInputGuard— Custom input validationOutputGuard— Custom output validationAsyncGuardrail— Concurrent guardrail + LLM execution
Content Shields¶
PromptInjection— Prompt injection / jailbreak detectionPiiDetector— PII detectionSecretRedaction— Secret/credential detection in outputBlockedKeywords— Keyword blockingNoRefusals— Refusal detection
Exceptions¶
GuardrailError— Base exceptionInputBlocked— Input validation failedOutputBlocked— Output validation failedToolBlocked— Tool access deniedBudgetExceededError— Cost budget exceeded