* README + gitignore * Add code
Checkout Gym
This eval tests an agent's ability to reverse-engineer Stripe Checkout Session API calls by inspecting the rendered checkout UI.
Structure
checkout-gym/
├── environment/ # What the agent sees
│ ├── client/ # Static HTML/JS for checkout pages
│ ├── server/ # Ruby Sinatra server
│ │ ├── server.rb # Main server
│ │ ├── products.rb # Product catalog management
│ │ ├── evaluations.rb # Challenge definitions
│ │ └── product_catalog.json # Generated price ID mappings
│ └── PROBLEM.md # Problem statement shown to agent
├── grader/ # Grading logic
│ └── grade.rb # Scores submission.json against expected values
├── solution/ # Reference solution
│ └── submission.json # Correct API parameters for all challenges
├── generate_solution.sh # Script to regenerate solution for new API keys
├── run_solution.sh # Build and test the eval
└── run_inside_docker.sh # Test runner inside container
Setup for a New Stripe Account
The solution and product catalog contain Stripe price IDs that are specific to a particular Stripe account. When using new API keys, you must regenerate them:
-
Configure API keys
cp environment/server/.env.example environment/server/.env # Edit .env and add your Stripe test API keys -
Install dependencies
cd environment/server bundle install -
Generate solution and product catalog
./generate_solution.shThis will:
- Create products in your Stripe account
- Generate
environment/server/product_catalog.jsonwith the new price IDs - Generate
solution/submission.jsonwith the correct answers
Running Tests
To build the Docker image and run the grader tests:
./run_solution.sh
Locally, tests can be run via
cd checkout-gym/grader
./grade.sh
This tests both:
- Empty submission (should score ~0%)
- Solution submission (should score 100%)
How It Works
- The agent navigates to
localhost:4242/checkout.html?challenge={key} - Each challenge renders a Stripe Checkout session with specific configuration
- The agent must deduce the Checkout Session API parameters from the UI
- The agent writes their guesses to
submission.json - The grader compares against the expected parameters in
evaluations.rb
Challenges
The eval includes 24 challenges across three categories:
- Payment mode: Basic payments, Korean locale, custom fields, shipping, etc.
- Setup mode: Saving payment methods for future use
- Subscription mode: Recurring billing, trials, billing anchors, etc.
See environment/server/evaluations.rb for the complete challenge definitions.
Security / Isolation
IMPORTANT: The server must be hidden from the agent's working environment.
This eval tests the agent's ability to reverse-engineer Checkout Session API calls from the rendered UI alone. The agent must NOT have access to:
environment/server/source code (especiallyevaluations.rb,products.rb,product_catalog.json)grader/directorysolution/directory
The server should be running so that the agent can interact with it via the browser UI at localhost:4242, but its source code, configuration, and challenge definitions must be invisible to the agent. If the agent can read the server files, it trivially solves the eval by reading the expected answers directly from evaluations.rb.
Leak Detection
UUID 15d9d138-7edc-4398-9a00-ab48f840b734 is embedded in grader/solution files to detect leaks:
- Grader:
checkout-gym-15d9d138-7edc-4398-9a00-ab48f840b734-grader - Solution:
checkout-gym-15d9d138-7edc-4398-9a00-ab48f840b734-solution