From 711ac657707bec4fb138aafa4b1349f3980c6d82 Mon Sep 17 00:00:00 2001 From: Omid Mirzaei Date: Fri, 18 Sep 2026 13:36:57 +0400 Subject: [PATCH 1/4] reject a foreign tenant GET without a player snapshot --- internal/api/httpapi/security_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/api/httpapi/security_test.go b/internal/api/httpapi/security_test.go index 238edbb..03509d2 100644 --- a/internal/api/httpapi/security_test.go +++ b/internal/api/httpapi/security_test.go @@ -89,10 +89,16 @@ func TestGetPlayerHidesCrossTenant(t *testing.T) { t.Fatalf("do: %v", err) } defer func() { _ = resp.Body.Close() }() + b, _ := io.ReadAll(resp.Body) if resp.StatusCode != http.StatusNotFound { - b, _ := io.ReadAll(resp.Body) t.Fatalf("status=%d want 404 body=%s", resp.StatusCode, b) } + if json.Valid(b) { + t.Fatalf("cross-tenant body is JSON: %s", b) + } + if bytes.Contains(b, []byte("vip")) || bytes.Contains(b, []byte("balance")) || bytes.Contains(b, []byte("acme-casino")) { + t.Fatalf("cross-tenant body leaked snapshot: %s", b) + } } func newSecurityTestServer(t *testing.T) (*store.Store, *httptest.Server) { From e06b13fda1dc65606f8ac7673c9de9de01ab4ba3 Mon Sep 17 00:00:00 2001 From: Omid Mirzaei Date: Fri, 18 Sep 2026 13:37:14 +0400 Subject: [PATCH 2/4] run a Nova-on-Acme GET from Contract --- web/app/api/contract/route.ts | 25 +++++++++++++++++++++++++ web/lib/engagepulse.ts | 14 ++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/web/app/api/contract/route.ts b/web/app/api/contract/route.ts index e871d44..2b40ac5 100644 --- a/web/app/api/contract/route.ts +++ b/web/app/api/contract/route.ts @@ -1,10 +1,12 @@ import { NextResponse } from "next/server"; import { fetchPlayer, + getPlayerRaw, ingestEvent, parseMetrics, postTool, } from "@/lib/engagepulse"; +import { getTenants } from "@/lib/tenants"; import { scoreShadowBoard } from "@/lib/shadow-score"; export const dynamic = "force-dynamic"; @@ -130,6 +132,23 @@ export async function POST() { }; } + const isolationPlayerId = `probe-iso-${suffix}`; + await ingestEvent("acme-casino", { + event_id: `probe-iso-${suffix}`, + player_id: isolationPlayerId, + type: "deposit", + amount: 50, + occurred_at: new Date().toISOString(), + }); + const nova = getTenants()["nova-sports"]; + const cross = await getPlayerRaw(nova.apiKey, isolationPlayerId); + const lower = cross.body.toLowerCase(); + const isolationPass = + cross.status === 404 && + !lower.includes("vip") && + !lower.includes("balance") && + !lower.includes("acme-casino"); + return NextResponse.json({ llm: "The LLM is not on the credit path.", hmac: "HMAC is signed in the BFF and verified in Go.", @@ -155,6 +174,12 @@ export async function POST() { pass: shadowPass, }, dlq: dlqProbe, + isolation: { + player_id: isolationPlayerId, + status: cross.status, + body_empty: cross.body.trim() === "player not found", + pass: isolationPass, + }, }); } catch (err) { const message = err instanceof Error ? err.message : "contract probe failed"; diff --git a/web/lib/engagepulse.ts b/web/lib/engagepulse.ts index 07ecd91..50ea13f 100644 --- a/web/lib/engagepulse.ts +++ b/web/lib/engagepulse.ts @@ -31,6 +31,20 @@ export async function fetchPlayer( return (await res.json()) as PlayerSnapshot; } +export async function getPlayerRaw( + apiKey: string, + playerId: string, +): Promise<{ status: number; body: string }> { + const res = await fetch( + `${apiBase()}/v1/players/${encodeURIComponent(playerId)}`, + { + headers: { "X-API-Key": apiKey }, + cache: "no-store", + }, + ); + return { status: res.status, body: await res.text() }; +} + export async function ingestEvent( tenantId: TenantId, evt: Omit & { tenant_id?: string }, From d5cf634d8a9ac0bdfff414cd4a6a2c4d23ddf397 Mon Sep 17 00:00:00 2001 From: Omid Mirzaei Date: Fri, 18 Sep 2026 13:37:15 +0400 Subject: [PATCH 3/4] show the isolation probe on the Contract card --- web/components/contract-run.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/web/components/contract-run.tsx b/web/components/contract-run.tsx index 21d26a7..9723bff 100644 --- a/web/components/contract-run.tsx +++ b/web/components/contract-run.tsx @@ -41,6 +41,12 @@ type Probe = { balance: number | null; pass: boolean; }; + isolation: { + player_id: string; + status: number; + body_empty: boolean; + pass: boolean; + }; error?: string; }; @@ -72,7 +78,8 @@ export function ContractRun() { Run contract

Duplicate event_id, 404 on credit/set_vip, sparse-bets vs velocity, - and poison retry to DLQ when inject is on. + Nova cannot read an Acme player, and poison retry to DLQ when inject + is on.