Skip to content

Verified badge: View proof (signatures and NVIDIA / Intel attestation) in the app #254

Closed

Description

@AncungAulia

@Lexirieru @Lin1er Ancung (FE) would like this before 14 Nov: a "View proof" in the verified badge, so a judge can see the evidence behind it in the app, not only our word.

Today

The badge (#19) now opens a short note (FE branch feat/fe-sheets-step-summary, not merged yet): what the level means, the model, how many steps were checked with their completion ids, and links to https://docs.near.ai/cloud/verification and https://github.com/nearai/nearai-cloud-verifier. It shows only what run.verified carries (model, verification.level, completionIds). The signatures and attestation reports aren't in the browser: NEAR AI serves them only with an API key (GET /v1/attestation/report, GET /v1/signature/{chat_id}; the near-ai-cloud skill says the report needs Authorization: Bearer).

Proposed

  • Engine: it already verifies each completion with @nearai/inference-sdk (src/verify.ts). Keep what it checked, per run, so nothing has to be fetched again:
    • per step: completion id, signing_address, signature kind (gateway or provider_tee), and whether the signer matched the attested address;
    • per attestation: when it was taken, the nonce, NVIDIA NRAS's verdict, whether the Intel TDX quote verified, and the quote itself (so anyone can paste it into https://proof.t16z.com).
      Whether the SDK exposes these pieces, or they have to be read beside it, is not checked yet.
  • Backend: GET /v1/runs/{runId}/proof for the run's owner, returning that record (never the NEAR AI key). 404 when the run has no badge.
  • FE (mine): "View proof" in the badge's popover opens a dialog, in plain words first:
    • "Signed inside the TEE" with the signer address and a check for each step;
    • "Hardware checked by NVIDIA" and "by Intel", with when;
    • "Check it yourself": the quote to copy and a link to the TEE explorer, plus the open-source verifier.
      No raw JWTs on screen; a copy button for whoever wants them.

Notes

  • Claims stay at the level the engine proves (§3): a streamed chat run is gateway_tee, not model_tee; the dialog says which.
  • If it doesn't fit before the 14th, the popover already links to the official docs and verifier, so nothing is broken without it.

🤖 Generated with Claude Code

Activity

  1. Lin1er commented on Nov 11, 2026

    @Lin1er
    Contributor

    Backend side of this, for when the engine part is decided (@Lexirieru, your call on the engine shape):

    The backend already stores every run event before forwarding it (run_events, GET /v1/runs/{runId} returns them all). So the cheapest path is:

    • Engine puts the proof record in the run's last event, e.g. run.verified.verification.proof (per step: completion id, signing_address, signature kind, signer matched; per attestation: time, nonce, NRAS verdict, TDX verified, quote).
    • Backend stores it as today. It strips proof from what it streams and from GET /v1/runs/{runId}, because a TDX quote is several KB and the chat doesn't need it. Then it serves the proof alone on GET /v1/runs/{runId}/proof: owner only (requireRun), 404 no_proof when the run has no badge or predates this. No NEAR AI key is involved, since nothing is fetched again.
    • Old runs keep working (no proof → 404, the popover keeps its doc links).

    That is about a day of backend work plus tests (fake engine sending a proof, owner/stranger/try-out, size), and it can start once the engine field's name and shape are fixed. I won't build it before you confirm, given the 13 Nov 17:00 WIB freeze.

  2. Lexirieru commented on Nov 11, 2026

    @Lexirieru
    Contributor

    @Lin1er engine shape is fixed, PR #256: your plan works as-is. The field is run.verified.verification.proof:

    proof = { checkedAt,
      steps: [{ id, signatureKind, signer: { algo, address }, signedText, signature, attestation }],
      attestations: { [attestation]: { kind: "gateway" | "model", signer: { algo, address }, nonce, intelQuote, tcbStatus, gpuEvidence?, composeHash?, osImageHash? } } }
    
    • When it's absent: on runs before this, when any step lacks evidence (all or nothing), and on Incognito or failed verification. So 404 no_proof covers those.
    • Size, measured on one real chat run: 2 steps, 1 gateway attestation, intelQuote 10,012 chars, the whole run.verified ≈ 12 KB. Stripping proof from the stream and GET /runs/{id} makes sense.
    • Content: no conversation text and no key. signedText is request/response hashes only.

    @AncungAulia for the dialog:

    • Each step's signer.address equals attestations[step.attestation].signer.address; that pair is "Signed inside the TEE".
    • tcbStatus (UpToDate here) is the Intel TDX result.
    • intelQuote is the hex to copy for https://proof.t16z.com.
    • gpuEvidence only appears for model-TEE attestations. A streamed chat is gateway, so for a normal chat say "Gateway TEE", not GPU.

    🤖 Generated with Claude Code

  3. added a commit that references this issue on Nov 11, 2026
  4. Lin1er commented on Nov 11, 2026

    @Lin1er
    Contributor

    @Lexirieru backend part is on feat/be-run-proof (2 commits on main cef116c). May I open the PR?

    • GET /v1/runs/{runId}/proof → { runId, proofs: [{ seq, model, level, proof }] }, owner only (404 run_not_found otherwise), 404 no_proof when none. It's a list because a run paused for approval ends each part with its own run.verified; the last entry is the reply's. @AncungAulia that's the shape for the dialog: take proofs.at(-1).proof.
    • The proof is stored whole in run_events. It is left out of the stream (chat, approve/decline, Telegram), GET /v1/runs/{runId} and GET /v1/minds/{id}/events, so the badge's own fields are unchanged.
    • /approve and /decline are now matched by name, so POST …/proof is a 405 and never resumes a run.

    Tests on ct-dev:

    • typecheck: clean.
    • bun run test: 133 tests, 132 pass, 0 fail, 1 skipped (AgentMail live). The new test uses a fake engine sending a proof shaped like yours, with a 10,012-character quote. It checks: not streamed, stored whole, not in run history or graph events, served to the owner, 404 for a stranger, 405 for a POST, no_proof without one or while paused.
    • bun run load: 0 errors, 812 runs stored, 0 missing events; 582 Telegram replies complete; 230 doubly answered approvals, each exactly one 200 + one 409.

    Not proven yet: a live run on the hosted demo. That's one chat after the deploy, then /proof on it.

  5. Lexirieru commented on Nov 11, 2026

    @Lexirieru
    Contributor

    @Lin1er yes, open it. I'm testing feat/be-run-proof locally now and will review and merge once it's up and CI is green. The list-per-run.verified shape for paused runs makes sense.

    🤖 Generated with Claude Code

  6. added 2 commits that reference this issue on Nov 11, 2026
  7. Lexirieru commented on Nov 11, 2026

    @Lexirieru
    Contributor

    Done end to end: engine keeps the proof on run.verified (#256), backend serves it on GET /v1/runs/{runId}/proof and keeps it out of the stream (#257, checked live by @Lin1er on the hosted demo), and the View proof dialog shows it (#259, @AncungAulia). The dialog claims only what each level proves: Intel TDX for the gateway, NVIDIA only when GPU evidence is present.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions