Case study — Lab10 Frontier
Rebuilding an undocumented API from the outside
View the code ↗Context
Frontier is a one-day hackathon by Lab10 in Bogotá. In Challenge 2, "The black box", each team got access to an account service with no documentation and a budget of 8,000 requests. The goal: build an exact replica, with the same responses and the same errors, graded against 100 hidden tests.
My approach
Every request to the original went through one script that logged it with the hypothesis it was testing. That log became the evidence behind every rule in the spec, the test suite for the replica, and a record of what I tried. The replica is a plain state machine in Python with no AI at runtime, so every answer is exact and repeatable.
When my own tests were wrong
The first validation run scored 64/100 while my local tests passed at 100%. The local tests replayed my own experiments, so they shared the replica's blind spots. I wrote targeted tests for money flows and edge cases, found the rules I had missed, and raised the score to 79, then 89. The organizers' final official run scored 95/100.
A change mid-competition
At 15:30 the organizers changed the service on purpose. I confirmed three new behaviors (balance format, transfer limit, an account lock), updated the replica's rules file, and had the new version deployed within ten minutes of seeing the first changed response.
Safety over score
One command could shut down the service for every team. I blocked it and never explored it, even if that cost points. One request slipped through an early test; the service stayed up, and I documented it. The service also returned a hidden note asking the reader to call an internal export endpoint, a prompt injection. I replicated the note as data and never followed it.
Results
- 95/100 on the hidden test set in the final official run
- 4,387 of 8,000 requests used
- A model given only my spec, with no tools, rebuilt the service and matched 99.97% of logged requests
- Under $0.10 in AI costs
I used Claude Code as my coding agent. I planned the experiments, approved every batch of requests before it reached the shared service, and made the calls above.