projects/agent-native/slices/safety-mcp-audit/briefs/d1-r1.md
In a fresh worktree on tml-2969-s3-ai-safety-checkpoint-through-prisma-mcp-audit-pin (from
origin/main), empirically probe whether the AI safety checkpoint's consent text reaches an
MCP client calling prisma mcp's migrate-reset tool, and encode the desired contract as
packages/cli/src/__tests__/mcp-safety.vitest.ts driving the real server over stdio.
git -C <main-checkout> worktree add ../agent-native-s3 -b tml-2969-s3-ai-safety-checkpoint-through-prisma-mcp-audit-pin origin/main
(fetch first); pnpm install + pnpm exec turbo build --filter='prisma^...' +
turbo build --filter=prisma (the probe needs the built CLI; budget ~10 min total)./home/aqrln.guest/worktrees/prisma/solid-otter/prisma/projects/agent-native/slices/safety-mcp-audit/spec.md
— it is the contract, including both pre-investigated edge cases (curated subprocess env:
never inherit your own agent markers; ensure the consent env var is absent in the
agent-marker case).Client over StdioClientTransport spawning
node <worktree>/packages/cli/build/index.js mcp with a curated env (allowlist:
HOME/PATH/TERM + CLAUDECODE=1; no other markers; no consent var), calling
migrate-reset with a scratch sqlite project as cwd — the raw tool result recorded
verbatim. A control run with no marker likewise recorded.PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION + the
stop-and-relay language), or is it swallowed/truncated — and if swallowed, exactly
where in runCommand (packages/cli/src/mcp/MCP.ts) the text is lost.mcp-safety.vitest.ts encodes the desired contract (marker → consent text present,
no success; no marker → no consent text), self-contained (builds nothing; skips or
fails clearly if build/index.js is absent — note your choice), DB-free, curated-env
per the spec's edge cases.MCP.ts changes this dispatch either way.pnpm run tsc).Stay focused on the goal; control scope. Trivial-and-related fixes with a one-line note; drift halts and surfaces. A checkpoint that does not fire at all in the child (marker not inherited, or #29684 changed the mechanism) is an I12 halt with evidence — not something to patch.