Claude при чтении недоверенных документов запускается без MCP-коннекторов и только с Read и Bash

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 19:27:12 +03:00
parent 85f781b9fe
commit 48c8b372bd
4 changed files with 12 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import { tmpdir } from "node:os";
import { join } from "node:path";
import type { Logger, Pool } from "khb_common";
import type { ClaudeRunner } from "./claude-runner.js";
import { UNTRUSTED_DOC_ARGS } from "./claude-runner.js";
import type { DriveStore } from "./drive.js";
import { normalizeVendorName, parseAmount, resolveProject } from "./invoices-mail.js";
import type { SlackApi, SlackFile, SlackMessage } from "./slack.js";
@@ -215,7 +216,7 @@ async function recognize(deps: ReceiptsDeps, file: SlackFile, bytes: Buffer): Pr
try {
const path = join(dir, `receipt.${extOf(file)}`);
await writeFile(path, bytes);
const res = await deps.claude({ prompt: buildReceiptPrompt(path), cwd: dir });
const res = await deps.claude({ prompt: buildReceiptPrompt(path), cwd: dir, extraArgs: UNTRUSTED_DOC_ARGS });
if (!res.ok) throw new Error(`Claude не отработал (код ${res.exitCode}${res.timedOut ? ", таймаут" : ""}): ${res.stderr.slice(0, 200)}`);
return parseReceiptRecognition(res.stdout);
} finally {