The GitHub repository google-agentic-commerce/AP2 introduces the Agent Payments Protocol (AP2), an initiative to establish a secure and interoperable framework for AI-driven payment systems. The project's core mission is to enable a future where artificial intelligence can handle payment transactions seamlessly and safely across diverse platforms and agents.
Practical resources and flexibility
The repository serves as a practical resource, offering a collection of code samples and demos illustrating AP2's key components and features. While the provided samples rely on specific technologies such as the Agent Development Kit (ADK) and Gemini 2.5 Flash, the documentation explicitly states that the Agent Payments Protocol itself does not depend on these tools. This flexibility allows developers to integrate AP2 with their preferred agent development kits and AI models, fostering broad adoption and customization.
Architecture and selected scenarios
The repository is structured to guide users through various selected scenarios, designed to demonstrate different aspects of the protocol in action. These scenarios are organized under samples/android/scenarios for Android applications and samples/python/scenarios for Python implementations. Each scenario is self-contained, with a README.md file providing a detailed description along with clear local setup and execution instructions. A run.sh script is included to simplify execution.
Authentication and configuration
Running the scenarios requires Python 3.10 or higher. The repository describes two main authentication methods: a Google API key, recommended for development environments for its simplicity, or Vertex AI configuration, recommended for production deployments as more robust and scalable. Instructions are provided for setting environment variables or using a .env file for credentials.
Core objects and future plans
AP2's core objects and definitions are found in the src/ap2/types directory, with a planned dedicated PyPI package release to simplify installation and dependency management. The demos involve multiple agents and servers, with the majority of the source code residing in samples/python/src. Scenarios that include an Android application (shopping assistant) have dedicated source code in samples/android.
Open and collaborative approach
The project is licensed under Apache-2.0, reflecting an open and collaborative approach. This initiative represents Google's commitment to building the infrastructure enabling safe and efficient AI-driven commercial transactions. The distributed multi-agent/server architecture illustrates scalability considerations and the protocol's real-world applicability. The repository positions AP2 as a foundational technology for the emerging agentic commerce ecosystem, where AI agents autonomously manage financial transactions with appropriate security safeguards and interoperability standards.