Back to blog

Running Multiple AI Agent Browsers: Three Isolation Needs and Resource Costs

One Agent in one browser window is enough for a demo. In production, dozens of concurrent tasks need separate environments; otherwise login sessions contaminate each other, tabs compete for control, and failures become hard to diagnose.

One browser window is enough to demonstrate what an AI Agent can do. Put it into a real business workflow, and the requirement quickly becomes dozens of windows that must not interfere with one another. The reason is not the Agent itself, but the browser environment underneath it.

What goes wrong when one environment is shared

The most obvious problem is contamination between cookies and login sessions. In a single browser data directory, two tasks that sign in to different accounts one after another can overwrite each other's sessions; if one task clears the cache, the other task can lose its page state as well.

Then comes contention. In one browser instance, tabs, focus, download directories, and pop-ups are shared resources. If two tasks open new tabs at the same time, it becomes unclear which task is operating which page; a dialog opened by one task can leave another task's script stuck. Login conflicts, overwritten data, and mutual interference are almost inevitable under concurrency.

The third problem appears after something fails. It is hard to tell whether the script logic was wrong or whether another task disturbed the environment at a particular step. When multiple tasks share one process and one log, failure symptoms can also vary, multiplying the cost of troubleshooting.

There is another, less obvious risk: when multiple identities run for long periods in the same environment, they leave correlation signals. Device parameters, storage state, and network egress are all identical, so a platform can easily see them as batch activity from the same device. If one account is flagged as abnormal, other accounts can be affected too.

Multiple windows are not the same as isolation

A common first reaction is to open several windows manually. They look separate, but they actually share the same browser profile: the same cookies, the same local storage, and the same device information. Windows can see one another's login state, and an action in one window may affect another.

Real isolation has to extend to the data directory and environment parameters. Each environment needs its own storage directory, its own device parameters—resolution, language, time zone, fonts, Canvas, WebGL, and so on—and its own network egress. Leave out any one of the three and the isolation is incomplete. Even with separate environments, sharing one egress can still trigger correlation checks.

并发 Agent 任务一一映射到独立浏览器环境,并由环境调度器管理状态和资源开销

What isolation costs, and what it gives back

Isolation is not free. Behind every environment is an independent browser process and a separate data directory. As the number of environments rises, memory and CPU pressure show up first. If dozens of environments run on one machine, it is usually better to calculate the remaining headroom in advance than to wait for a crash and react afterward.

There are several trade-offs available: recycle environments that are rarely needed and start them again on demand; distribute tasks by workload across several machines instead of piling everything onto one; and define clear environment lifecycles instead of leaving hundreds of environments running indefinitely. Task structure matters too. Serial tasks under the same account do not need separate environments; splitting them only wastes resources.

The other side is the benefit. Once isolation is implemented correctly, failure behavior becomes stable: the problem belongs to a specific environment rather than to something mysterious. At scale, that predictability is worth far more than the small amount of resources saved by sharing environments.

Three things that belong at the environment layer at scale

The first is batch scheduling. Environments should be requested and released like compute resources, with support for on-demand creation, batch startup, concurrency control, failure retries, and automatic recycling, instead of being created and cleaned up one by one inside scripts.

The second is independent network egress. Each environment should bind to its own egress, and the egress region should match the environment's geographic parameters. This is easy to overlook, but it is a prerequisite for isolation as a whole.

The third is queryable status. You should always be able to tell which environments are running, which are idle, and which are abnormal. Agents run unattended; if their environment status cannot be queried, troubleshooting becomes guesswork.

These three capabilities are awkward to implement inside scripts. They require environment-level storage, configuration, and scheduling. Some multi-environment management tools operate at exactly this layer. PurpleMark is one of them, turning browser environments into resources that can be isolated, scheduled in batches, and invoked through interfaces.

When multiple environments are unnecessary

If an Agent uses only one account and runs infrequently, a normal browser is genuinely enough, and extra isolation only adds maintenance overhead. But the environment layer should be separated as soon as any of the following applies: tasks must run in parallel, multiple identities need to access the same platform, login state must be maintained over long periods, or concurrency is expected to keep growing.

These cases have the same thing in common: the question is not whether the Agent is smart enough, but whether the environment under it is clean enough.

Boundaries

Whichever architecture you choose, the rule-level boundaries do not change: comply with each platform's terms of service and robots rules, do not use false identity information, do not bypass technical protection measures, control request frequency, and do not disrupt the normal operation of the other party's services.