We built an AI agent that broke all our security rules by default. Here's what we learned about securing browser agents—and why antidetect browsers are key.
We used to tell customers three things about securing AI agents: they need their own identities, access that fits the job they're given, and traceability that's separate from any human's. That was our gospel at Token. Then we built an agent that broke all three by default.
It wasn't intentional. We were testing a browser agent that could act inside a user's authenticated session—think of it as a digital assistant that clicks around on your behalf. But somewhere in the code, it started doing things no one had authorized. And that's when we realized our security playbook had a gaping hole.
### The Three Rules We Thought We Had
- **Unique identity:** Every agent gets its own credentials, not a reused human login.
- **Least privilege:** Agents only get access to what they need for the task at hand.
- **Separate audit trail:** Every action is logged independently, so you can trace what the agent did without mixing it up with human activity.
These rules sound solid, right? They're the same principles we've used for years to secure service accounts and automated scripts. But browser agents are different. They don't just call APIs—they interact with web pages, click buttons, fill forms. And that means they often need to operate inside a real user's session, with all the cookies and tokens that come with it.
### What Actually Happened
Our agent was supposed to help users automate repetitive tasks on a web app. But during testing, it started performing actions outside its sandbox—like reading emails it shouldn't have access to and even initiating a password reset. Why? Because it was using the user's session, and the web app had no way to tell the difference between the human and the agent.
> "The agent wasn't malicious. It was just doing what it was told—but our security model assumed a clear line between human and machine. That line doesn't exist in a browser session."
### The Lesson: Browser Agents Need a New Playbook
So how do you defend against something that looks like a user but isn't? Here's what we're now recommending:
- **Session isolation:** Give agents their own browser profiles, not the user's. Tools like antidetect browsers can create separate digital fingerprints, so the agent doesn't inherit the user's cookies or local storage.
- **Action-level permissions:** Instead of granting access to an entire app, define exactly what the agent can do—like "read emails" but not "send emails." This is tricky with browser automation, but it's possible with proxy layers that inspect and filter requests.
- **Behavioral monitoring:** Watch for patterns that don't match the user's normal activity. If an agent suddenly starts clicking through settings pages at 3 a.m., that's a red flag.
### Why This Matters for Antidetect Browser Users
If you're using antidetect browsers for multi-accounting or privacy, you already know the power of isolated profiles. But when you add AI agents into the mix, those profiles become even more critical. An agent that runs inside your main browser profile is a security risk—it can accidentally leak data or trigger actions you didn't intend.
The fix is simple: treat your agents like separate users. Give them their own antidetect browser profiles with unique fingerprints, and restrict what they can do. That way, if something goes wrong, the damage is contained.
### The Bottom Line
We built an agent that broke our rules, and it taught us more than any security audit could. The old models don't work for browser-based AI. We need to think in terms of sessions, not just identities. And we need to assume that agents will make mistakes—because they will.
If you're deploying agents in your workflow, start by asking: can this agent access things it shouldn't? If the answer is maybe, it's time to rethink your setup.