AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Ap2 Shopping Agent

skill-orcaqubits-agentic-commerce-skills-plugins-ap2-shopping-agent · by OrcaQubits

Build an AP2 Shopping Agent — the main orchestrator that handles user requests, creates mandates, coordinates with merchants and credentials providers, and manages the transaction flow. Use when implementing the Shopping Agent role.

No reviews yet
0 installs
37 views
0.0% view→install

Install

$ agentstack add skill-orcaqubits-agentic-commerce-skills-plugins-ap2-shopping-agent

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-orcaqubits-agentic-commerce-skills-plugins-ap2-shopping-agent)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
4mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Ap2 Shopping Agent? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

AP2 Shopping Agent Implementation

Before writing code

Fetch live docs:

  1. Fetch https://ap2-protocol.org/specification/ for Shopping Agent responsibilities
  2. Web-search site:github.com google-agentic-commerce AP2 samples roles shopping_agent for reference implementation
  3. Web-search site:github.com google-agentic-commerce AP2 samples python src roles for source code structure
  4. Fetch SDK docs for agent framework classes (Google ADK)

Conceptual Architecture

What the Shopping Agent Does

The Shopping Agent (SA) is the primary orchestrator of AP2 transactions. It acts as the user's representative, coordinating between all other roles:

  1. Receives user intent — Understands what the user wants to buy
  2. Creates Intent Mandates — Formalizes user intent into structured mandates
  3. Discovers merchants — Finds merchants that can fulfill the intent
  4. Negotiates with merchants — Presents mandates, receives Cart Mandates
  5. Coordinates with Credentials Provider — Gets payment methods, handles tokenization
  6. Manages user interaction — Presents options, collects confirmations
  7. Orchestrates the full flow — Drives the human-present transaction flow

Note: The Shopping Agent does not create Payment Mandates. Payment Mandates are constructed by the Merchant Payment Processor (MPP).

Agent Card

The Shopping Agent's Agent Card declares:

  • AP2 extension support in capabilities.extensions[]
  • Skills related to shopping (product search, cart management, payment)
  • Authentication requirements for users
  • Supported input/output modes

Key Responsibilities

Intent Capture
  • Parse user's natural language shopping request
  • Extract: what to buy, constraints (price, brand, quality), preferences
  • Present structured understanding back to user for confirmation
  • Create and present Intent Mandate for signing
Merchant Interaction
  • Discover merchant agents (via Agent Cards or registry)
  • Present Intent Mandate to relevant merchants
  • Receive and evaluate Cart Mandates
  • Handle merchant clarification requests
  • Support multi-merchant scenarios (compare offers)
Payment Coordination
  • Query Credentials Provider for available payment methods
  • Present payment options to user
  • Request payment method tokenization
  • Relay payment context to Merchant/MPP (the MPP constructs the Payment Mandate)
  • Handle the trusted device surface attestation flow
User Communication
  • Display product options clearly
  • Show pricing breakdowns
  • Present payment method choices
  • Redirect to trusted device surface for confirmation
  • Deliver receipts and confirmations

What the Shopping Agent Must NOT Do

Critical security constraints:

  • Never access raw payment credentials — Only tokenized references (DPANs)
  • Never store PCI data — Card numbers, CVVs stay with Credentials Provider
  • Never store PII beyond needed scope — Minimize data retention
  • Never forge user signatures — Signatures come from user's device
  • Never auto-approve beyond Intent Mandate bounds — Respect constraints

Implementation with Google ADK

The reference implementation uses Google ADK:

  • ADK agent with Gemini 2.5 Flash for reasoning
  • A2A server for receiving user messages
  • A2A client for communicating with other agents
  • Port 8000 with ADK web UI

Verbose Mode

Include "verbose" in the initial prompt to enable:

  • Detailed agent explanations of each step
  • Display of all mandate JSON payloads
  • Full DataPart visibility
  • Useful for debugging and development

Best Practices

  • Use the LLM for understanding intent, but validate mandates deterministically
  • Always present clear summaries to the user before requesting signatures
  • Handle timeouts for user responses
  • Implement retry logic for failed agent-to-agent communications
  • Log all mandate creation and agent interactions
  • Support the escalation from autonomous to human-present flows
  • Test with multiple merchants to verify comparison logic
  • Never bypass the trusted device surface confirmation

Fetch the sample Shopping Agent source code for exact implementation patterns, ADK configuration, and A2A message handling before building.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.