agentskit.js
ToolsIntegrations

browserAgent

Puppeteer-backed browser — goto, click, fill, read, screenshot, wait. For agents that need to interact with JS-rendered pages.

import { browserAgent } from '@agentskit/tools'
import puppeteer from 'puppeteer'

const browser = await puppeteer.launch({ headless: 'new' })
const page = await browser.newPage()

const runtime = createRuntime({
  adapter,
  tools: [...browserAgent({ page })],
})

Sub-tools

NamePurpose
browserGotoNavigate to a URL
browserClickClick a selector
browserFillType into an input
browserReadExtract visible text from the page
browserScreenshotCapture PNG buffer
browserWaitWait for selector or timeout

Bundled: browserAgent(config).

Config

type BrowserAgentConfig = {
  page: BrowserPage         // Puppeteer Page (or any matching shape)
  timeoutMs?: number
  screenshotPath?: string
}

Example — site QA agent

const runtime = createRuntime({
  adapter,
  systemPrompt: 'Click through the signup flow and screenshot each step. Report errors.',
  tools: [...browserAgent({ page })],
})

Safety

Headless browsers are powerful — wrap in mandatory sandbox to restrict allowed domains and block credentials leaks.

Alternatives

  • firecrawl — prefer when you only need static content extraction.
  • reader — single-URL, no interaction.
  • fetchUrl — no JS rendering, no cost.
✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page