Agent Browser
Some work needs a real browser. Examples are a login to a vendor portal, form entry, clicks in client-rendered UI, and pages that web_fetch and web_search cannot reach.
Nakama agent-browser keeps you in the same chat or automation. The agent drives an interactive browser on the server through the bash tool.
How the system works:
- The user talks to Nakama
- Nakama matches the opt-in
agent-browserskill when the task needs interaction or a login - The agent runs agent-browser CLI commands through
bash - Snapshots return a compact accessibility tree with short refs like
@e2 - This tree uses fewer tokens than raw HTML
- The agent clicks and fills fields by those refs. Then the agent closes the browser when the task ends
The product has no dedicated browser builtin. The workflow is bash + the agent-browser skill + the host CLI and Chrome.
Why use agent-browser
| Need | Prefer |
|---|---|
| Public page text / Markdown | web_fetch |
| JS-heavy public page (no login) | Firecrawl scrape, when the profile has the preinstalled firecrawl MCP server |
| Discover sources on the open web | web_search |
| Login walls, forms, clicks, client-rendered UI | agent-browser skill + bash |
Use agent-browser when the site has no usable API. The agent must act like a person in a browser. One example is an order status check on an e-commerce portal after a login.
How the pieces fit together
| Piece | Role |
|---|---|
agent-browser skill | Opt-in bundled skill. The skill teaches when and how to drive the CLI |
bash tool | Runs agent-browser commands in the profile workspace |
| Agent settings | Assign the skill. Install the CLI and Chrome on the server. Add bash when needed |
| Host CLI + Chrome | Install through the dashboard Install button or manually on the Nakama server |
| CloakBrowser (optional) | Host env AGENT_BROWSER_EXECUTABLE_PATH / AGENT_BROWSER_ARGS. Not in the Docker image |
User message (interactive task or login wall)
→ Nakama agent loads agent-browser with load_skill
→ Nakama agent calls bash with agent-browser commands
→ Same daemon session for open → snapshot → click/fill in that run
→ agent-browser close
→ Nakama agent summarizes the resultSetup
1. Assign the skill from the agent settings
Platform admins:
- Open Agent and select the profile.
- In Skills, open the skill picker. Find
agent-browser. - If the skill is blocked, use the buttons in that row or banner:
- Install — installs the
agent-browserCLI and Chrome on this Nakama server - Add bash — assigns the
bashtool to the profile. Super Nakama usually has bash already.
- Install — installs the
- Assign the
agent-browserskill after install and bash are ready.
The skill is opt-in. Nakama does not auto-assign it to Super Nakama or default profiles. The profile needs bash and the skill. The skill alone cannot open a browser.
2. Manual CLI install (optional)
If the dashboard Install button is not available or fails, install on the host where the Nakama bash tool runs:
Install checks the release hash before installing; this manual command does not.
npm install -g agent-browser
agent-browser installOn Linux, if Chrome libraries are missing:
agent-browser install --with-depsThen open the selected agent's Skills section. Assign the skill. Use Add bash if needed.
3. Optional: CloakBrowser for antibot sites
Stock Chrome from agent-browser install is enough for most portals. Some login-walled sites block that Chrome. CloakBrowser is a patched Chromium you can point agent-browser at on the Nakama host. Nakama does not ship Cloak and does not make it the default.
- Install Cloak on the same machine that runs
bash(not inside the agent chat):
pip install cloakbrowser
python -m cloakbrowser install
python -m cloakbrowser infoNode installs work the same way: npx cloakbrowser install then npx cloakbrowser info.
- Set host environment variables for the Nakama process.
bashinheritsprocess.env, so agent-browser picks these up without a Nakama setting:
export AGENT_BROWSER_EXECUTABLE_PATH="/path/from/cloakbrowser/info"
export AGENT_BROWSER_ARGS="<copy from Cloak's agent-browser example>"The stealth argument list lives in Cloak's agent-browser integration. Copy it. Do not invent flags.
- Restart Nakama so the process sees the new env. Leave both variables unset to keep stock Chrome.
Docker: the official image does not include Cloak. Bind-mount the Cloak binary into the container and pass the same env vars, or run Nakama on the host. See Docker.
4. Want to sign in yourself and watch the browser?
Use the Cloud browser instead. It runs each user's browser on Kernel, shows it live in the chat, and keeps your logins for later chats. It does not need bash, this skill, or Chrome on the server.
5. Try it in chat
Ask the profile for a task that needs a real browser. Example:
Open our vendor portal, log in with the credentials I provide, and tell me the status of the latest order.
Or force the skill:
/skill agent-browser Check https://example.com and summarize the main headingThe same path works in automations. The automation profile needs bash and the skill. The host CLI must be installed.
How a typical run works
In one chat turn or automation run:
- Open a URL. Or launch the browser, then go to the URL.
- Snapshot the page (
snapshot -i) to get element refs (@e1,@e2, …). - Act — do
click,fill, andpress. Wait when needed. Use those refs. Take a new snapshot after large UI changes. - Screenshot (optional) under the profile workspace
artifacts/directory. - Close the browser when the task ends.
With local Chrome, sessions are fresh across runs. The product does not keep sticky cookies or a restored login state. The agent logs in again in the run when the task needs it. To keep logins between runs, use the Cloud browser.
Credentials and safety
- Use credentials that the user supplies in the prompt. You can also use credentials that are already known for that task.
- Do not expect Nakama to store site passwords for agent-browser in v1.
- Agents must not echo passwords in summaries. Agents must not take screenshots of password fields.
Troubleshooting
| Symptom | What to examine |
|---|---|
| Agent never opens a browser | Is agent-browser assigned? Does the message look like interactive work or a login wall? Try /skill agent-browser … |
command not found / ENOENT | Use Install in the selected agent's Skills picker, or install manually (npm install -g agent-browser && agent-browser install) |
| Skill assigned but nothing runs | The profile also needs bash. Use Add bash in the skill picker if the UI shows the prompt |
| Clicks miss or fail after navigation | The agent must take a fresh snapshot before it uses refs again |
| Daemon seems stuck | Ask the agent to run agent-browser close or agent-browser close --all. Or run agent-browser doctor |
| Site still blocks the browser | Stock Chrome may be fingerprinting as automation. Install Cloak on the host and set AGENT_BROWSER_EXECUTABLE_PATH / AGENT_BROWSER_ARGS as in Optional: CloakBrowser |
| Cloak set but Chrome for Testing still launches | Confirm the env is on the Nakama process, then restart. bash inherits host env; a one-off shell on your laptop does not change the server |
Next steps
- Skills — bundled skills catalog and assignment
- Tool reference —
bashparameters and availability - Coding agent — similar bash and skill pattern for repo coding work
- agent-browser — upstream CLI reference