Sessionboxer

Every search API AIR tested handed coding agents malicious results. What WebSec found, and what to set in Claude Code and Codex

AIR ran 4,719 coding-agent searches through eight search APIs and all of them returned malicious content. What that means, and which settings to change.

The LLM call dialog in Sessionboxer showing the decoded request body Claude Code sent to the Anthropic API, with Request, Response, Tree and Diff tabs

Your agent hits an error it has not seen before, so it searches the web. It reads the top results, picks a fix, and runs the install command from a README. You were not asked, because you turned the prompts off weeks ago. Whether that went well depends on what the search returned, and a study published this week says that, now and then, what comes back is malware.

This post covers what the study measured, how a search result turns into a command on your machine, and the settings in Claude Code and Codex that decide how much your agent searches and what it can do next.

What AIR measured

On November 23, AIR Research Lab published WebSec, a benchmark of the search APIs that agents use. The researchers took 4,719 searches drawn from real coding-agent tasks: error messages, build failures, "which library should I use", "how do I install this". None of the queries mentioned anything malicious. They sent each one to eight search APIs: Firecrawl, Tavily, Perplexity, Parallel, Exa, Nimble, Brave and You.com. Then they checked more than 282,000 results.

Every API returned known-malicious content at least once. In their write-up for The Hacker News, the researchers say 534 of about 37,700 searches surfaced content already known to be malicious, and agents were handed malicious or risky results 1,026 times. Per API, the rate was 0.8% to 2.2%, or one bad search in every 45 to 125. It was highest for install and package searches, which are the moments just before an agent runs code.

The benchmark scores each API on a WebSec Index, where higher is safer. Firecrawl (21.59) and Tavily (18.59) scored highest and You.com (5.02) lowest. AIR's post puts Brave near the bottom and notes that Brave powers Claude's web search. AIR sells security for agents and Firecrawl is one of the vendors it ranked first, so read the ranking as one company's measurement. The part that does not depend on the ranking is simpler: no API came back clean.

The method is worth a look because it explains why the numbers are believable. Each result was opened twice, once as an agent and once as a normal browser, because some pages show agents different content than people see. Seventeen checks looked at the domain, the packages and the install commands each result recommended, and the team reviewed every finding.

How a search result becomes a command

AIR gives two examples from its earlier research.

The first is SolanaCry. A GitHub repository posing as a Solana starter kit, with 286 stars and a convincing description, ranked first in search. Its README said to install it with one PowerShell command. On Windows, that command installed a remote access tool that restarts every time the user logs in. An agent asked to "set up a Solana project" that took the top result and followed the README would have handed the machine to the attacker. Nobody had to click anything.

The second is Web Hole. In about 2,000 everyday developer queries, AIR found 36 results on domains that were no longer registered. One came up for a Python import error, another for a basic AngularJS question. Anyone can buy such a domain and put instructions on it, and the search index keeps sending visitors.

The researchers group what they found into six kinds: prompt injection written for the agent, lookalike package and domain names, packages that models invent and attackers then register, pages built to rank for agent queries, takeovers of pages that already rank, and pages that steer the agent toward pipe-to-shell installs or unvetted MCP servers.

None of this is new to people. What changes with an agent is the gap between reading and doing. A person who sees curl ... | sh from a domain registered last week tends to stop. An agent with a shell and your credentials reads and acts in the same step.

What your agent searches with today

Both big CLIs have a built-in search tool, and each has a setting for it.

In Claude Code, WebSearch and WebFetch are tools like any other. The permissions page says that in Manual mode both ask before they run, except WebFetch on a built-in list of documentation domains. "Yes, and don't ask again" on a search saves the approval permanently for that repository. In bypassPermissions mode nothing asks. A deny rule removes a tool completely, and the permission modes page says deny rules block in every mode, bypassPermissions included:

{
  "permissions": {
    "deny": ["WebSearch", "WebFetch"]
  }
}

Codex works differently. Its web search docs say local chats use cached search by default: results come from an index that OpenAI maintains, which the docs say lowers the risk of prompt injection without removing it. When Codex runs with full access, as with --yolo, search defaults to live results instead. The docs also say web search is a hosted tool. It does not go through Codex's network proxy or domain allowlist, and it can stay on when command network access is off. You choose the mode in ~/.codex/config.toml:

# disabled | cached | indexed | live
web_search = "cached"

The docs also mention a tools.web_search.allowed_domains setting for limiting search to chosen sites.

What to change

For one developer running agents, it comes down to a few steps.

  1. Decide whether the task needs search at all. A refactor of your own code rarely does. Deny WebSearch and WebFetch in Claude Code, or set web_search = "disabled" in Codex, for those sessions.
  2. If you run Codex with full access, set web_search explicitly. Otherwise you get live search without having chosen it.
  3. Do not let unattended agents run download-and-execute lines such as curl | sh or iwr | iex. Claude Code Bash deny rules can block the forms you know about. An agent can write the same command another way, so these rules catch the common case and nothing more.
  4. Before a new dependency lands, check that the package exists, how old it is, and whether it shows up in OSV, a vulnerability database that also lists known malicious packages. A package that was published yesterday, or a name you cannot find anywhere, is a reason to stop.
  5. Keep long-lived tokens out of the place where the agent runs. A trojan that lands in a box with no credentials gets much less. Our post on keeping secrets away from your coding agent goes through the options.
  6. Keep a record of what the agent read, not only what it ran. When something goes wrong, the page that started it is the hardest thing to find later.

Where Sessionboxer fits, and where it does not

Sessionboxer runs each session in its own Docker container with the code cloned or copied in. If an agent in a box follows a poisoned README, the install script runs in that container. It does not reach your home directory or your SSH keys, because the box has no SSH keys. If you snapshot the box after a turn, you can later fork a fresh session from that point and delete the damaged box. The snapshots chapter of the guide explains how.

Inside the box the agent runs with every permission granted. So the box does not stop a search, a fetch or an install. It decides where the result lands. Sessionboxer also does not filter outbound traffic. A box can reach any address your machine can reach, which is how a remote access tool would call home. If you need that blocked, put a firewall or an egress proxy in front of the Docker network, as we described in the post on the WorkOS sandbox escape.

For step 6, Claude Code sessions have Inspect LLM. It records each request Claude Code sends to the Anthropic API and the response, byte for byte, so the tool calls and the results that went back to the model are there to read. The Inspect LLM chapter lists its limits: it keeps the last 40 calls, in memory inside the box, and they are gone when the box stops. That is enough to see which page a turn read before it ran a command. It is not an audit log. Devin sessions have no such record, because Devin's CLI builds its prompts on Cognition's servers.

The deny rules and the Codex setting above are standard settings of those CLIs. We have not tested each of them through Sessionboxer's agent adapters, so after you add one, ask the agent to search for something and check that it says it cannot.

Features mentioned

Keep reading