Skip to content

Guide · Agent skill

How to use the Agent Governance Patterns agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The Agent Governance Patterns skill (skill name agent-governance) gives an AI agent a set of guidance notes and sample Python code for keeping its own actions within limits. It is written for developers building agents that call APIs, databases or file systems. After this guide you will know how to install the skill, how to ask for it with natural requests, and what it can and cannot do for you.

Agent Governance Patternsgithub/awesome-copilot · MIT

Quick start

  1. 1Download the ZIP. Download the agent-governance ZIP from this page. It contains SKILL.md.
  2. 2Unzip into a skills folder. Place the agent-governance folder in ~/.claude/skills/ for personal use or in .claude/skills/ inside your project.
  3. 3Or upload in the Claude apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the ZIP.
  4. 4Describe your governance task. Ask in plain language, naming your tools and framework, for example a tool allowlist or human approval for send_email.
  5. 5Review the generated code. Check the policy, content filters and approval steps against your own tools and data before running anything.
  6. 6Test the controls. Try blocked tools, over-limit calls and sample malicious prompts to confirm the controls behave as you expect.

What the skill makes the agent do

When the skill is active, the agent can follow its patterns to add governance controls to the agent system you are building. The source covers defining a policy that allows or blocks specific tools, filtering content with patterns, capping the number of tool calls per request, and requiring human approval for sensitive tools.

It also covers scanning prompts for signals such as data exfiltration, privilege escalation, system destruction and prompt injection, and keeping audit trails of agent actions. The skill is aimed at engineers, not end users.

  • Policy objects that allow, deny or flag tools for human review
  • Content filters based on regular expressions
  • A maximum number of tool calls per request
  • Pre-execution intent checks on prompts
  • A decorator that wraps tool functions with governance checks
  • Audit trail logging for agent actions

Install the agent-governance skill

Download the ZIP file for the skill from this page. The package contains one file, SKILL.md. Unzip it so the folder named agent-governance sits inside one of the following locations.

For a personal setup, put it in ~/.claude/skills/. For a single project, put it in the project's .claude/skills/ folder. Alternatively, in the Claude apps you can upload the ZIP under Settings → Capabilities → Skills.

  • Personal: ~/.claude/skills/agent-governance/
  • Project: .claude/skills/agent-governance/ inside your repository
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

Trigger the skill with natural requests

You do not need a special command. Describe the governance task in plain language and the agent will use the skill when the request matches its description. The skill's description says it applies when you are building agents that call external tools, implementing policy-based access controls, adding semantic intent classification, creating trust scoring for multi-agent workflows, building audit trails, or enforcing rate limits and content filters.

Name the framework you use if you have one. The skill lists PydanticAI, CrewAI, OpenAI Agents, LangChain and AutoGen, but says the patterns are framework-agnostic.

  • "Add a policy that only lets my agent call search_documents and query_database."
  • "Require human approval before my agent can send email."
  • "Cap my LangChain agent at 25 tool calls per request and log every action."
  • "Add prompt injection checks before my CrewAI agent runs tools."

Examples of what you get back

A typical policy in the source is a dataclass with allowed_tools, blocked_tools, blocked_patterns, max_calls_per_request and require_human_approval fields. The check_tool method returns DENY for blocked tools, REVIEW for tools needing approval, DENY for tools outside a non-empty allowlist, and ALLOW otherwise.

Policies can be composed with most-restrictive-wins semantics, so an organisation-wide policy and a team policy can be layered. The source also shows loading a policy from a YAML file with PyYAML.

agent_policy = compose_policies(org_policy, team_policy)

Requirements and safety notes

You need Python. You need PyYAML only if you load policies from YAML. The patterns work with an agent framework such as PydanticAI, CrewAI, OpenAI Agents, LangChain or AutoGen, but these are optional. The skill does not run scripts and does not use the network.

The regex-based threat detection is simple pattern matching and is easy to bypass, so treat it as one layer, not a complete defence. The file makes no compliance guarantees, so it is not evidence for SOC 2 or HIPAA. Review the sample code before using it in production.

  • Requires Python; PyYAML only for YAML policies
  • Runs scripts: no. Uses network: no
  • Licence: MIT

Tips for getting good results

Give the agent your real tool names and framework so the policy matches your code. Ask for the policy to be stored as YAML if you want non-developers to review or change limits without editing code. Ask for audit logging from the start, because it is hard to add after incidents occur.

  • Layer policies from broad (org-wide) to specific (agent-level)
  • Use the allowlist for sensitive systems rather than relying only on blocklists
  • Test the intent checks against your own sample prompts before trusting them

What people use it for

  • Restricting an agent that calls internal APIs to a short list of approved tools
  • Requiring a person to approve emails or financial actions before the agent runs them
  • Capping tool calls per request to limit runaway agent loops
  • Logging every tool call and decision for later review in a production agent
  • Designing trust boundaries between agents in a multi-agent workflow

Frequently asked questions

How do I install the agent-governance skill?

Download the ZIP from this page and unzip it so the agent-governance folder sits in ~/.claude/skills/ for personal use or in .claude/skills/ inside a project. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.

What do I need to use it?

You need Python. PyYAML is only needed if you load policies from YAML files. An agent framework such as PydanticAI, CrewAI, OpenAI Agents, LangChain or AutoGen is optional because the patterns are framework-agnostic.

Is the agent-governance skill free?

The skill is listed under the MIT licence. Check the licence file in the source repository for the full terms.

Does this skill make my agent safe?

No. It provides patterns and sample code, not a tested security system. The regex-based threat detection is easy to bypass, so use it as one layer alongside other controls.

Is this skill enough for SOC 2 or HIPAA compliance?

No. The file offers no compliance guarantees or verification, so it cannot establish that a system meets SOC 2 or HIPAA requirements.

Can I use it with frameworks other than the ones listed?

The source says the patterns are framework-agnostic, so they can be adapted to other agent frameworks. You would need to wire the policy checks into your own tool-calling code.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Choose this skill if you are an engineer building agents that call tools, APIs or databases and you want clear starting patterns for allowlists, approvals, rate limits and audit logs. Pick something else if you need a ready-made safety product or a certified compliance solution, since this skill provides sample code and no guarantees.

Download the skill