agent-governance

Patterns and techniques for adding governance, safety, and trust controls to AI agent systems. Use this skill when: - Building AI agents that call external tools (APIs, databases, file systems) - Implementing policy-based access controls for agent tool usage - Adding semantic intent classification t

By github · 9,597 installs

npx skills add github/awesome-copilot --skill agent-governance

Source repository · Upstream listing

Agent Governance Patterns Patterns for adding safety, trust, and policy enforcement to AI agent systems. Overview Governance patterns ensure AI agents operate within defined boundaries — controlling which tools they can call, what content they can process, how much they can do, and maintaining accountability through audit trails. When to Use Agents with tool access : Any agent that calls external tools (APIs, databases, shell commands) Multi agent systems : Agents delegating to other agents need trust boundaries Production deployments : Compliance, audit, and safety requirements Sensitive operations : Financial transactions, data access, infrastructure management Pattern 1: Governance Policy Define what an agent is allowed to do as a composable, serializable policy object. Policy Composition Combine multiple policies (e.g., org wide + team + agent specific): Policy as YAML Store policies as configuration, not code: Pattern 2: Semantic Intent Classification Detect dangerous intent in prompts before they reach the agent, using pattern based signals. Key insight : Intent classification happens before tool execution, acting as a pre flight safety check. This is fundamentally different from output guardrails which only check after generation. Pattern 3: Tool Level Governance Decorator Wrap individual tool functions with governance checks: Pattern 4: Trust Scoring Track agent reliability over time with decay based trust scores: Multi agent trust : In systems where agents delegate to other agents, each agent maintains trust scores for its delegates: Pattern 5: Audit Trail Append only audit log for all agent actions — critical for compliance and debugging: Pattern 6: Framework Integration PydanticAI CrewAI OpenAI Agents SDK Governance Levels Match governance strictness to risk level: Level Controls Use Case Open Audit only, no restrictions Internal dev/testing Standard Tool allowlist + content filters General production agents Strict All controls + human approval for sensitive ops Financial, healthcare, legal Locked Allowlist only, no dynamic tools, full audit Compliance critical systems Best Practices Practice Rationale Policy as configuration Store policies in YAML/JSON, not hardcoded — enables change without deploys Most restrictive wins When composing policies, deny always overrides allow Pre flight intent check Classify intent before tool execution, not after Trust decay Trust scores should decay over time — require ongoing good behavior Append only audit Never modify or delete audit entries — immutability enables compliance Fail closed If governance check errors, deny the action rather than allowing it Separate policy from logic Governance enforcement should be independent of agent business logic Quick Start Checklist Related Resources [Agent Governance Toolkit](https://github.com/microsoft/agent governance toolkit) — Full governance framework [AgentMesh Integrations](https://github.com/microsoft/agent governance toolkit/tree/main/packages/agentmesh integrations) — Framework specific packages [OWASP Top 10 for LLM Applications](https://owasp.org/www project top 10 for large language model applications/)