Magnitude can be customized by passing in options when you start a browser agent:
await startBrowserAgent({
// Starting URL for agent
url: "https://google.com",
// Show thoughts and actions
narrate: true,
// LLM configuration
llm: {
provider: 'anthropic',
options: {
model: 'claude-sonnet-4-20250514',
apiKey: process.env.ANTHROPIC_API_KEY
}
},
// Any system instructions specific to your agent or website
prompt: 'Prefer mouse to keyboard when filling out form fields'
});
Only some LLMs are compatible with Magnitude - see
compatible LLMs for details.
Browser Options
Various browser options can also be passed, such as browser launch options or context options:
const agent = await startBrowserAgent({
url: "https://google.com",
browser: {
// Configured launched browser:
launchOptions: {
// chromium launch options, for example enabling CDP
args: ["--remote-debugging-port=9222"]
},
contextOptions: {
// see https://playwright.dev/docs/api/class-browser#browser-new-context
// for comprehensive list of options
viewport: {
width: 1280,
height: 720
}
}
}
});
See Playwright’s docs on Launch Options and Browser Context for more details on what can be configured.
You can also connect via CDP to an open CDP-enabled browser:
const agent = await startBrowserAgent({
url: "https://google.com",
browser: {
cdp: "http://localhost:9222"
}
});