{"record":{"id":"c00ea57f45422206","repo":"JuliusBrussee/caveman","slug":"cave-privacy-conformance-failed","errorCode":"cave_privacy_conformance_failed","errorMessage":"cave_privacy_conformance_failed","messagePattern":"cave_privacy_conformance_failed","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"packages/agent/src/cli.ts","lineNumber":750,"sourceCode":"    evalDynamicKinds(approved),\n    {\n      ...(loaded.config.allowedModels === undefined ? {} : { allowedModels: loaded.config.allowedModels }),\n      ...(loaded.config.deniedModels === undefined ? {} : { deniedModels: loaded.config.deniedModels }),\n      ...(loaded.config.forbiddenSafetyClasses === undefined\n        ? {}\n        : { forbiddenSafetyClasses: loaded.config.forbiddenSafetyClasses }),\n    },\n  );\n  const entitled = await engineEntitled();\n  const plannedRuns = candidates.filter((candidate) => !candidate.static_rejection).length * approved.length * 5;\n  const estimatedCeiling = candidates\n    .filter((candidate) => !candidate.static_rejection)\n    .reduce((sum, candidate) => sum + candidate.estimated_cost_usd_per_run * approved.length * 5, 0);\n  process.stdout.write(`search ceiling: $${estimatedCeiling.toFixed(4)} public-catalog estimate · ${plannedRuns} runs\\n`);\n  const sandboxConformance = await verifySandboxConformance();\n  if (!sandboxConformance) throw new Error(\"cave_sandbox_conformance_failed\");\n  const privacyConformance = contextIRIsContentBlind(lowered.ir);\n  if (!privacyConformance) throw new Error(\"cave_privacy_conformance_failed\");\n  const conversations = new Map<string, ConversationState>();\n  const result = await compileAndWrite({\n    agent: loaded.agent,\n    contextIR: lowered.ir,\n    evals: loaded.evals,\n    candidates,\n    baselinePlan: baseline,\n    seeds: [1, 2, 3, 4, 5],\n    config: loaded.config,\n    entitled,\n    sourceSha256: loaded.sourceSha256,\n    catalogSha256: CATALOG_SHA256,\n    transformRegistrySha256: transformRegistry.sha256,\n    runtimeVersion: FRAMEWORK_VERSION,\n    adapterVersion: PI_ADAPTER_VERSION,\n    upstreamVersion: PI_UPSTREAM_VERSION,\n    runner: async ({ plan, eval: fixture, seed, signal }) => runFixture(\n      root,","sourceCodeStart":732,"sourceCodeEnd":768,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/agent/src/cli.ts#L732-L768","documentation":"After sandbox conformance, the CLI runs contextIRIsContentBlind(lowered.ir) to guarantee the compiled context IR contains no raw content — CAVE builds must be content-blind (only handles/hashes, no payload text). If the lowered IR fails this privacy check, the build is aborted with this coded error.","triggerScenarios":"A build whose context IR contains content-bearing segments/fields, so contextIRIsContentBlind() returns false — e.g. a context definition embedding literal conversation text, secrets, or payload bodies instead of references/handles.","commonSituations":"Authoring a context that inlines user data or API keys into IR fields; adding a new IR segment type that the content-blind verifier flags; migrating a context from a template that carried raw text.","solutions":["Remove raw content from the context definition; reference bodies via handles instead of embedding text.","Re-run the build; only structural/metadata fields should remain in the IR.","If a newly added field triggers it, mark/structure it as content-blind per the IR schema.","Audit any recently changed context files with git diff to find what introduced content."],"exampleFix":"// before\ncontext: { system: \"You are helping user {{user.name}} with {{user.notes}}\" }\n// after\ncontext: { system: HANDLE(\"system_prompt\"), userNotes: HANDLE(\"user_notes\") }","handlingStrategy":"type-guard","validationCode":"// ensure context fields reference handles, not raw text\nfor (const [k, v] of Object.entries(contextDefinition)) {\n  if (typeof v === \"string\" && v.length > 64 && !v.startsWith(\"handle:\")) {\n    throw new Error(`context field ${k} looks like inline content; use a body handle`);\n  }\n}","typeGuard":"const isHandle = (v: unknown): v is { handle: string } =>\n  typeof v === \"object\" && v !== null && typeof (v as { handle?: unknown }).handle === \"string\";","tryCatchPattern":"try {\n  await build();\n} catch (err) {\n  if (String(err?.message) === \"cave_privacy_conformance_failed\") {\n    console.error(\"Context IR contains raw content; replace with handles/hashes\");\n  }\n  throw err;\n}","preventionTips":["Never inline user data, prompts, or secrets into context definitions.","Lint context files to flag long literal strings.","Review any new IR segment types against the content-blind requirement.","Keep bodies separate and referenced by handle only."],"tags":["privacy","security","context-ir"],"backgroundTag":"schema-validation-failed","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}