Skip to main content

steplight-sdk (Python)

Not related to the PyPI package steplight; if you have it installed, both use the steplight import name.

A flight recorder for AI agents that drive a browser. This package records Playwright (async and sync) and Browser Use runs into the Steplight run format, so the steplight CLI (view, replay, diff, check, report) and the GitHub Action work on them unchanged. Everything is redacted before it is written and nothing leaves your machine: no telemetry, no accounts, no network calls of its own.

  • No required dependencies. The recorder, the redaction engine and the run writer use the standard library. Extras: playwright, browser-use, otel, crypto.
  • Python 3.10 – 3.13, Linux, macOS and Windows. Typed (py.typed).
  • Fails open for your agent: a recorder error goes to stderr and the agent keeps running. Fails closed for privacy: if redaction fails, the data is dropped.
pip install "steplight-sdk[playwright]"        # or steplight-sdk[browser-use], steplight-sdk[otel], steplight-sdk[crypto]
npm i -D steplight                         # the CLI that flags, views and checks the runs

Python records; the Node CLI analyzes. A run is written with the redacted material the detectors need, and steplight analyze (run automatically by view, check, diff, report and export, or call steplight.analyze(...)) produces the flags with the same detectors as the TypeScript SDK.

1. Playwright, async

import asyncio
import steplight
from playwright.async_api import async_playwright


async def main() -> None:
    async with async_playwright() as pw:
        browser = await pw.chromium.launch()
        page = await browser.new_page()
        async with await steplight.record(page, task="Book the cheapest flight") as run:
            await page.goto("https://airline.example/flights")
            run.note("Comparing fares")  # optional: your agent's reasoning
            await page.click("text=Select Economy")
        await browser.close()


asyncio.run(main())

2. Playwright, sync

import steplight
from playwright.sync_api import sync_playwright

with sync_playwright() as pw:
    page = pw.chromium.launch().new_page()
    with steplight.recording_sync(page, task="Book the cheapest flight") as run:
        page.goto("https://airline.example/flights")
        page.click("text=Select Economy")

The run ends as success, or as failed if the block raises (the exception is re-raised untouched).

3. Browser Use

import asyncio
from browser_use import Agent, ChatOpenAI
from steplight.integrations import browser_use as steplight_bu


async def main() -> None:
    agent = Agent(task="Find the cheapest flight to Lisbon", llm=ChatOpenAI(model="gpt-4.1"))
    async with steplight_bu.recording(agent) as run:
        await agent.run()


asyncio.run(main())

Every model step is recorded as an agent_note (the model's goal, chosen actions and reasoning), and the browser steps it chose are linked back to that note (decidedBy), so the viewer shows why the agent did each thing. Typed text is never stored (only <N chars>). Tested with Browser Use 0.7 – 0.13 (Python 3.11+); older versions are not supported.

Then use the CLI

npx steplight view                                          # timeline, replay, hidden text highlighted
npx steplight check --latest --rules steplight.rules.yml    # CI: exit 1 when the rules are broken
npx steplight diff <runA> <runB>                            # first point of divergence

Options

record(page, task, *, dir, capture_level, meta, otel, encrypt, encryption_key, passphrase)

Option Meaning
dir Runs folder (default $STEPLIGHT_DIR or .steplight/runs). Created 0700, files 0600 on POSIX.
capture_level "minimal", "standard" (default) or "full": what is written to disk. Detectors always see everything first.
encrypt, encryption_key, passphrase AES-256-GCM at rest (needs steplight-sdk[crypto]). Byte-compatible with the Node CLI, which reads these runs given the same key or passphrase (STEPLIGHT_ENCRYPTION_KEY / STEPLIGHT_PASSPHRASE).
otel Export OpenTelemetry spans on end() (needs steplight-sdk[otel]); on by default only when OTEL_EXPORTER_OTLP_ENDPOINT is set.
meta Extra string metadata stored on the run.

Organisation policy (STEPLIGHT_POLICY_FILE, steplight.config.json, STEPLIGHT_* variables: capture-level cap, site deny/allow lists, required encryption…) works as in the Node SDK and can only tighten settings; if a policy cannot be honoured nothing is recorded and the agent keeps running (run.recording is False).

For failures the recorder cannot see (for example locator.click()), call run.report_error(err, "#selector").

Full guide, CI usage, privacy notes and known gaps: docs/python.md. License: Apache-2.0.

Metadata

Release files for steplight-sdk 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for steplight-sdk 0.2.0
File Size Uploaded Provenance
steplight_sdk-0.2.0.tar.gz 51.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for steplight-sdk 0.2.0
File Interpreter ABI Platform
steplight_sdk-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 112.6 kB

Release files / steplight_sdk-0.2.0.tar.gz

Download URL steplight_sdk-0.2.0.tar.gz
Size 51.9 kB
Tags Source
SHA-256 checksum
How to use checksums
336bc49bed467ffc6286d4b1357d0a01a0f5341246a3106a37d1c38a30f175ae
BLAKE2b-256 checksum
How to use checksums
a53735878766e407cc26ba0540d9df62cd307ae2d15420402d2e553acde4c7ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / steplight_sdk-0.2.0-py3-none-any.whl

Download URL steplight_sdk-0.2.0-py3-none-any.whl
Size 60.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d61553d5a8664282ed3c14115e398ec933c4bedb0893adedc10940a7ba78f006
BLAKE2b-256 checksum
How to use checksums
08fa8a1bcada0038c0dfb4ca21eafb29bae5d8cdce4a69ff0a5f2e1da2755c0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for steplight-sdk 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for steplight_sdk-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page