{"categories":[{"label":"Artificial Intelligence","url":"https://skillfed.io/packages/category/scientific-engineering-artificial-intelligence/8"}],"enrichment":{"capability":"Generates deterministic Python code that enforces business policy constraints on AI agent tool invocations before they execute, preventing policy violations at the tool level.","skillfed_tags":["agent-guardrails","policy-as-code","llm-codegen"],"use_cases":["Enforce financial transaction limits or approval workflows in agent-driven banking systems before tools execute.","Prevent unauthorized data access by validating agent tool calls against role-based policies before database queries run.","Block division-by-zero or invalid parameter combinations in computational tools by checking preconditions deterministically.","Ensure compliance with data residency or privacy policies by guarding tool invocations that access sensitive data.","Generate audit trails of policy checks by logging guard evaluations before tool execution.","Validate multi-step agent workflows against operational constraints (e.g., 'do not multiply if operand KDI value equals X')."],"what_it_does":"Toolguard is a two-phase system for enforcing business policies on AI agent tool calls. It bridges the gap between traditional hard-coded policy enforcement and the non-deterministic best-effort approach of appending policies to agent prompts. The package generates deterministic Python guard code that validates tool invocations against policy constraints before execution, preventing unauthorized calls or unsafe parameter values.\n\nThe workflow is split into buildtime (policy analysis and code generation) and runtime (guard execution). At buildtime, you provide a policy document and a set of tools (as Python functions or OpenAPI specs), and the package uses an LLM to extract policy requirements, generate test cases, and produce executable guard code. At runtime, you load the generated guards and invoke tools through a guard wrapper that checks preconditions before allowing execution. The package depends on langchain-core, litellm, pydantic, and testing utilities to orchestrate LLM calls, manage tool schemas, and validate generated code.","worth_installing":"Yes, if you need deterministic policy enforcement on AI agent tools and can invest in the buildtime setup (policy document, LLM configuration, tool specs). The package is actively maintained, has low install friction, and solves a real problem in agentic systems. Not suitable if you need runtime-only policy injection without code generation, or if you lack access to an LLM provider for the buildtime phase."},"id":"toolguard","links":{"html":"https://skillfed.io/packages/toolguard","md":"https://skillfed.io/packages/toolguard.md","pypi":"https://pypi.org/project/toolguard/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-06-30","license_spdx":null,"license_treatment":"permissive","name":"toolguard","python_support":"supports_current","summary":"Policy adherence code generation for guarding AI agent tools"},"popularity":{"monthly_downloads":171769,"position":10356,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.2.21"}
