{"data":{"slug":"vstorm-co-pydantic-ai-shields","name":"pydantic-ai-shields","tagline":"Guardrail capabilities for Pydantic AI","github_url":"https://github.com/vstorm-co/pydantic-ai-shields","owner":"vstorm-co","repo":"pydantic-ai-shields","owner_avatar_url":"https://avatars.githubusercontent.com/u/80465946?v=4","primary_language":"Python","stars":95,"forks":11,"topics":["ai-agents","ai-guardrails","ai-safety","anthropic","async","content-moderation","guardrails","input-validation","llm","middlewares","openai","pii-redaction","pydantic","pydantic-ai","python","rate-limiting","type-safe","vstorm"],"archived":false,"github_pushed_at":"2026-10-21T22:44:21+00:00","maintenance_label":"Very active","stars_delta_30d":2,"url":"https://www.graphcanon.com/tools/vstorm-co-pydantic-ai-shields","markdown_url":"https://www.graphcanon.com/tools/vstorm-co-pydantic-ai-shields.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/vstorm-co-pydantic-ai-shields","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=vstorm-co-pydantic-ai-shields","description":"Guardrail capabilities for Pydantic AI — cost tracking, prompt injection detection, PII filtering, secret redaction, tool permissions, and async guardrails. Built on pydantic-ai's native capabilities API.","homepage_url":"https://vstorm-co.github.io/pydantic-ai-shields/","license":"MIT","open_issues":3,"watchers":3,"ai_summary":"Provides cost tracking, prompt injection detection, PII filtering, secret redaction, tool permissions, and async guardrails built on pydantic-ai's native capabilities API.","readme_excerpt":"## Installation\n\n```bash\npip install pydantic-ai-shields\n```\n\n---\n\n## Quick Start\n\n```python\nfrom pydantic_ai import Agent\nfrom pydantic_ai_shields import CostTracking, ToolGuard, InputGuard\n\nagent = Agent(\n    \"openai:gpt-4.1\",\n    capabilities=[\n        CostTracking(budget_usd=5.0),\n        ToolGuard(blocked=[\"execute\"], require_approval=[\"write_file\"]),\n        InputGuard(guard=lambda prompt: \"ignore all instructions\" not in prompt.lower()),\n    ],\n)\n\nresult = await agent.run(\"Hello!\")\n```\n\n---\n\n### Infrastructure Shields\n\n| Class | Description |\n|-------|-------------|\n| `CostTracking` | Token/USD tracking with budget enforcement |\n| `ToolGuard` | Block tools or require approval |\n| `InputGuard` | Custom input validation (pluggable function) |\n| `OutputGuard` | Custom output validation (pluggable function) |\n| `AsyncGuardrail` | Concurrent guardrail + LLM execution |\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE)\n\n---\n\n<div align=\"center\">","github_created_at":"2025-12-28T16:52:45+00:00","created_at":"2026-07-15T10:44:08.488804+00:00","updated_at":"2026-10-22T06:00:28.73644+00:00","categories":[{"slug":"evaluation-observability","name":"Evaluation & Observability","url":"https://www.graphcanon.com/categories/evaluation-observability","markdown_url":"https://www.graphcanon.com/categories/evaluation-observability.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/evaluation-observability"}],"tags":[{"slug":"ai-agents","name":"ai-agents"},{"slug":"ai-guardrails","name":"ai-guardrails"},{"slug":"ai-safety","name":"ai-safety"},{"slug":"input-validation","name":"input-validation"},{"slug":"pydantic","name":"pydantic"},{"slug":"python","name":"python"},{"slug":"type-safe","name":"type-safe"}],"trust":{"provenance":{"is_fork":false,"github_id":1124252979,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-10-22T06:00:27.329Z","maintenance":{"label":"Very active","score":96,"methodology":"github_public_v1","releases_90d":0,"days_since_push":0,"last_release_at":"2026-06-01T15:44:18Z","stars_delta_30d":2,"open_issues_delta_30d":0},"security_summary":{"last_scan_at":"2026-07-15T10:44:11.143748+00:00","scan_profile":"deps","status":"no_lockfile","critical_count":0,"high_count":0,"medium_count":0,"low_count":0,"scanner":"osv@v1","scan_id":"5461eec8-28fa-43e8-995a-be4cc69c09f1","pending_review_count":0}},"capability_facts":{"mcp":{"method":"github-tree-and-contents@2","reason":"No explicit MCP server declaration was found in the inspected manifests. Other layouts and implementations were not tested.","source":"repo_scan","status":"unknown","revision":"954e039f686c3fdaffa594e42e6026e7afbcc8bb","source_url":"https://github.com/vstorm-co/pydantic-ai-shields/tree/954e039f686c3fdaffa594e42e6026e7afbcc8bb","observed_at":"2026-10-22T06:00:27.696Z","server_manifest":null},"scan":{"method":"github-tree-and-contents@2","source":"repo_scan","status":"complete","version":2,"coverage":{"scope":"bounded-repository-manifests","tree_complete":true,"selected_files":1,"candidate_files":1},"revision":"954e039f686c3fdaffa594e42e6026e7afbcc8bb","source_url":"https://github.com/vstorm-co/pydantic-ai-shields/tree/954e039f686c3fdaffa594e42e6026e7afbcc8bb","observed_at":"2026-10-22T06:00:27.696Z","observations":[{"path":"@revision","bytes":4972,"status":"present","revision":"954e039f686c3fdaffa594e42e6026e7afbcc8bb","source_url":"https://github.com/vstorm-co/pydantic-ai-shields/commit/954e039f686c3fdaffa594e42e6026e7afbcc8bb","http_status":200,"observed_at":"2026-10-22T06:00:28.008Z"},{"path":"@tree","bytes":16590,"status":"present","revision":"954e039f686c3fdaffa594e42e6026e7afbcc8bb","source_url":"https://github.com/vstorm-co/pydantic-ai-shields/tree/954e039f686c3fdaffa594e42e6026e7afbcc8bb","http_status":200,"observed_at":"2026-10-22T06:00:28.188Z"},{"path":"docker-compose.yml","reason":"not-listed-in-complete-tree","status":"not-found","revision":"954e039f686c3fdaffa594e42e6026e7afbcc8bb","source_url":"https://github.com/vstorm-co/pydantic-ai-shields/tree/954e039f686c3fdaffa594e42e6026e7afbcc8bb","observed_at":"2026-10-22T06:00:28.188Z"},{"path":"Dockerfile","reason":"not-listed-in-complete-tree","status":"not-found","revision":"954e039f686c3fdaffa594e42e6026e7afbcc8bb","source_url":"https://github.com/vstorm-co/pydantic-ai-shields/tree/954e039f686c3fdaffa594e42e6026e7afbcc8bb","observed_at":"2026-10-22T06:00:28.188Z"},{"path":"mcp.json","reason":"not-listed-in-complete-tree","status":"not-found","revision":"954e039f686c3fdaffa594e42e6026e7afbcc8bb","source_url":"https://github.com/vstorm-co/pydantic-ai-shields/tree/954e039f686c3fdaffa594e42e6026e7afbcc8bb","observed_at":"2026-10-22T06:00:28.188Z"},{"path":"package.json","reason":"not-listed-in-complete-tree","status":"not-found","revision":"954e039f686c3fdaffa594e42e6026e7afbcc8bb","source_url":"https://github.com/vstorm-co/pydantic-ai-shields/tree/954e039f686c3fdaffa594e42e6026e7afbcc8bb","observed_at":"2026-10-22T06:00:28.188Z"},{"path":"pyproject.toml","bytes":4083,"status":"present","revision":"954e039f686c3fdaffa594e42e6026e7afbcc8bb","source_url":"https://github.com/vstorm-co/pydantic-ai-shields/blob/954e039f686c3fdaffa594e42e6026e7afbcc8bb/pyproject.toml","http_status":200,"observed_at":"2026-10-22T06:00:28.381Z"},{"path":"server.json","reason":"not-listed-in-complete-tree","status":"not-found","revision":"954e039f686c3fdaffa594e42e6026e7afbcc8bb","source_url":"https://github.com/vstorm-co/pydantic-ai-shields/tree/954e039f686c3fdaffa594e42e6026e7afbcc8bb","observed_at":"2026-10-22T06:00:28.188Z"}]},"languages":{"value":["python"],"method":"github-tree-and-contents@2","source":"github.language+pyproject.toml","revision":"954e039f686c3fdaffa594e42e6026e7afbcc8bb","source_url":"https://github.com/vstorm-co/pydantic-ai-shields/tree/954e039f686c3fdaffa594e42e6026e7afbcc8bb","observed_at":"2026-10-22T06:00:27.696Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-10-22T06:00:27.696Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["When you need type-safe integrations with Pydantic and want built-in capabilities via pydantic-ai's native API","For adding specific input validation through pluggable functions to prevent prompt injection in your AI interactions"],"when_not_to_use":["If your project already relies on a different framework that does not integrate well with Pydantic","When you require detailed content moderation functionalities beyond simple PII filtering and secret redaction"],"source":"enrich:decision_facts","observed_at":"2026-07-16T18:56:14.224Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"Unverified catalog guidance: pydantic-ai-shields is specialized to enforce safety guardrails for Pydantic AI tools with features like cost tracking, prompt injection detection, PII filtering, secret redaction, tool permissions, and async guardrails."}]}}