npx skills add ...
npx skills add github/awesome-copilot --skill 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 to detect dangerous prompts - Creating trust scoring systems for multi-agent workflows - Building audit trails for agent actions and decisions - Enforcing rate limits, content filters, or tool restrictions on agents - Working with any agent framework (PydanticAI, CrewAI, OpenAI Agents, LangChain, AutoGen)
npx skills add github/awesome-copilot --skill agent-governance
Patterns for adding safety, trust, and policy enforcement to AI agent systems.
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.
Define what an agent is allowed to do as a composable, serializable policy object.
Combine multiple policies (e.g., org-wide + team + agent-specific):
Store policies as configuration, not code:
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.
Wrap individual tool functions with governance checks:
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:
Append-only audit log for all agent actions — critical for compliance and debugging:
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 |
| 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 |