December 1, 2026
# How to backtest AI agents without look-ahead bias
A backtest of a forecasting, trading, or research agent is only as honest as the information the agent could reach on the simulated date. This guide covers the five ways future information leaks into agent backtests, how to set a cutoff that holds across search, page reads, and the model itself, how to score the results, and how to audit a run.
## Look-ahead bias in agent backtests
Look-ahead bias[Look-ahead bias] is the use of information in a backtest that wasn't available on the date being simulated. Quant teams handle it for prices and fundamentals with point-in-time datasets. Agents bring a new source of it: a web search tool. An agent replaying an earnings call from March can search the web in December, and the web in December knows how the quarter turned out.
The inflation is large. In Perplexity's Time Machine launch post[Time Machine launch post], a model forecasting held-out Polymarket questions scored 0.94 with live web search and 0.77 when search was held to the day each question was asked. The market price on that day scored 0.79. With live search the model looked far better than the market; with the cutoff, it was slightly worse. An ACL 2026 study[ACL 2026 study] found the same pattern with date-filtered search: a forecasting model given leaky pages reached a Brier score of 0.10, against 0.24 on clean ones. Lower is better, so the leak cut the model's apparent error by more than half.
## Five ways future information leaks into a backtest
- **Search results.** A live search returns pages published after the simulated date. This is the obvious one.
- **Edited pages.** A publication-date filter keeps an article dated before the cutoff but returns its current text, which may have been updated with the outcome, a correction, or a sidebar linking to later coverage. The ACL study found the answer revealed outright for 41% and 55% of questions on the two date-filtered engines it tested.
- **Page reads.** An agent that searches a snapshot but opens pages with a live fetch tool reads today's version of every page it opens.
- **The model's own memory.** If the model was trained on text written after the simulated date, it can recall the outcome without searching. No search setting fixes this.
- **Metadata and the harness.** Result dates, URLs with later dates in them, file timestamps, or a grader prompt that mentions the outcome can all hint at the answer. Cursor's SWE-bench audit[SWE-bench audit] found an agent inferring that a bug was already fixed because the environment image was built after the fix.
## Step 1: Build questions with an open date and a resolution
Each backtest item needs three fields: the question, the time it opened (when a forecaster could first have asked it), and how it resolved. Prediction-market questions, earnings estimates, regulatory decisions, and product launch dates all fit. Write the cutoff as a timestamp, not a date, when the event has a known hour: a cutoff of 09:00 UTC before a 13:30 UTC earnings release is different from one at midnight.
## Step 2: Pick questions that resolved after the model's training cutoff
This handles leak 4. If the model's training data ends in March 2026, questions that resolved in 2025 test recall as much as reasoning. Use questions that resolved after the model's published training cutoff. If you have to use older ones, run the model with no tools first to measure how much it already knows, and report that baseline next to the backtest.
## Step 3: Pin search and page reads to the same cutoff
This handles leaks 1 to 3. Use a point-in-time search[point-in-time search] API for both the search tool and the page-read tool, and pass the same cutoff to both on every call. Each result then comes from the newest copy of the page the index captured at or before the cutoff, and pages captured later are left out.
123456789101112131415161718192021from parallel import Parallel
client = Parallel()
def tools_for(question):
policy = {"fetch_policy": {"as_of": question["opened_at"]}}
def search(objective, queries):
return client.search(
mode="fast",
objective=objective,
search_queries=queries,
advanced_settings={"max_results": 10, **policy},
).results
def read(urls, objective):
return client.extract(
urls=urls, objective=objective, advanced_settings=policy
).results
return search, read``` from parallel import Parallel client = Parallel() def tools_for(question): policy = {"fetch_policy": {"as_of": question["opened_at"]}} def search(objective, queries): return client.search( mode="fast", objective=objective, search_queries=queries, advanced_settings={"max_results": 10, **policy}, ).results def read(urls, objective): return client.extract( urls=urls, objective=objective, advanced_settings=policy ).results return search, read``` Parallel, Exa, Perplexity, and Keenable each offer point-in-time search, with different history windows, access terms, and prices. Our comparison of point-in-time search APIs[comparison of point-in-time search APIs] covers the differences, including whether ranking is also held to the cutoff or only the page content.
## Step 4: Strip hints from the harness
This handles leak 5. Remove the resolution and any outcome-bearing fields from the agent's prompt and tool outputs. Drop or normalize result dates if your API returns them, or at least check none is later than the cutoff. Keep the grader in a separate process that the agent never calls.
## Step 5: Score against outcomes and a baseline
For probabilistic forecasts, the Brier score (mean squared error between the forecast probability and the 0 or 1 outcome) is the standard. Report it next to two baselines: the model with no tools, which tells you how much search adds, and a reference forecaster for the same moment, such as the market price on the open date. A backtest that beats the market by a wide margin is more likely to be leaking than to be right, so treat that result as a reason to audit.
## Step 6: Audit the run
Sample the trajectories with the best scores and read them. Check whether any retrieved text names the outcome, whether any result or page carries a capture or publication date after the cutoff, and whether the agent's queries assume the result. Then look at coverage in the other direction: count questions where the agent found no relevant evidence at all. A gap in historical coverage makes the agent look worse than it would have been, which biases a backtest as surely as a leak, only in the other direction.
## Where this applies
- - **Forecasting agents.** Train or evaluate on resolved questions, holding search to each question's open date.
- - **Investment research.** Replay a past earnings season with the agent's research tools held to each call date, and compare its thesis against what happened.
- - **Regulatory and policy monitoring.** Backtest whether an alerting agent would have flagged a rule change from the evidence available before it was announced.
- - **[RL post-training](/articles/web-search-for-reinforcement-learning).** The same cutoff that keeps a backtest honest keeps an RL reward from being earned by looking up the answer.
## FAQ
**What is look-ahead bias in simple terms?**
Using information in a test that you couldn't have had at the time you are pretending to be in. It makes a strategy or model look better than it would have performed.
**How is look-ahead bias different from data leakage?**
Data leakage is the broader term for any information from outside the training or test setup reaching the model. Look-ahead bias is the time-based case: the leaked information comes from after the simulated date.
**Can a date filter on a normal search API prevent look-ahead bias?**
Only partly. It drops pages published after the cutoff but returns today's version of older pages, so post-cutoff edits still reach the agent. Point-in-time search filters on when a copy of the page was captured instead.
Related reading: Point-in-time search APIs compared[Point-in-time search APIs compared] / Web search for reinforcement learning[Web search for reinforcement learning] / AI agents in finance[AI agents in finance] / How to benchmark web search APIs[How to benchmark web search APIs]