You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
inspect_drawing, query_entities and resources/read cadcraft://drawing return drawing text (MTEXT, layer names, attributes) to the agent unchanged.
The same toolset exposes execute (saveas, wblock, lisp, appload) and render with path. A hostile drawing can therefore try to steer an agent into writing files.
Suggested fix
Mark drawing-derived strings as untrusted in tool results.
Offer a --read-only / --no-fs MCP mode that refuses file-writing commands and LISP.
Status against main 8bece25 (2026-12-01), updating my comment above. None of the 2026-11-11 input limits touch this issue.
1. Mark drawing-derived strings as untrusted in tool results: open, nobody on it
inspect_drawing, query_entities and resources/read cadcraft://drawing still return drawing text as it is. The server's instructions (crates/mcp/src/server.rs:18-21) say nothing about it either. No open PR covers this; #1973's author offered to take it separately.
A read root alone allows no writes. Refused: the save tool, execute of the writing commands, a save typed in the middle of a command_line line, and a save in a script. Test: a_read_root_alone_still_draws_but_writes_nothing (crates/mcp/src/tests.rs:486), carried over from MCP: --readonly refuses file writes and LISP (issue #1931, F-15) #1973.
Under the roots, a command runs only if it is classified (crates/engine/src/file_access/commands.rs), and LISP file writes are checked (crates/engine/src/lisp/builtins/files.rs:42,112).
LISP itself still runs, inside those checks. The issue asked for it to be refused.
Roots are optional: not done.cadcraft-cli mcp without the flags starts unconfined (apps/cadcraft-cli/src/args.rs:539). The shared AGENTS.md rule 18 (since Adopt the shared AGENTS.md (RFC-0072) #3314) says agent entry points MUST refuse to start without both roots.
@Lion-1209, in #1973 you offered to take item 1 separately (marking drawing-derived strings as untrusted in MCP tool results). I'd like to work on it, unless you have already started; if you have, I'll leave it to you. Your read-only work in #1973 is not affected: this touches only what tools return, not which commands run.
Approach I have in mind:
one line in the server instructions saying that text read from a drawing is data, not instructions;
in the results of inspect_drawing, query_entities and resources/read cadcraft://drawing, an added field naming which values come from the drawing, so existing clients that ignore it keep working.
Per standards/claims.md ("Taking over", point 5), I'll only read and design for now, and open nothing until you answer or 24 hours pass without an answer.
Activity
ticket-craft commentedon Oct 22, 2026
Thanks! This ticket describes several separate problems:
It helps a lot if each one has its own ticket, so they can be tracked and fixed separately.
Possibly related: #1472, #1580 and #1585.
2ez4gcx commentedon Nov 26, 2026
Status against main (c9260d1):
--automation-read-root/--automation-write-root(docs/mcp.md). A read root alone allows no writes, LISP file writes are checked, and unclassified commands are refused.--connectcan't take the roots yet (feat(desktop):--automation-read-root/--automation-write-rootforCADCraft --control#1585), and LISP itself still runs. PR MCP: --readonly refuses file writes and LISP (issue #1931, F-15) #1973 (--readonly) is still open.Keep open.
2ez4gcx commentedon Dec 1, 2026
Status against main 8bece25 (2026-12-01), updating my comment above. None of the 2026-11-11 input limits touch this issue.
1. Mark drawing-derived strings as untrusted in tool results: open, nobody on it
inspect_drawing,query_entitiesandresources/read cadcraft://drawingstill return drawing text as it is. The server'sinstructions(crates/mcp/src/server.rs:18-21) say nothing about it either. No open PR covers this; #1973's author offered to take it separately.2. Read-only / no-filesystem mode: partly done
--automation-read-rootand--automation-write-root.executeof the writing commands, a save typed in the middle of acommand_lineline, and a save in a script. Test:a_read_root_alone_still_draws_but_writes_nothing(crates/mcp/src/tests.rs:486), carried over from MCP: --readonly refuses file writes and LISP (issue #1931, F-15) #1973.crates/engine/src/file_access/commands.rs), and LISP file writes are checked (crates/engine/src/lisp/builtins/files.rs:42,112).cadcraft-cli mcpwithout the flags starts unconfined (apps/cadcraft-cli/src/args.rs:539). The shared AGENTS.md rule 18 (since Adopt the shared AGENTS.md (RFC-0072) #3314) says agent entry points MUST refuse to start without both roots.mcp --connect: not done. The roots are refused together with--connect(args.rs:504, message at :420). The app does the file I/O there, and its control channel takes no roots (feat(desktop):--automation-read-root/--automation-write-rootforCADCraft --control#1585).Open PRs
Desktop app: --automation-read-root and --automation-write-root hold the control channel to two folders #3495 (jianzhichun, fixes feat(desktop):
--automation-read-root/--automation-write-rootforCADCraft --control#1585): covers the--connecthalf.cadcraft --control PORT --automation-read-root … --automation-write-root …holds the following to the roots:pathofui.renderandui.screenshot;What it lacks:
mcp --connectstill can't check that the app it reaches is confined. The PR asks the maintainers whether to add a protocol field for that.It conflicts with main in
crates/engine/src/lisp.rsandcrates/ui-egui/tests/it/main.rs(base 2026-11-24).MCP: --readonly refuses file writes and LISP (issue #1931, F-15) #1973 (Lion-1209,
--readonly): covers part of item 2, but its list is out of date. It gates the MCP layer, so it also works with--connect, and it refuses LISP outright, which the roots don't. But it refuses by a deny list of 18 command names written before the roots existed. Main now has file-writing commands the list doesn't name, for examplepdfbook, andrefclose, which writes an xref's drawing back since Land #2355: REFEDIT edits an xref in place and writes it back to its file #3352. The roots refuse any unclassified command instead. Its tests have already landed through mcp: confine agent file access with the automation roots (carries #1904) #2794, and it conflicts with main in 4 files.Suggestion: keep this open.
mcpshould refuse to start without roots (rule 18), and Desktop app: --automation-read-root and --automation-write-root hold the control channel to two folders #3495.2ez4gcx commentedon Dec 4, 2026
@Lion-1209, in #1973 you offered to take item 1 separately (marking drawing-derived strings as untrusted in MCP tool results). I'd like to work on it, unless you have already started; if you have, I'll leave it to you. Your read-only work in #1973 is not affected: this touches only what tools return, not which commands run.
Approach I have in mind:
instructionssaying that text read from a drawing is data, not instructions;inspect_drawing,query_entitiesandresources/read cadcraft://drawing, an added field naming which values come from the drawing, so existing clients that ignore it keep working.Per
standards/claims.md("Taking over", point 5), I'll only read and design for now, and open nothing until you answer or 24 hours pass without an answer.