Recorded browser flows
actions/flows uses Playwright to follow plain-language flows against a seeded copy of your app. Your caller owns the Linux runner and gates the job with a PR label and same-repository check. By default, the action starts the app itself in a container from your trusted digest-pinned image. With target: preview, it tests a trusted preview deployment instead. The action does not provision a hosted sandbox, and the caller owns the runner. The flows_plan, flows_driver, and flows_diagnosis roles use provider and model settings from .github/codehawk.json on the default branch. The legacy inference document remains optional for one release.
Follow the preview deployment guide for apps that already deploy PR previews. Use the container setup guide to build pinned images and run flows without a preview deployment.
Runner, image, and storage setup
Section titled “Runner, image, and storage setup”- Use a Linux runner with Docker and Node 24. Pin
@playwright/testin the caller to the version of its Playwright container. The default pair is1.63.0andmcr.microsoft.com/playwright:v1.63.0-noble. - Build an application image in a separate job that has no inference credentials, and publish it pinned by digest, such as
registry.example.com/shop@sha256:followed by its 64-character lowercase digest. Its startup command, given as a JSON argv array, must seed a throwaway database with the test users and serve the app onhttp://localhost:3000. It must use test-only credentials. - Create a private S3-compatible bucket for the recordings, such as R2. Create a bucket-scoped key that can PUT and GET objects. Scope the key to that bucket, leave public access disabled, and set a lifecycle rule to delete recordings after 30 days. Provide its API endpoint (not a public website URL), bucket name, and keys using the repository settings. For R2 keep the default region
auto. For S3 supply the bucket region. - Install the CodeHawk App and add the default-branch settings and provider keys, the flow library below, and a label such as
hawk-browser-flows.
For an npm-based caller, add @playwright/test at exactly 1.63.0 to devDependencies and commit the lockfile. The browser container loads Playwright from the caller's own node_modules, installed without secrets as in the caller below.
Application isolation
Section titled “Application isolation”Every repository-controlled install, application startup, setup step, test, and module load runs in a secret-free container with a private PID namespace. Never start repository code on the host, or leave an earlier host process running into the step that holds credentials. Step-scoped secrets alone do not protect the coordinator from a same-user host process.
In container mode, the action refuses missing, malformed, or unpinned application settings before it reads repository files or makes requests, including in local runs. There is no host application fallback. application-command is a JSON array of 1 to 64 nonempty strings, passed directly without a shell. application-env lists safe variable names for the app, separately from setup-env. Application settings come only from the trusted caller, never from the flows file or repository config. Application and setup environment values shorter than eight characters and bare HTTP or HTTPS origins without credentials stay visible in flow evidence.
Application, browser, and setup containers may use host networking, but never host PID, the Docker socket, or another proc mount that exposes the coordinator. They receive no inference document, credential slots, App token, or S3 credentials. The coordinator keeps model calls, posting, and uploads. The browser bridge allows only fixed flow operations, not evaluation, imports, or arbitrary commands. The coordinator removes its named containers on failure and when it closes.
The caller's application stdout and stderr are attached to the flow evidence, and only the current flow's output is included. The action does not read host logs, journal output, caller log paths, or caller log commands. Text evidence keeps bounded browser errors, relevant failed requests and HTTP errors, application output, and browser steps. Application logs are redacted for known secret values before they reach a report. Missing application logs are recorded as not provided. Exact raw, URL-encoded, form-encoded, and JSON string forms of configured secrets are filtered. The configured application base URL, its host, and its port remain visible because they are not secrets. Other configured URLs with credentials, a path, or a query are redacted. A real secret in the same URL is replaced with the literal [REDACTED] marker. Hashes, base64, and other transformations cannot be discovered reliably and must not be written by the application.
Flow library
Section titled “Flow library”Save as .github/codehawk-flows.json. This example uses fictional credentials for a local fixture. Seed the same fixture or use your own throwaway user. Never put a real account or shared environment secret here.
{ "about": "Example app with an overview page.", "sign_in": { "path": "/sign-in", "email_label": "Email", "password_label": "Password", "submit": "Sign in", "code_label": "Six-digit code", "signed_in_path": "/app" }, "users": { "owner": { "email": "owner@example.test", "password": "fixture-only-password", "totp_secret": "fixture-only-totp-seed", "totp_encoding": "text", "about": "Seeded owner in the throwaway database" } }, "flows": [ { "name": "Open Overview", "user": "owner", "start": "/app", "steps": ["Check that the page shows the Overview heading."] } ]}The driver fills login fields directly and computes the authenticator code locally. totp_encoding is text (default) or base32. Each flow takes up to 12 written steps. Optional setup steps use an allowlist of caller scripts.
Browser caller
Section titled “Browser caller”Save as .github/workflows/browser-flows.yml in an npm-based app that satisfies the setup steps above. The same-repository condition is important because the workflow runs the proposed app. Restrict who can run the job according to your repository's review process.
The example installs the caller's dependencies in a throwaway container with no secrets, so no repository-controlled install script runs on the host. Its pinned checkout keeps persist-credentials: false, so repository code cannot read a saved workflow token from Git configuration. Replace <release sha> with the release tag's commit you pin, and set CODEHAWK_APPLICATION_IMAGE to your approved digest-pinned image.
name: Code Hawk browser flowson: pull_request: types: [labeled, synchronize, reopened]permissions: {}concurrency: group: codehawk-browser-${{ github.event.pull_request.number }} cancel-in-progress: truejobs: flows: permissions: contents: read pull-requests: read id-token: write uses: bts-io/codehawk/.github/workflows/browser-flows.yml@<release sha> with: application_image: ${{ vars.CODEHAWK_APPLICATION_IMAGE }} application_command: '["npm","run","e2e:serve"]' application_env: DATABASE_URL base_url: http://localhost:3000 s3_endpoint: ${{ vars.CODEHAWK_S3_ENDPOINT }} s3_bucket: ${{ vars.CODEHAWK_S3_BUCKET }} s3_region: ${{ vars.CODEHAWK_S3_REGION || 'auto' }} secrets: CODEHAWK_OPENAI_API_KEY: ${{ secrets.CODEHAWK_OPENAI_API_KEY }} CODEHAWK_ANTHROPIC_API_KEY: ${{ secrets.CODEHAWK_ANTHROPIC_API_KEY }} CODEHAWK_GOOGLE_API_KEY: ${{ secrets.CODEHAWK_GOOGLE_API_KEY }} CODEHAWK_GATEWAY_TOKEN: ${{ secrets.CODEHAWK_GATEWAY_TOKEN }} CODEHAWK_CREDENTIAL_1: ${{ secrets.CODEHAWK_CREDENTIAL_1 }} CODEHAWK_CREDENTIAL_2: ${{ secrets.CODEHAWK_CREDENTIAL_2 }} CODEHAWK_CREDENTIAL_3: ${{ secrets.CODEHAWK_CREDENTIAL_3 }} CODEHAWK_CREDENTIAL_4: ${{ secrets.CODEHAWK_CREDENTIAL_4 }} CODEHAWK_CREDENTIAL_5: ${{ secrets.CODEHAWK_CREDENTIAL_5 }} CODEHAWK_CREDENTIAL_6: ${{ secrets.CODEHAWK_CREDENTIAL_6 }} CODEHAWK_CREDENTIAL_7: ${{ secrets.CODEHAWK_CREDENTIAL_7 }} CODEHAWK_CREDENTIAL_8: ${{ secrets.CODEHAWK_CREDENTIAL_8 }} CODEHAWK_S3_ACCESS_KEY_ID: ${{ secrets.CODEHAWK_S3_ACCESS_KEY_ID }} CODEHAWK_S3_SECRET_ACCESS_KEY: ${{ secrets.CODEHAWK_S3_SECRET_ACCESS_KEY }} CODEHAWK_APPLICATION_ENV: ${{ secrets.CODEHAWK_APPLICATION_ENV }}If the app needs settings such as DATABASE_URL, list their names in application_env and supply a JSON object of name to string value as the CODEHAWK_APPLICATION_ENV secret. They must point at the throwaway database.
Preview deployments
Section titled “Preview deployments”Use the preview deployment guide to run flows against your PR deployment.
Results
Section titled “Results”The planner (flows_plan) reads the PR's changed files and short patches, capped at 24,000 characters, and the flow library. Library flows that cover the change run with their original start, steps, and expectations. The planner may add new flows, but it cannot replace or rewrite a library flow. Every model-written addition has (planned) in its name so it stays distinct from the fixed library checks. If planning fails, the configured library runs. The driver (flows_driver) works from the written steps and the page's accessibility snapshot, with up to 25 actions per flow. The flows_diagnosis role links captured failed-flow evidence to supported added lines. Omitted roles inherit the top-level settings route, or the legacy inference document's default profile when supplied. The caps.flows setting covers the planner, driver and diagnosis calls in one run. Spend is uncapped unless a cap is set.
Each result is Pass, Application failure, or Environment blocker. The observed facts section reports browser steps, console errors, relevant network failures, application output, media, and where the flow stopped. The Diagnosis section is omitted when every flow passes. It links an application failure to added lines only when captured runtime evidence supports that link. Otherwise it says Inconclusive: the captured runtime evidence does not support a link to changed code. A run with only environment blockers keeps the line explaining that diagnosis was not run. Environment blockers are not product findings and do not make a diagnosis call. The job returns a failure if any flow did not pass. One PR comment is updated in place with the results, spend, facts, and diagnosis. Recordings are kept in a private bucket and deleted after 30 days, and read links expire after seven days. Anyone with a read link can access the recording until expiry.
The local run writes recordings and results to disk without posting or uploading.
Install the CodeHawk App for hosted tokens. To use your own App instead, set the reusable workflow input app_id and forward the named secret CODEHAWK_PRIVATE_KEY as described under self-hosted App.
The run job has no OIDC or App token and uploads recordings with its S3 credentials. It writes a one-day report artifact. A separate report job has no checkout, application settings or S3 secrets and only posts that report with the App token.
The reusable workflow maps application_image and application_command to the action inputs application-image and application-command.