Code review in a sealed room. With receipts.
Your code goes into a hardware-attested enclave on NEAR AI Cloud. Three AI auditors pull it apart, argue about what they find, and a moderator rules. You walk out with the verdict and a signed receipt. The code doesn't walk out at all.
- Intel TDXquotes verified
- NVIDIA GPUevidence verified
- Every responsesigned and checked
- Your codenever stored
// FICTIONAL demo sampleexport function searchOrders(id) { const q = "… WHERE id=" + id; return db.query(q);}
Example receipt from a fictional sample.
Built on NEAR
Private AI code review, end to end inside NEAR AI Cloud.
- NEAR AI Cloudfor private inferenceEvery model call runs in NEAR's confidential cloud.
- Intel TDXfor sealed enclavesHardware quotes prove which code is running.
- NVIDIA NRASfor GPU attestationThe GPUs prove they're in confidential mode.
- Qwen3for the three auditorsAn open model, served inside the enclave.
Five steps. The last one is forgetting.
- 01
Attest
A fresh nonce goes to NEAR AI Cloud. Intel TDX and NVIDIA evidence must verify, or your code never leaves the server.
fails closed - 02
Audit
Security, breaking-change and quality auditors read the code in parallel, each through one lens.
3 calls - 03
Argue
Every auditor backs or disputes the others' findings, and has to say why.
up to 3 calls - 04
Rule
A moderator keeps what survived and records what didn't. Confidence is computed from the votes.
1 call - 05
Forget
You get the verdict and a signed receipt. The code only ever lived in memory, and now it's gone.
0 bytes kept
What happens on NEAR AI Cloud.
Every step of a review is a call to NEAR AI Cloud. Here is the exact sequence one review makes, and what CodeCloak checks before trusting each answer.
- 01
GET /v1/attestation/report?nonce=…1 callBefore any code leaves our server- NEAR returns
- Intel TDX quotes from the NEAR AI gateway and the model enclave, NVIDIA GPU evidence, and the enclave's signing key.
- CodeCloak checks
- dcap-qvl against Intel collateral, pinned enclave measurements, our nonce in every quote, NVIDIA NRAS verdict.
- 02
POST /v1/chat/completionsup to 7 callsOnly after attestation passes- NEAR returns
- Three auditors in parallel, up to three challenge rounds and one moderator ruling, all served inside the attested enclave.
- CodeCloak checks
- Code is sent to the model NEAR just proved, in delimited, untrusted blocks.
- 03
GET /v1/signature/{chat_id}1 per responseAfter every model answer- NEAR returns
- An ECDSA signature by the enclave key over sha256(request) and sha256(response).
- CodeCloak checks
- Recovered signer must match a key the preflight quotes vouched for. Gateway-only signatures don't count.
Any failed check stops the review with 403 attestation_failed. Your code is never sent.
Inside, they argue. On purpose.
One model agrees with itself. CodeCloak gives three auditors one job each, makes them cross-examine each other, and lets a moderator rule. Disagreements stay on the record.
- SecurityAssumes every input is hostile.
- BreakingAsks who this change will break.
- QualityReads it like the next person on call.
- ModeratorRules on what survived. Keeps the arguments on record.
- Securityfinding S1 · high
searchOrders concatenates id into the SQL string. Anyone can rewrite the query.
- Breakingbacks S1
Same line also breaks on any id with a quote in it. Real bug either way.
- Qualityfinding Q1 · low
db.query has no error path. A failed lookup quietly returns undefined.
- Securitydisputes Q1
The caller already wraps this in try/catch. Not a defect here.
- Moderatorruling
S1 stands, backed by both. Q1 stays on record as a disagreement: one back, one dispute.
Kept after the response: nothing.
Try it on a planted bug.
Four fictional samples, each hiding a real class of bug. Pick one, or paste your own code. It is reviewed in memory and never stored.
About a minute · up to 7 attested, signed calls on NEAR AI Cloud
// FICTIONAL — for hackathon demo only.
import { createHmac } from "node:crypto";
import { findUserByEmail } from "./users";
const SECRET = process.env.JWT_SECRET ?? "dev-secret";
function b64url(input: string): string {
return Buffer.from(input).toString("base64url");
}
export function signToken(sub: string): string {
const header = b64url(JSON.stringify({ alg: "HS256", typ: "JWT" }));
const body = b64url(JSON.stringify({ sub, iat: Date.now() }));
const sig = createHmac("sha256", SECRET).update(`${header}.${body}`).digest("base64url");
return `${header}.${body}.${sig}`;
}
export function verifyToken(token: string): { sub: string } | null {
const [header, body, sig] = token.split(".");
const { alg } = JSON.parse(Buffer.from(header, "base64url").toString());
if (alg === "none") {
return JSON.parse(Buffer.from(body, "base64url").toString());
}
const expected = createHmac("sha256", SECRET).update(`${header}.${body}`).digest("base64url");
if (sig == expected) {
return JSON.parse(Buffer.from(body, "base64url").toString());
}
return null;
}
export async function login(email: string, password: string): Promise<string | null> {
const user = await findUserByEmail(email);
if (user && user.password == password) {
return signToken(user.id);
}
return null;
}
You leave with a receipt, not a promise.
Every review ends with one. Each line is checked on the server before or after the models run, and a failed check is shown as failed, never as a badge.
- 1Intel TDX quotesThe gateway and model enclaves sign a hardware quote. We check it with dcap-qvl, replay RTMR3 and match the app-compose hash.
- 2NVIDIA GPUGPU evidence goes to NVIDIA's attestation service, and its signed answer is checked against NVIDIA's keys.
- 3Nonce boundA 32-byte nonce made for your review is baked into every quote, so an old report can't be replayed.
- 4SignaturesEach model response is signed over its exact request and response bytes by a key the quotes just vouched for.
- 5Code retainedNo database, no disk, no analytics. Code never appears in logs or error messages.
What it doesn't prove, yet
- That the container images in the app compose are reproducible builds of published source. The compose is pinned, not rebuilt.
- That the model weights are the named model.
- The TLS certificate. It is not bound to the attestation (include_tls_fingerprint=false).
- Anything outside the enclaves. Privacy there relies on the TEE boundary.
- Your browser does not re-check the quotes. It trusts this server's verdict.
Fair questions, straight answers.
Is my code stored anywhere?
No. It lives in memory for one request. There is no database, no disk write and no analytics, and code never appears in logs or error messages.
Who can see my code?
The models inside the attested enclaves, and our serverless function for the length of the request. It is never written down, and NEAR's operators can't read inside the enclave.
Why three auditors instead of one?
One model agrees with itself. Three with different jobs have to defend their findings, and real disagreements stay on screen instead of being averaged away.
What does the confidence number mean?
It is computed from the challenge votes, weighted by severity, never taken from a model's guess. No ruling means no confidence.
Is it free and open source?
Yes, MIT licensed. The demo samples are fictional, and you can paste your own code.
Run it yourself. One key.
$ git clone https://github.com/PinnacleCryptNG/CodeCloak$ cp .env.example .env.local# set NEARAI_API_KEY$ npm install && npm run dev$ npm run test:failclosed