Security requirements
What you can expect:- Local analysis. Scans read and parse files on your machine or CI runner. Source code, project paths and lockfiles are not uploaded.
- Network only when you ask for it. A scan makes no network request unless you opt in:
--onlinesends pinned package names, ecosystems and versions to OSV, or toLOADWISE_OSV_URL, which must be an HTTPS origin or a loopback HTTP origin (lib/security/deps/osv.ts).- Crash reporting (
--report-crashes,LOADWISE_CRASH_REPORTS=1orLOADWISE_SENTRY_DSN) sends a sanitized report without exception messages, source or project paths (lib/shared/system/sentry.ts). - Separate commands that you run by name also use the network:
loadwise perf dbconnects to the database named in your environment, andloadwise editor setupdownloads the editor package from GitHub Releases and checks its SHA-256 digest and size against the release metadata (lib/editor/release-vsix.ts).
- Scans do not execute the scanned project. The checkers parse files with the TypeScript compiler API,
@astrojs/compiler,libpg-query,yamland the bundled@ast-grep/clibinary with Loadwise’s own rules. They do not run the project’s scripts, tests or build. Config files are read as JSON or JSONC, and rule packs are versioned JSON data. These documented exceptions load code from the project’s ownnode_modules:loadwise fix, when it writes edits, formats them with the project’s installed Prettier, which also resolves the project’s Prettier config. Biome is used only withLOADWISE_ALLOW_BIOME=1, and only from a binary inside the project root (lib/shared/fix/fix-presentation.ts,fix-presentation-biome.ts).--no-formatturns formatting off.loadwise perf dbloads the project’spg,mysql2,mongodbormongoosedriver (lib/performance/db/drivers.ts).
- Writes only on request.
loadwise fixpreviews by default. It writes only with an edit mode (--apply/--yes,--id,--all, or approval in--interactive), and every write to a project file stays inside the project root (lib/shared/fix/project-file-access.ts). The fix history thatloadwise fixrecords for undo is written outside the project, under the user’s state directory (LOCALAPPDATAorXDG_STATE_HOME), bylib/shared/fix/fix-history.ts. - Another local user cannot plant a cached result. On POSIX systems, a cache directory or entry that another user owns or could write is ignored (see below). On Windows, where file stats carry no owner or permission bits, the cache is used only when its resolved folder lies inside the user’s profile or
LOCALAPPDATAand no folder on the path is a junction or symbolic link. Any otherLOADWISE_SCAN_CACHE_ROOTturns the cache off for that run, with a note.
Threat model and trust boundaries
The user running Loadwise, the Loadwise package as installed, and the project’s own installed tools (point 3) are trusted.
Secure design principles applied
- Least privilege. Every workflow sets top-level
permissions(mostcontents: read, Scorecardread-all) and raises them per job only where needed, for exampleid-token: writeonly in the npm stage and GitHub release jobs of.github/workflows/release.yml. Checkouts usepersist-credentials: false. - Fail-safe defaults. Network features are off by default,
fixpreviews by default, and an untrusted cache is bypassed rather than used. - Complete mediation of writes. All
--fixwrites to project files go throughproject-file-access.ts, which checks every path against the project root after resolving links and writes atomically. The check and the write are separate path operations, so they do not stop another local process that swaps a folder in the project between them. - Separation. Checkers run in child processes (
lib/shared/reporting/pillars.ts) with bounded output (maxOutputBytes). When several source checkers are selected they share one child, so a failure there fails all of them. - Economy of mechanism. One glob dialect (
lib/shared/system/glob.ts) and one JSONC reader (lib/shared/system/jsonc-config.ts) serve all config parsing. - Separation of duty in releases. The workflow can only stage an npm publish; a maintainer approves it on npmjs.com with 2FA.
Common weaknesses and how they are countered
Property-based fuzz tests with
fast-check in test/shared/fuzz-properties.test.ts cover the JSONC comment masking and check that parseConfigFile rejects arbitrary config text only with a plain Error.
Supply-chain controls
- Pinned actions. Every third-party action in
.github/workflows/andaction.ymlis pinned to a full commit SHA. Dependabot updates npm, Cargo and GitHub Actions dependencies weekly (.github/dependabot.yml). - npm provenance, no stored token.
release.ymlpublishes with npm Trusted Publishing through GitHub OIDC andnpm stage publish --provenance, after checking the tarball’s SHA-256 against the verified build. The version goes live only after maintainer approval with 2FA. - Signed release assets. The editor packages get Sigstore-signed SLSA build provenance (
actions/attest-build-provenance), attached asloadwise-<version>.sigstore.jsonand.intoto.jsonl. Release signatures shows how to verify them. - Release gates. A tag publishes only from a commit on
mainwhosecheck,codeqlandscorecardruns passed (main-ci-greenjob). The release tags ruleset blocks moving or deletingv*.*.*tags. - CodeQL.
.github/workflows/codeql.ymlanalyzes JavaScript/TypeScript and GitHub Actions on pushes tomain, pull requests and weekly. Themainruleset blocks merges with CodeQL errors or high-severity security alerts. - OpenSSF Scorecard.
.github/workflows/scorecard.ymlruns onmainand weekly and publishes results. - Required CI.
mainrequires theCI passedcheck from.github/workflows/check.yml, which runs format, lint and the Linux test suite on every pull request. Every push tomainalso runs the Windows, Node 22 and macOS tests. On a pull request, Windows and Node 22 run when CI, packaging or platform-sensitive files change or with thefull-cilabel, macOS runs only with thefull-cilabel, and the package smoke test runs when packaging inputs change.CI passedaccepts a scoped-out job as skipped and fails on any other result.