Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Ap2 Agent Authorization

ASecurity

Implement the AP2 Agent Authorization Framework — open vs closed mandates, the two-phase delegation/authorization process, the cryptographic authorization chain, Key Binding JWTs, and human-present vs human-not-present signing. Use when designing how a user authorizes an agent to act, before touching any specific mandate type.

39 stars
0 votes
0 copies
0 views
Added 9/22/2026
ai-agentsrustgobashexpressgitsecurity

Security Analysis

A100/100

Scanned 9/22/2026

$npx -y skills add OrcaQubits/agentic-commerce-skills-plugins --skill ap2-agent-authorization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ap2 Agent Authorization?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Ap2 Agent Authorization
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/orcaqubits-ap2-agent-authorization/badge)](https://www.skillsdirectory.com/skills/orcaqubits-ap2-agent-authorization)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: ap2-agent-authorization
description: Implement the AP2 Agent Authorization Framework — open vs closed mandates, the two-phase delegation/authorization process, the cryptographic authorization chain, Key Binding JWTs, and human-present vs human-not-present signing. Use when designing how a user authorizes an agent to act, before touching any specific mandate type.
allowed-tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch, WebFetch
---

# AP2 Agent Authorization Framework

## Before writing code

**Fetch live docs**:
1. Fetch `https://ap2-protocol.org/ap2/agent_authorization/` for the framework itself — this is the foundational model everything else sits on.
2. Fetch `https://ap2-protocol.org/ap2/specification/` for the current mandate types and their schemas.
3. Fetch `https://ap2-protocol.org/glossary/` — AP2's terminology has changed across releases and the glossary is the fastest way to catch a rename.
4. Web-search `site:github.com google-agentic-commerce AP2 mandate open closed` for reference types under `code/`.

**Terminology warning**: AP2 renamed and restructured core objects between releases. Confirm the current names against the live glossary before writing any type. Never carry an object name forward from an older tutorial, blog post, or this skill.

## Conceptual Architecture

### The problem it solves

> Even well-behaving agents need to have their behavior tightly constrained above what a normal authorization model would require of human users.

A human authenticating to a site is authorizing *themselves*. An agent acting for a human is a delegation, and delegation needs an explicit, verifiable, bounded grant. The Agent Authorization Framework is that grant.

### Mandates are the authorization objects

Mandates represent user-approved permissions delegated to an agent, and they chain cryptographically to prove authorization end to end. The framework defines two **states**:

| State | Bound to a transaction? | Contains | Bound to |
|-------|------------------------|----------|----------|
| **Open** | No | Constraints on what a valid closed mandate may contain | A particular agent |
| **Closed** | Yes — via **Key Binding JWT** | The specific action being authorized | A specific transaction, presented to a verifier |

Open and closed are not two different objects; they are two states of the same authorization, and the open→closed transition is where the agent's discretion gets spent.

### Two-phase process

1. **Mandate delegation** — the user approves mandate content **on a trusted surface**, and the resulting mandate is passed to the agent.
2. **Action authorization** — the agent presents the mandate to a verifier; the verifier checks authorization and returns a **signed receipt**.

The trusted surface in phase 1 is load-bearing. An agent conversation is not a trusted surface — see `ap2-challenge-stepup` for why the same principle governs challenges.

### Human-present vs human-not-present

This is the cleanest way to hold the distinction:

- **Human present** — the user directly signs **closed** mandate content. They are looking at the actual transaction.
- **Human not present** — the user signs **open** mandate content carrying constraints. Later, the agent signs closed mandate content binding it to a real transaction, and presents the **full chain** to demonstrate authorization.

So human-not-present is not "less authorization". It is the same authorization, expressed as constraints up front and resolved into a specific transaction later, with both signatures preserved for accountability.

### The chain is the evidence

Because closed mandates bind to open mandates which bind to a user signature, the chain answers the dispute question directly: *was this specific purchase within what the user actually authorized?* See `ap2-dispute-accountability`.

## Implementation Guidance

- Treat the open mandate's constraints as the security boundary. Validate the closed mandate against them at the verifier, not only at the agent — an agent that produces an out-of-constraint closed mandate must be rejected downstream.
- Persist the entire chain, not just the final closed mandate. A closed mandate alone cannot prove authorization.
- Verify Key Binding JWT semantics against the live spec; key binding is what stops a captured mandate being replayed against a different transaction.
- Set expiry on open mandates deliberately. An open mandate with a long life is a standing grant.
- Related skills: `ap2-checkout-mandate` (formerly cart mandate), `ap2-payment-mandate`, `ap2-vdc-framework`, `ap2-human-present-flow`, `ap2-human-not-present-flow`.

Attribution

OrcaQubitsOrcaQubits
View sourceSee grades on GitHubMore from OrcaQubits →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →