agent-governance

Implement policy enforcement, intent classification, trust scoring, and audit trails for AI agents.

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/miyake-san/sogo-agent-platform --skill agent-governance-miyake-san
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-governance
Source: https://github.com/miyake-san/sogo-agent-platform/tree/main/skills/core/agent-governance
Command: npx skills add https://github.com/miyake-san/sogo-agent-platform --skill agent-governance-miyake-san

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. This Skill provides reusable Python patterns to control which tools agents may call, filter harmful content, detect malicious prompts, and maintain accountability through audit logs. ## Core Features & Use Cases - Governance Policies: Define declarative allowlists, blocklists, content filters, and rate limits as composable Python dataclasses or YAML configuration, with most-restrictive-wins composition semantics. - Intent Classification & Tool Decorators: Detect prompt injection, data exfiltration, and privilege escalation before tool execution, and wrap any tool function with a @govern decorator enforcing policy checks. - Trust Scoring & Audit Trails: Track agent reliability with decay-based trust scores for multi-agent delegation, and record every action in an append-only audit log exportable as JSONL. - Use Case: A support agent built with PydanticAI needs to search documents and create tickets but must never execute shell commands or process content containing credentials — apply the governance policy and decorator to enforce these boundaries. ## Quick Start Add governance controls to my PydanticAI agent so it can only call approved tools, blocks prompts containing secrets, 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 attacks in agent inputs?

Use pattern-based intent classification with weighted threat signals matching phrases like "ignore previous instructions" or "you are now a". The classify_intent function returns signals with confidence scores, letting you block content above a threshold before tool execution.

Does this governance approach work with CrewAI and PydanticAI?

Yes, the patterns are framework-agnostic. For PydanticAI, stack @govern under @agent.tool; for CrewAI, wrap each agent's tool functions before crew.kickoff(). OpenAI Agents SDK works via the @function_tool decorator.

How do I combine multiple agent policies from different teams?

Use the compose_policies function, which merges policies with most-restrictive-wins semantics: blocklists union together, allowlists intersect, and rate limits take the minimum value across all policies.

What are the limitations of regex-based intent classification?

Pattern matching only catches known threat signatures and can produce false positives on benign content or miss obfuscated attacks. It works best as a pre-flight check layered with tool allowlists, rate limits, and human approval for sensitive operations.