Overview
A trace holds everything an agent did in a session: what it was asked, the commands it ran, the files it changed, what it spent, and what the threat rules flagged. The full event list shows all of it at once. A lens shows one trace from one angle: every file the agent changed with its diffs, or the run as an itemized bill. Lenses are tabs on a session’s page in the local dashboard (beacon endpoint dashboard), next to Full session. Click + to
add one; the dashboard remembers which lenses you opened and keeps the selected one in the
page URL, so a link opens straight to it.
Beacon ships seven lenses, and you can add your own. A lens is one HTML file, so any coding
agent can write one.
Built-in lenses
How a lens runs
A lens is code looking at sensitive data, so the dashboard runs it on a short leash:- No ordinary network. The lens runs in a sandboxed frame under a Content Security
Policy with
connect-src 'none'. It cannot fetch, open a socket, load a remote image or font, or navigate its frame anywhere else. A lens that tries to navigate is closed. - No dashboard access. The frame has an opaque origin. It cannot read the dashboard’s pages, storage or API.
- One delivery of data. The trace arrives once, through
window.beacon.getTrace(), over a private message channel. It is computed from the local log when the page loads and is never refreshed. - Failure is contained. If a lens throws before it renders, never asks for its trace, or has not rendered after ten seconds, the dashboard closes it and shows the full session with a notice.
beacon token-usage counts it. A lens
sees whatever content the local log retained, after Beacon’s redaction: prompts, command
output and diffs when retention is full.
Forwarding privacy modes control what Beacon sends off the
machine; they do not reduce what a local lens receives.
What the sandbox does not guarantee
The sandbox keeps a lens away from Beacon and the dashboard and blocks the ordinary network APIs, but it cannot fully prevent a lens from sending the trace data it is shown out of the machine. Some browser features are not governed by a Content Security Policy or any other control a page can set: WebRTC, and resource hints and speculative loading such aspreconnect and speculation rules. The dashboard removes WebRTC from the lens and refuses
nested frames, <link> elements and speculation rules before any lens code runs. That is
best-effort hardening that closes the common paths, not a boundary: a determined lens may
find another.
So an installed lens is code you trust with the trace data it is shown. The built-in lenses
ship with Beacon. Read any other lens before you install it, and install only lenses you
trust; beacon lenses add asks you to confirm that.
Make your own lens
The fastest way is to ask your coding agent. Thebeacon-lens-create skill in Beacon’s
Agent Skills plugin walks it through the whole loop. Without the
skill, give it this:
- Read the spec. It defines the manifest every lens carries, the data, the sandbox and the style tokens that match the dashboard.
- Look at real data. Design for the fields your sessions actually carry, and for sessions that lack them.
- Lint. Errors stop a lens from running. Warnings name the line where the lens does
something the sandbox will block, such as
fetch,innerHTMLor a script loaded from a CDN. - Preview.
beacon lenses previewserves the dashboard with the file added and prints the session page to open. The file is read again on every reload. - Install.
beacon lenses addasks you to confirm that you trust the lens, then copies the file into the lens store (~/.beacon/endpoint/lenses), where every session page offers it. To update a lens, bump theversionin its manifest and add it again.
beacon lenses for every command and flag, and the
lens specification
for the format.
What a lens file looks like
Limits
- A lens is one file of at most 16 MiB, with everything inline.
- A lens sees one trace. A view across several sessions is not supported yet.
- Lenses in the local dashboard are local. The store is per user on this machine; to share a local lens, share the file.
- Very large traces are cut to fit: the lens receives the longest prefix of events that fits, and the data says it was truncated.