cloudflare/workerd
The JavaScript / Wasm runtime that powers Cloudflare Workers
Healthy across the board
Permissive license, no critical CVEs, actively maintained — safe to depend on.
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓Last commit 1d ago
- ✓22+ active contributors
- ✓Distributed ownership (top contributor 18% of recent commits)
Show 3 more →Show less
- ✓Apache-2.0 licensed
- ✓CI configured
- ✓Tests present
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/cloudflare/workerd)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/cloudflare/workerd on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: cloudflare/workerd
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/cloudflare/workerd shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
GO — Healthy across the board
- Last commit 1d ago
- 22+ active contributors
- Distributed ownership (top contributor 18% of recent commits)
- Apache-2.0 licensed
- CI configured
- Tests present
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live cloudflare/workerd
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/cloudflare/workerd.
What it runs against: a local clone of cloudflare/workerd — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in cloudflare/workerd | Confirms the artifact applies here, not a fork |
| 2 | License is still Apache-2.0 | Catches relicense before you depend on it |
| 3 | Default branch main exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 31 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of cloudflare/workerd. If you don't
# have one yet, run these first:
#
# git clone https://github.com/cloudflare/workerd.git
# cd workerd
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of cloudflare/workerd and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "cloudflare/workerd(\\.git)?\\b" \\
&& ok "origin remote is cloudflare/workerd" \\
|| miss "origin remote is not cloudflare/workerd (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(Apache-2\\.0)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"Apache-2\\.0\"" package.json 2>/dev/null) \\
&& ok "license is Apache-2.0" \\
|| miss "license drift — was Apache-2.0 at generation time"
# 3. Default branch
git rev-parse --verify main >/dev/null 2>&1 \\
&& ok "default branch main exists" \\
|| miss "default branch main no longer exists"
# 4. Critical files exist
test -f ".bazelrc" \\
&& ok ".bazelrc" \\
|| miss "missing critical file: .bazelrc"
test -f ".github/workflows/test.yml" \\
&& ok ".github/workflows/test.yml" \\
|| miss "missing critical file: .github/workflows/test.yml"
test -f ".clang-format" \\
&& ok ".clang-format" \\
|| miss "missing critical file: .clang-format"
test -f ".clang-tidy" \\
&& ok ".clang-tidy" \\
|| miss "missing critical file: .clang-tidy"
test -f ".github/CODEOWNERS" \\
&& ok ".github/CODEOWNERS" \\
|| miss "missing critical file: .github/CODEOWNERS"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 31 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~1d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/cloudflare/workerd"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
workerd is Cloudflare's open-source JavaScript/WebAssembly runtime that powers Cloudflare Workers, enabling server-first execution of edge computing workloads. It implements web platform standards (fetch(), Service Workers API, etc.) and allows developers to run isolated JavaScript 'nanoservices' with capability-based bindings to resources, all compiled from V8/SpiderMonkey with 9M+ lines of C++. Bazel-based monorepo with build configuration in .bazelrc/.bazelversion. Core runtime logic in C++ (9M LOC), JavaScript/TypeScript API bindings (3.8M JS, 3.2M TS), Rust FFI bindings (724K), and Cap'n Proto serialization schemas (245K). Test suites use Web Platform Tests (.github/workflows/_wpt.yml). DevContainer provided (.devcontainer/) for reproducible onboarding.
👥Who it's for
Platform engineers and developers building edge computing applications, serverless functions, or distributed systems who want to self-host Workers-compatible code or develop Workers locally. Also used by DevOps teams deploying programmable HTTP proxies and by Cloudflare's own platform to sandbox tenant code.
🌱Maturity & risk
Production-ready and actively maintained. The codebase is large (16M+ LOC across multiple languages), has extensive CI/CD workflows (.github/workflows/ contains 20+ automation pipelines including test.yml, release.yml, coverage.yml), daily releases, and is battle-tested by Cloudflare's global network. Regular commits and active issue triage indicate ongoing development.
Low risk for most users. Codebase is owned and maintained by Cloudflare (a $100B+ company). However, the README explicitly warns: 'workerd on its own does not contain suitable defense-in-depth against implementation bugs'—you must run untrusted code in a VM sandbox. Complexity is high (9M lines C++, multi-language stack), so contributing requires significant domain knowledge.
Active areas of work
Active development with daily releases (.github/workflows/daily-release.yml), ongoing WPT (Web Platform Tests) compatibility work (.github/workflows/_wpt.yml, .github/workflows/wpt-report.yml), compat-flag documentation automation (check-compat-flag-docs.py), and experimental features workflow. The .opencode/commands/ directory shows recent additions for compat-flag management and dep-impact analysis.
🚀Get running
git clone https://github.com/cloudflare/workerd && cd workerd && bazel build //... (requires Bazel 8.x per .bazelversion). For development, use the provided DevContainer: code .devcontainer/ or build the Dockerfile manually. See README for platform-specific setup. No npm install—this is a Bazel project, not a Node.js package.
Daily commands:
Bazel: bazel run //path/to/target for individual binaries. bazel build //... for full build. bazel test //... for tests. No dev server in traditional sense—workerd is invoked with a config file (Cap'n Proto format). Example: workerd serve <config.capnp>. See .github/workflows/test.yml for CI test command patterns.
🗺️Map of the codebase
.bazelrc— Bazel build configuration that defines compilation flags, test settings, and platform-specific build rules essential for understanding how workerd is compiled and tested.github/workflows/test.yml— Primary CI/CD pipeline defining how the runtime is tested and validated across platforms; critical for understanding testing strategy and release process.clang-format— Code style enforcement configuration that all C++ contributions must follow; non-compliance blocks merges.clang-tidy— Static analysis rules for C++ code quality; violations are caught in CI and must be resolved before contribution acceptance.github/CODEOWNERS— Defines which team members review which components; necessary to understand code ownership and routing for PRs.github/workflows/release.yml— Release automation workflow showing how built artifacts are packaged, versioned, and distributed to end users.bazelversion— Pins the exact Bazel version used in the build system; version mismatches will cause build failures
🛠️How to make changes
Add a new Web API binding
- Create test file following workerd test format in appropriate subdirectory (e.g., src/workerd/api/tests/) (
.opencode/skills/wd-test-format/SKILL.md) - Implement C++ binding in src/workerd/api/ with JavaScript<->native marshalling (
.clang-tidy) - Format code using clang-format to match project style (
.clang-format) - Add test target to BUILD.bazel file in the same directory (
.bazelrc) - Run local tests with bazel test and verify CI passes on PR (
.github/workflows/test.yml)
Add a compatibility flag
- Review skill guide on adding compat flags to understand naming and structure (
.opencode/skills/add-compat-flag/SKILL.md) - Add flag definition in src/workerd/api/global-scope.cpp or relevant scope file (
.clang-tidy) - Document the flag in docs/compat-flags.md with rollout plan and description (
.github/scripts/check-compat-flag-docs.py) - Run compat flag documentation validation in CI (
.github/workflows/compat-flag-docs.yml) - Submit PR; ensure CI passes including compat-flag-docs workflow (
.github/workflows/bonk.yml)
Set up local development environment
- Use devcontainer for automatic environment setup in VSCode or compatible editor (
.devcontainer/devcontainer.json) - Verify Bazel version matches pinned version for reproducible builds (
.bazelversion) - Run initial build with bazel build //src/workerd and verify no errors (
.bazelrc) - Run test suite locally with bazel test //src/workerd/... to validate setup (
.github/workflows/test.yml)
Prepare code for contribution review
- Apply clang-format to all C++ files to match enforced style (
.clang-format) - Run clang-tidy locally to identify and fix code quality issues before CI (
.clang-tidy) - Check CODEOWNERS file to identify who reviews your changes (
.github/CODEOWNERS) - Push branch and open PR; CI will run full test, lint, and release workflows (
.github/workflows/test.yml)
🔧Why these technologies
- Bazel Build System — Provides hermetic, reproducible builds for complex C++/Wasm projects with fine-grained dependency tracking and parallelized compilation across platforms
- Clang/LLVM Toolchain — Compiles C++ to native binaries and WebAssembly; clang-tidy enforces code quality; clang-format ensures consistent style across contributors
- V8 JavaScript Engine — Powers the JavaScript execution runtime; same code foundation as Chromium browsers, ensuring web standards compatibility
- GitHub Actions CI/CD — Automates testing, linting, security scanning, and release distribution on every commit; enables rapid iteration and safe deployments
- Web Platform Tests (WPT) — Standards compliance validation; ensures workerd implements web APIs correctly and maintains parity with browsers
⚖️Trade-offs already made
-
Use Bazel instead of Make/CMake
- Why: Bazel provides fully reproducible, hermetic builds with strong dependency isolation, critical for a runtime that powers production services
- Consequence: Steeper learning curve for new contributors; slower incremental rebuilds for small changes; requires pinned tool versions
-
Enforce strict code formatting via clang-format
- Why: Eliminates style debates in code review; allows focus on logic and functionality; ensures uniform codebase across teams
- Consequence: Initial frustration for contributors unfamiliar with the style; tooling must run pre-commit to catch violations early
-
Run full test suite and WPT validation on every PR
- Why: Catches regressions early; ensures web standards compliance; prevents broken code from reaching production
- Consequence: Longer CI times (blocking PRs); higher resource costs; some tests may be flaky requiring retries
-
Split nanoservices (same-process, different isolates) vs. microservices
- Why: Achieves microservice decoupling benefits while maintaining function-call performance; cheaper than separate processes/machines
- Consequence: Shared memory requires careful isolation; single crash can affect multiple nanoservices; harder to scale individual services independently
🚫Non-goals (don't propose these)
- Does not provide browser UI or graphical interface
- Does not implement Node.js APIs natively (provides compat layer only)
- Does not support multi-process isolation at the language level (isolates via V8 contexts, not OS processes)
- Does not implement database query language or persistence layer
- Does not provide authentication/authorization (delegates to user applications)
🪤Traps & gotchas
- Bazel learning curve: must understand Starlark syntax and Bazel's BUILD file format; 'bazel clean' may be required if build caches corrupt. 2) No npm packages: this is not installable via npm—it's a compiled binary, not a Node library. 3) V8/C++ version pinning: .bazelversion locks the Bazel version strictly; updating requires testing C++ interop end-to-end. 4) Cap'n Proto serialization: worker config files use Cap'n Proto schema, not JSON; schema changes require recompilation. 5) Platform-specific: Despite claims of POSIX support, Windows builds may lag; check .github/workflows/ for actual supported platforms in CI. 6) WPT submodule: Web Platform Tests suite is a git submodule; shallow clones will fail WPT jobs.
🏗️Architecture
💡Concepts to learn
- Capability-based security (object capabilities) — workerd isolates workers using capabilities instead of global namespaces—each worker receives only the bindings it's configured for, preventing accidental or malicious SSRF/lateral-access attacks
- Nanoservices architecture — workerd's key differentiator: multiple isolated JavaScript workers can call each other in-process (same thread) with function-call latency instead of RPC overhead, enabling composable distributed systems
- Compatibility dates (time-based versioning) — workerd guarantees zero-breaking-changes by allowing workers to pin to past API versions via a date flag, implementing spec-evolution without invalidating existing code
- Web Platform Tests (WPT) conformance — workerd validates spec compliance by running the official W3C test suite in CI; understanding WPT is essential for contributing new runtime APIs that must pass standard tests
- Cap'n Proto serialization — workerd configuration uses Cap'n Proto schemas instead of JSON/YAML for zero-copy inter-process communication and schema evolution; contributors must understand the .capnp format
- Service Worker API lifecycle (install/activate/fetch events) — workerd implements the full Service Worker spec, so understanding worker initialization, event handling, and cleanup is mandatory for runtime development
- Bazel monorepo build system — workerd uses Bazel (not Make/CMake) to manage multi-language compilation (C++, Rust, JS, TS); contributors must learn Bazel's Starlark syntax and BUILD file conventions to add code
🔗Related repos
cloudflare/wrangler— Official CLI tool for developing and deploying Cloudflare Workers; uses workerd as its local dev runtimecloudflare/workers-types— TypeScript type definitions for Cloudflare Workers APIs; consumers of workerd rely on these types for IDE supportnodejs/undici— Node.js native HTTP client used as reference for fetch() API behavior; workerd implements similar HTTP semanticsweb-platform-tests/wpt— Official W3C test suite that workerd runs via CI (.github/workflows/_wpt.yml) to validate standards compliancev8/v8— Google's JavaScript engine that powers workerd's runtime; workerd vendored/wraps V8 binaries for deterministic builds
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add compatibility flag documentation validation to CI pipeline
The repo has a script at .github/scripts/check-compat-flag-docs.py and a workflow at .github/workflows/compat-flag-docs.yml, but there's also an .opencode/commands/compat-flag-docs.md file suggesting this check may not be fully integrated into the main test/lint workflows. A new contributor could ensure this validation runs on every PR by integrating it into .github/workflows/test.yml or .github/workflows/lint.yml, preventing undocumented compatibility flags from being merged.
- [ ] Review .github/scripts/check-compat-flag-docs.py to understand the validation logic
- [ ] Check current CI configuration in .github/workflows/test.yml and .github/workflows/lint.yml
- [ ] Add a step to run the compat-flag-docs check in the main lint/test workflows
- [ ] Test locally that the check catches missing documentation
- [ ] Submit PR with clear description of which workflow was updated and why
Implement semantic release notes generation for Python runtime releases
The repo has .github/workflows/release-python-runtime.yml and .github/workflows/release-python-snapshots.yml for Python releases, but no corresponding automated changelog/release notes generation. The .opencode/commands/changelog.md suggests changelog management is a concern. A new contributor could add structured release notes generation that parses commit messages and categorizes changes (features/fixes/breaking) for Python releases, improving release transparency.
- [ ] Examine .github/workflows/release-python-runtime.yml to understand the current release process
- [ ] Review .opencode/commands/changelog.md to understand desired changelog structure
- [ ] Implement a changelog entry generation step that runs before Python releases
- [ ] Add logic to parse conventional commits and auto-generate structured release notes
- [ ] Add validation to ensure changelog entries exist for all significant changes
- [ ] Test locally with a mock release scenario
Add WPT (Web Platform Tests) coverage reporting for new APIs
The repo has .github/workflows/wpt-report.yml and .github/workflows/_wpt.yml for Web Platform Tests, but these workflows appear to only report results without tracking coverage trends over time. A new contributor could enhance the WPT reporting infrastructure to calculate and track WPT coverage percentages per API surface area (e.g., fetch API, streams, etc.), making it easier to identify which standard APIs need implementation work.
- [ ] Review .github/workflows/_wpt.yml to understand current WPT execution
- [ ] Analyze WPT test structure to identify how to map tests to API categories
- [ ] Create a script to parse WPT results and generate coverage metrics by API
- [ ] Enhance .github/workflows/wpt-report.yml to calculate and publish coverage trends
- [ ] Store historical coverage data (consider GitHub artifacts or a simple JSON file in git)
- [ ] Add visualization/reporting (e.g., badge or comment on PRs showing impact on WPT coverage)
🌿Good first issues
- Add TypeScript type definitions for missing runtime APIs in src/api/*.ts by checking which W3C APIs are implemented in C++ but lack .d.ts files. Search src/api/BUILD for 'ts_library' targets and compare against MDN's Web API reference.
- Improve test coverage for Cap'n Proto config parsing: src/config/ lacks examples showing all valid worker configuration options; add .capnp example files and corresponding tests in src/config/test.cc documenting edge cases.
- Document the .github/scripts/check-compat-flag-docs.py validation logic in a developer guide, as the compat-flag workflow is opaque to new contributors and currently has no inline docstrings explaining the automatic flag documentation validation.
⭐Top contributors
Click to expand
Top contributors
- @erikcorry — 18 commits
- @workers-devprod — 13 commits
- @hoodmane — 12 commits
- @vaishnav-mk — 8 commits
- @fhanau — 6 commits
📝Recent commits
Click to expand
Recent commits
21840a6— Release 2026-05-09 (workers-devprod)2ab8992— Release 2026-05-08 (workers-devprod)064b952— Merge pull request #6718 from cloudflare/osilva/restart-from-step (harrishancock)4bd3817— [rust] extend kj & worker ffi to support "OK" worker. (#6723) (mikea)12cb5c8— Address review: documentation and object ordering fix (pombosilva)ae4004e— Merge pull request #6699 from cloudflare/felix/parallelism-9000 (fhanau)0138dcb— Release 2026-05-07 (workers-devprod)2375d8e— [build] Improve test parallelism through custom resource for socket tests (fhanau)0921baa— Merge pull request #6736 from cloudflare/caio/revert-rollbacks (Caio-Nogueira)3692eac— Reverts workflows step rollbacks in workers module (Caio-Nogueira)
🔒Security observations
The workerd codebase demonstrates reasonable security practices with a public security policy and disclosure program. However, there are minor concerns: (1) Incomplete dependency hashing in requirements.txt that could undermine supply chain security, (2) Exposure of internal development processes through the .opencode directory, (3) Potential for secrets leakage in GitHub Actions workflows if not properly configured. No critical vulnerabilities were identified based on the provided file structure, but manual auditing of workflow files, secrets management, and dependency verification is recommended. The codebase appears well-maintained with clear development infrastructure and security reporting channels.
- Medium · Incomplete Dependency Hash in requirements.txt —
requirements.txt (dependencies section). The requirements.txt file shows markupsafe==3.0.2 with multiple SHA256 hashes, but the list appears truncated (ends with '# via'). This incomplete hash list could allow installation of unexpected package versions if the file is corrupted or modified, bypassing hash verification controls. Fix: Ensure all SHA256 hashes for markupsafe and jinja2 are complete and verified. Regenerate requirements.txt using 'pip-compile --generate-hashes requirements.in' and validate all hashes are present. - Low · Potential Information Disclosure via .opencode Directory —
.opencode/ directory structure. The .opencode/ directory contains automation scripts and skill documentation that may expose internal development processes, architecture decisions, and CI/CD workflows (agent architect.md, submit.md, etc.). While not directly exploitable, this could aid reconnaissance attacks. Fix: Review what's stored in .opencode/ and ensure no sensitive information is committed. Consider adding .opencode to .gitignore if it contains internal-only documentation, or ensure it only contains public-facing information. - Low · GitHub Workflows May Expose Secrets in Logs —
.github/workflows/ (all workflow files). Multiple GitHub Actions workflows are present (.github/workflows/) which could potentially leak secrets in build logs if not properly configured. The presence of daily-release.yml, release.yml, and internal-build.yml suggests deployment pipelines that handle credentials. Fix: Audit all GitHub Actions workflows to ensure: (1) Secrets are masked in logs using GitHub's masking syntax, (2) Sensitive environment variables are set with 'secrets' context, (3) Third-party actions are pinned to specific commit SHAs, (4) No credentials are hardcoded. - Low · Public Security Policy Points to External Disclosure Programs —
SECURITY.md. SECURITY.md references HackerOne and Cloudflare's disclosure program. While this is standard practice, ensure the email security@cloudflare.com is monitored and the GPG key is current. Fix: Verify that security@cloudflare.com inbox is actively monitored, that the referenced GPG key (06A67236) is current and rotated periodically, and that HackerOne program scope is accurately documented.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.