Private Investigator

AI code review that proves your code stayed private. Your code is read only inside hardware enclaves that prove what they run, and every review comes with a receipt anyone can check.

MultiAgency/near-agencies#78

Bugs, Important

agents/claude-worker/next-task.mjs:37

AGENTS.md's authorship contract says changes records come from "the bot or an owner", and lib/coordinator.mjs/lib/handoff.mjs still honor an owner's hand-written ```changes block (isTrusted accepts an owner).

Read the whole review

Verifies this review's receipt in your browser: Intel's quotes, NVIDIA's verdict and every signature.

Two ways to run it

The same review and the same receipts, run where you prefer.

How it works

Three checks between your code and the model, then a receipt.

  1. Attest

    Before any code is sent, check NEAR AI Cloud's evidence for a fresh nonce: Intel's signed quote for the model's machine, fully patched, and NVIDIA's signed verdict on its GPUs.

  2. Encrypt

    Encrypt every request, tool calls included, to the key that evidence binds. Only the attested enclave can read your code; the gateway in front of it sees ciphertext.

  3. Sign

    The enclave signs each reply over the exact request and response bytes, and a reply is used only once its signature checks out.

  4. Receipt

    The evidence and signatures form a receipt, saved with the run. It holds hashes, not code, so anyone can check it.

With the Action, these steps run on your runner. With the App, they run inside an attested OutLayer enclave that fetches your code from GitHub itself, and the receipt adds each step's attestation, naming the exact build that read your code. Either way no MultiAgency server sees your code, and the source is public.

Set it up

About ten minutes the first time, mostly creating the NEAR AI account, then two minutes per repository. Enter it here, and the steps below fill in.

Any NEAR AI Cloud model that passes the checks. Today that is z-ai/glm-5.3-flash; the Qwen models pass only with the option below. npm run models in the source lists them live. A model that fails stops the review before any code is sent.

  1. Step 1

    Get a NEAR AI Cloud API key

    Sign up at cloud.near.ai, add credits under Credits, and create a key under API Keys. Our test reviews cost about a cent each in NEAR AI credits, plus a few minutes of your GitHub Actions time.

  2. Step 2

    Add it as the repository secret NEARAI_API_KEY

  3. Step 3

    Add the workflow

    Create it on GitHubor save this as .github/workflows/private-review.yml
  4. Step 4

    Check it, then open a pull request

    On the repository's Actions tab, run private-review by hand: it checks the key, the model and the permissions without reading any code, and says what to fix. Then the review appears on each pull request in a few minutes, with findings on changed lines as inline comments. It follows your REVIEW.md and AGENTS.md from the base branch when you have them. The receipt is saved as the run's private-review-receipt.json artifact, ready to drop into the checker below.

A real review

A dry run on MultiAgency/near-agencies#78, a public pull request, so you can compare it with the code. Its receipt is the sample below.

Private review (Bugs, Important: 1)

The change makes the worker's revision-round boundary trust only the coordinator's login (BOARD_BOT), removing all GitHub role reads so trust cannot fail open — the fail-closed direction is right and well tested. The riskiest part is the divergence it creates from the coordinator's and lib/handoff.mjs boundaries, which still honor an owner's hand-written ```changes block: on that thread the coordinator waits for a revision the worker will never deliver.

  1. agents/claude-worker/next-task.mjs:37

    Bugs, Important: AGENTS.md's authorship contract says changes records come from "the bot or an owner", and lib/coordinator.mjs/lib/handoff.mjs still honor an owner's hand-written ```changes block (isTrusted accepts an owner). Under the new worker rule an owner's hand-written block counts for nothing on the worker: if the coordinator is down or an owner posts the block directly, routedRequests/handoff.mjs sees an unanswered revision request (coordinator waits for a revision handoff) while the worker never reopens the handed-off seat (stays null) — the job stalls with both sides waiting, and no cron cycle resolves it. Either have the worker credit bot-or-owner (a role-free owner list is already static config, like BOARD_BOT), or change the coordinator/lib boundary to the same bot-only rule in this PR so the two sides cannot deadlock. The PR's premise ("the coordinator always re-posts") is a convention, not something code enforces.

Verified privately
  • Model: z-ai/glm-5.3-flash in an Intel TDX enclave with NVIDIA confidential GPUs. Quote verified, TCB UpToDate, debug off; it binds signing key 5a0210f2442c79355784f9de021985429561da5bacc3a4424b01ac52b7e0caff and this run's nonce. Compose hash 55db164f4f8c6a837c2217c601c21bba4758f908536a6cd5b2978550205a9179.
  • GPUs: NVIDIA's signed verdict approves them for the same nonce.
  • Gateway: Quote verified, TCB OutOfDate. It relayed only end-to-end encrypted content.
  • Signed: 8 of 8 responses signed by the model enclave's key, over the exact request and response bytes.
  • Receipt: sha256 c9059b8e721c35d7195fb2449d1ab6fffa40317691f5368a9643f93f70d9f1c3. Anyone can check it.

Check a receipt

The same checks as node core/verify.mjs, run in your browser: the Intel quotes against Intel's current collateral, NVIDIA's verdict against the NVIDIA key that signed it (checked back to NVIDIA's certificate authority), and every response signature.

Drop a private-review-receipt.json here, or

What the App's operators can see

Never your code or its review. This much, and no more:

Upgrade

Paid plans are not live yet. A finished trial leaves a check on the pull request with this page's link; billing and tiers land here next.

Until then, the Action path still runs on your own NEAR AI key with no trial cap. Questions: open an issue.

What it doesn't prove

Where the guarantees stop, so you can decide what else to check.