Skip to main content

Introduction

BackSearchToolset gives an agent web search and page fetch bounded to a cutoff date — “the web as it existed on or before date X”. Every request carries an as_of date and the backing corpus only returns documents published on or before it. This is what makes the tools leakage-safe for evaluation and prediction tasks: an agent researching a question dated to the past never sees anything published after the cutoff. There are two ways to use it:
  • As an environment toolset — declare BackSearchToolset and the agent gets web_search / web_fetch tools.
  • Standalone — call Backsearch / Backfetch directly from any Python or agent loop, no environment required.
Requires openreward >= 0.1.134. The web tools authenticate with your standard OPENREWARD_API_KEY — no separate key is needed.

Configuration

The only required setting is your OpenReward API key (the same key the rest of the SDK uses). In a hosted environment it is forwarded automatically as a session secret.
Search runs over a fixed historical corpus. Choose as_of dates inside the covered window — dates outside it return no results. Confirm the current coverage with the OpenReward team.

Using the toolset in an environment

Declare BackSearchToolset at class level. Unlike the harness toolsets, it is not sandbox-backed — it talks to the web service over HTTP — so your environment does not need a self.sandbox.
The agent then sees two tools:

Selecting it by name in a session

BackSearchToolset is a registered built-in, so a client can also attach it to a session by name:

Composing with other toolsets

Because it needs no sandbox, BackSearchToolset composes cleanly with sandbox-backed toolsets — e.g. web research plus a file workspace:
All tools from both toolsets are exposed, and the framework rejects duplicate tool names. BackSearchToolset uses web_search / web_fetch, which do not collide with the file/CLI toolsets.

Progressing the cutoff

The cutoff is resolved on every tool call, in priority order:
  1. an explicit as_of= passed to the toolset constructor (a static pin), else
  2. env.web_as_of, else
  3. the OPENREWARD_WEB_AS_OF environment variable, else
  4. the backend default (today).
Because env.web_as_of is read live — not snapshotted when the toolset is built — an environment whose simulated clock advances stays correctly bounded to its current day. Expose it as a @property or a callable:
This matters because the framework builds and caches one toolset instance per environment for the whole session — a construction-time snapshot would freeze the date at the first call.

Standalone usage

The same backdated search and fetch are available without an environment:
Both run(...) calls return a WebToolResult: Backsearch.run accepts allowed_domains / blocked_domains and a per-call as_of; Backfetch.run takes a url, a prompt, and a per-call as_of.

Notes

  • Citations. Search output is formatted so the model is reminded to cite the returned URLs as markdown links in its final answer.
  • Caching. Fetches are cached in-process for 15 minutes, keyed by (cutoff, url), so repeated fetches at the same cutoff are fast and never mix content across dates.
  • Soft errors. Bad inputs (unparseable URL, blocked domain, missing key) come back as a normal result with .ok == False and a clear message rather than as an exception, so an agent can read it and recover.

Next Steps

Using Toolsets

Compose document toolsets and build custom ones

Harness Toolsets

Expose agent-native CLI tool surfaces backed by a sandbox

Building Agentic Environments

Create sandbox-based environments from scratch

Keeping Secrets Secret

How API keys and secrets reach your environment