agent-governance

Implements policy enforcement, trust scoring, and audit trails for AI agent tool usage.

Updated Jun 14, 2026
One-click install
npx skills add https://github.com/ironkid90-s/lucky5-v7 --skill agent-governance-ironkid90-s
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-governance
Source: https://github.com/ironkid90-s/lucky5-v7/tree/main/.github/skills/agent-governance
Command: npx skills add https://github.com/ironkid90-s/lucky5-v7 --skill agent-governance-ironkid90-s

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyyaml.

What problem does it solve? AI agents that call external tools can execute dangerous commands, leak sensitive data, or exceed intended boundaries without oversight. This Skill provides reusable patterns for enforcing policies, detecting malicious intent, tracking trust, and auditing every agent action. ## Core Features & Use Cases - Governance Policies: Define composable allowlists, blocklists, content filters, and rate limits as YAML configuration with most-restrictive-wins composition. - Intent Classification & Tool Decorators: Detect prompt injection, data exfiltration, and privilege escalation before execution, and wrap any tool function with a @govern decorator. - Trust Scoring & Audit Trails: Track agent reliability with decaying trust scores and maintain append-only audit logs exportable as JSONL. - Use Case: A support agent built with PydanticAI needs to search documents and create tickets but must never access shell commands or process credit card numbers — apply the governance decorator and content filters to enforce this automatically. ## Quick Start Add governance controls to my PydanticAI agent so it can only call approved tools, blocks sensitive patterns, and logs every action to an audit trail.

Frequently Asked Questions about agent-governance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restrict which tools an AI agent can call?

Define a GovernancePolicy with allowed_tools and blocked_tools lists, then wrap each tool function with the @govern decorator. The decorator checks the policy before execution and raises PermissionError for denied tools.

How to detect prompt injection in agent user input?

Use pattern-based intent classification with weighted threat signals matching phrases like "ignore previous instructions" or "you are now a". Run classification before tool execution as a pre-flight check, blocking content above a confidence threshold.

Does agent governance work with CrewAI and OpenAI Agents SDK?

Yes, the governance decorator is framework-agnostic and works with PydanticAI, CrewAI, OpenAI Agents SDK, LangChain, and AutoGen. For CrewAI, wrap each agent's tool functions; for OpenAI Agents, stack @govern under @function_tool.

How do I combine multiple governance policies for one agent?

Use the compose_policies function which merges policies with most-restrictive-wins semantics. Blocklists and approval lists are unioned, rate limits take the minimum, and allowlists are intersected across org, team, and agent policies.

What are the limitations of pattern-based intent classification?

Regex-based signals can produce false positives on benign text and miss obfuscated attacks using synonyms or encoding. It works best as a first-line pre-flight filter combined with tool allowlists and human approval for sensitive operations.