Observe
Watch your agent work, debug what went wrong
Browser agents fail in ways that don't show up in logs. Kernel gives you several ways to see what's actually happening: live, after the fact, frame by frame, line by line, and event by event.
Live view
Every browser exposes a browser_live_view_url you can open in a browser tab or embed in an iframe. Use it to watch an agent run in real time, hand a session off to a human-in-the-loop, or surface the browser as part of your own UI.
import Kernel from '@onkernel/sdk';
const kernel = new Kernel();
const kernelBrowser = await kernel.browsers.create();
console.log(kernelBrowser.browser_live_view_url);Add ?readOnly=true for a non-interactive view, or enable kiosk mode at creation for a fullscreen, cinematic experience. Full reference: Live View.
Replays
Replays are MP4 recordings you start and stop on demand - capture as many clips per session as you need. They're the right tool for post-hoc debugging: a failed run gives you one or more videos to scrub through, share, or attach to a bug report.
Replays can also be enabled on managed auth sessions, so you can debug failed logins the same way.
const replay = await kernel.browsers.replays.start(kernelBrowser.session_id);
// ...run the agent...
await kernel.browsers.replays.stop(replay.replay_id, {
id: kernelBrowser.session_id,
});Full reference: Replays.
Screenshots
Pull a frame at any moment with computer controls - useful for snapshotting state at decision points, attaching to traces, or feeding back into a vision model.
const screenshot = await kernel.browsers.computer.captureScreenshot(
kernelBrowser.session_id,
);For full-page captures, use Playwright execution instead.
Invocation logs
If you're running an agent on Kernel's app platform, every invocation produces a streaming log feed. Tail it live while the agent runs, or pull it after the fact for debugging.
const logs = await kernel.invocations.follow(invocationId);
for await (const event of logs) {
console.log(event);
}Full reference: Logs.
Telemetry
Telemetry is a real-time, structured stream of what happens inside a session: console output, network activity, page lifecycle, interactions, and operational signals like crashes. Unlike a video or screenshot, it's machine-readable, so it's the right tool for feeding session activity into your own observability pipeline or reacting to events programmatically. Enable it at creation, then stream the events:
const browser = await kernel.browsers.create({ telemetry: { enabled: true } });
const stream = await kernel.browsers.telemetry.stream(browser.session_id);
for await (const { seq, event } of stream) {
console.log(`#${seq} [${event.category}] ${event.type}`);
}Full reference: Telemetry.
Picking the right tool
- Building the agent? Keep a live view tab open while you iterate.
- Debugging a failure? Capture a replay for the run, then watch the video.
- Instrumenting the agent itself? Drop screenshots and logs into your traces at the points that matter.
- Feeding an observability pipeline? Stream telemetry events and route them wherever you collect signals.
- Putting a human in the loop? Embed the live view in your own UI.