Trust the code you didn’t write.
Check it against an answer key it never saw.
Most of what your company ships was written by someone else: strangers who publish open-source packages, and now AI. rederive replaces those parts with your own copies and checks each one against hidden tests, with answers taken from the original, not from whoever wrote the copy.
Anyone can re-run the check — your build pipeline, your auditor, your customer — for free, without trusting us.
Developer? Install it in one line ↓
npm supply-chain protection: what happens when a package is sabotaged?
In January 2022 the maintainer of colors deliberately broke it: a new release, published with his own valid credentials, sent apps into an endless loop of garbage output. Nothing was hacked. Anyone who installed the update got it, because a package manager hands you whatever the publisher pushed.
With rederive, that kind of change gets caught before it ships. We rebuilt the relevant part of colors as a copy you own, then changed a single character in it. The check failed at once: two hidden tests broke, and the file's fingerprint no longer matched.
The real output, for the technically curious. @rederive/colors is a zero-dependency rebuild of strip() — the part of colors@1.4.0, the last release before the sabotage, that removes color codes. Here is the rdv checker on it, before and after we drop one character from the shipped JavaScript.
$ rdv check node_modules/@rederive/colors
rdv check @rederive/colors@0.2.0 source: colors@1.4.0 spec v0.5
✓ VERIFIED strip strip(str: text) -> text
v0.5 lint strict OK
✓ lang:js held-out 8/8 hashes match (9 frozen / 8 held-out)
✓ lang:rust held-out 8/8 hashes match (9 frozen / 8 held-out) cargo check ok (library crate)
✓ lang:ts held-out 8/8 hashes match (9 frozen / 8 held-out) tsc --strict ok, conforms to SIG
ALL UNITS VERIFIED — shipped src matches its contract.
# 2. tamper with the shipped JavaScript — drop the one-character g flag from its pattern
$ rdv check node_modules/@rederive/colors
rdv check @rederive/colors@0.2.0 source: colors@1.4.0 spec v0.5
✗ FAILED strip strip(str: text) -> text
✗ lang:js held-out 6/8 hashes MISMATCH (src:false oracle:true sir:true spec:true)
first miss ("\u001b[31mhi\u001b[39m") expected "hi" got "hi\u001b[39m"
✓ lang:rust held-out 8/8 hashes match (9 frozen / 8 held-out)
✓ lang:ts held-out 8/8 hashes match (9 frozen / 8 held-out)
VERIFICATION FAILED — do not trust this src; re-derive it from its contract with the sir-factory loop
One dropped character, caught two ways at once: only 6 of 8 held-back tests pass, and the file's fingerprint (a hash of its exact bytes) no longer matches. In the output, "held-out" means the held-back tests and "frozen" means the examples the builders were shown. Don't trust the shipped file? The package carries its full spec and tests, so you can rebuild each language version yourself with sir-factory.
The tests even record the original's real limits: colors.strip removes only color codes, so cursor and title escape sequences survive it. rederive writes that down in the spec instead of hiding it.
Reduce your npm dependencies — by replacing them.
You chose a handful of dependencies. npm installed far more — code nobody on your team chose or read. Find out your own number — run this in any Node project:
You can't read them all
Nobody can. Scanners — npm audit and the good commercial ones — tell you which packages are known-bad today. The rest stay what they've always been: unread code with publish rights into your build.
So stop shipping them
rederive replaces a dependency with a verified, zero-dependency copy you own: rebuilt from its spec, checked on held-back tests, and fingerprinted in your tree. Your tree gets smaller; what remains is code you can answer for.
What it can replace today
- Best fit: small, self-contained packages — string, number, date, URL, parsing and formatting helpers — including abandoned ones you can't get fixed upstream.
- Packages that talk to the network or file system: JavaScript only today (their effects are checked by replaying recorded traffic).
- Not yet: native add-ons and large frameworks.
- Anything rederive can't verify is reported and left in place, never shipped unverified.
- Every replacement keeps the original's license notice and records where it came from.
@rederive/* catalog: 218 packages verified in the repository, 3 published to npm so far, more as they're released.
Scanning flags packages. rederive removes them. Set it up →
How rederive checks AI-written code
The same three steps apply whether the code replaces an npm package or is a new feature an AI wrote.
Write down what the part must do
Each part gets a spec written in SIR (the spec format): a short, language-neutral description of its behavior, plus worked examples of inputs and expected outputs. One spec drives JavaScript, TypeScript and Rust.
Grade on examples the builders never saw
Some examples are kept as held-back tests, with expected answers that come from running the original package (or a reference you choose), not from whoever writes the replacement. Held back means hidden from the AI builders while they build. Afterwards the tests ship with the package, fingerprinted, so anyone can re-generate them from the original and confirm nothing changed.
Several AI builds that can't see each other
Each part is built more than once, by AI builds that can't see each other's work. If independent builds disagree, the spec left room for guessing, so it gets tightened. Agreement isn't the test of correctness — the held-back tests, whose answers come from the original package, are.
After that, rdv check re-runs the held-back tests against the shipped code and compares fingerprints — free, offline, no AI — so it can run in your automated build pipeline (CI) on every change. Building uses your own AI model usage, on your machine. Each language is checked against the same tests, so the JavaScript, TypeScript and Rust versions can't quietly drift apart. Hand-written code can be held to the same tests. Read the SIR specification →
Get started: the CLI and the Claude Code plugin
Install the command-line tools, try them where they can't touch anything, then add the plugin if you use Claude Code.
Free, Apache-2.0 · install the rdv checker (rederive's command-line tool) and sir-factory (the build tool): npm i -g rederive@^0.5 sir-factory · see how many packages npm really installed for you: npx -p rederive rdv audit
The Claude Code plugin
Two commands inside Claude Code. The plugin adds three skills, so you can ask for the work in plain words.
Replaces a dependency. It writes the spec, records held-back tests by running the original, and runs the independent builds. Ask: "Get this project off decode-uri-component — re-derive it as a verified, zero-dependency copy in this repo."
For code with no tests. It records what the code does today as tests, then measures how strong those tests are by deliberately breaking the code and counting how often the tests notice.
Builds a new feature part by part the same way, and brings the real design decisions to you instead of guessing.
Your team's existing AI-written code has no tests? Start with preflight. Using a different agent? The CLIs plus rederive.ai/prompt.md are the whole flow, written for any agent.
Tested on our own code
Before asking you to trust it, we ran rederive on two things of our own: its own verifier, and a production app.
Our own verifier, rebuilt with rederive
A verification tool should survive being verified, so we rebuilt the part that decides whether your code passes.
42 of 42 parts pass
JavaScript and TypeScript for all 42, Rust for 38 — each rebuilt from its spec and checked against tests the builders never saw.
Three languages, one answer
The JavaScript, TypeScript and Rust versions were run on the same inputs and compared: 67,976 cross-language comparisons, zero disagreements.
It found its own weak spots
162 issues found in our own verifier this way; 25 high severity — all fixed in 0.5 with regression tests; 136 fixed in total, the rest tracked in the open.
Our own production email categorizer, built at Apilify
A real application we run, built part by part with rederive.
38 parts, 114 builds, all passed
Each part was built three times, blind. All 114 builds passed.
463 tests held back
None of them was shown to any builder. The whole app is re-checked automatically on every change — offline, with no AI in the check.
One optional npm package
Inside the app's own logic there is exactly one optional npm package: zod. The libraries the platform requires stay at the edges.
EU Cyber Resilience Act: evidence for your open-source components
The CRA's reporting obligations apply from September 2026; its main obligations apply from December 2027. Its due-diligence question is old-fashioned: do you know what's in your product, and can you show your work? rederive supports that due diligence. It doesn't make a product compliant on its own.
A dependency tree you can answer for
Fewer third-party components means a shorter inventory to defend. Each part you vendor with rederive carries its spec, its held-back tests and file fingerprints, so you can show what it does — not only where it came from. It complements your software bill of materials (SBOM); it doesn't replace it.
An inventory of the components in your custom software
PCI DSS 4.0 asks you to maintain an inventory of bespoke and custom software and the third-party components in it. Replacing components with small parts you own, each with checks anyone can re-run, makes that inventory shorter and easier to stand behind.
Verification an auditor can re-run
rdv check is offline, free and gives the same answer every time. Your evidence isn't a document saying a check happened once — it's a command the auditor can run again. Packaged evidence for teams is part of our hosted services, now in design-partner preview: book a call if you're shipping into the EU and want to talk it through.
Questions
Can it replace an abandoned or unmaintained npm package?
Often, yes — if it's small and self-contained, like a string, date, URL or parsing helper. The replacement lives in your repo, so you don't need anyone upstream to publish a fix. If rederive can't verify a package, it says so and leaves it in place.
Aren't published tests leaked to the next model?
The tests are held back only while the AI builds the code. After that, their job is to let anyone re-check the result, so they ship with the package. A leaked test can't make wrong code pass, because the expected answers come from running the original package, not from the code being checked.
How is this different from Socket or Snyk?
Scanners like Socket and Snyk flag risky packages. rederive removes a package by replacing it with verified code you own. They answer different questions, so use both.
What does it cost?
The tools are free and open source. Building a replacement uses your own AI model usage, on your machine. Checking is free and offline, with no AI involved.
What about licenses?
Every replacement keeps the original package's license notice and records where it came from.
Does it work with Cursor or other agents?
Yes. The command-line tools and the setup prompt at rederive.ai/prompt.md work with any agent that can run shell commands. The plugin is for Claude Code.
Open source. Hosted team services in preview.
Everything on this page is open source under Apache-2.0. Hosted services for teams are in design-partner preview — if you'd like to shape them, book a call.
The open-source tools
- The
rdvchecker —check,audit,initand the rest (npm) - The
sir-factorybuild tool (GitHub) - The Claude Code plugin
rederive@rederive—sir-verify,greenfield-quorumandpreflight(GitHub) - The SIR specification and package format
- The
@rederive/*catalog — 218 verified in the repository, 3 published so far
Running it across an organization
- Managed rebuilds — no build fleet to run, no AI usage of your own to spend
- Private catalogs for your internal code
- Continuous checks and alerts when behavior changes
- Governance — SSO, roles, policy, audit logs
- Packaged evidence for EU CRA, NIST SSDF and SOC 2 reviews
We wrote down what we'll never do.
We will never paywall the ability to verify or re-derive a public package, never cripple the open-source tools to force an upgrade, and never retroactively relicense what we've released.
Read the rederive Promise →About
rederive is built by Apilify Inc. It grew out of Semcom, Apilify's verified-compilation research. Lane Thompson is the inventor and Apilify's CEO. The idea is simple and a little uncomfortable: most tooling treats the author's code as the source of truth. rederive treats behavior anyone can re-check as the source of truth, and rebuilds the code to match.