diff --git a/crates/mcp/src/tests/agents.rs b/crates/mcp/src/tests/agents.rs index 5a9c7a774e..0453cd552f 100644 --- a/crates/mcp/src/tests/agents.rs +++ b/crates/mcp/src/tests/agents.rs @@ -165,6 +165,10 @@ fn a_headless_agent_session_without_usable_folders_reads_and_writes_nothing() { std::fs::write(&outside, r#""#).unwrap(); let e = b.call("app.open", json!({"path": outside.to_string_lossy()})).unwrap_err(); assert!(e.contains("read authority is absent"), "{e}"); + let saved = dir.file("saved.svg"); + let e = b.call("app.save", json!({"path": saved.to_string_lossy()})).unwrap_err(); + assert!(e.contains("write authority is absent"), "{e}"); + assert!(!saved.exists(), "the refused save must not write the file"); // With Allow Agent Control off, the session is the ordinary headless fallback, as before. fn control_off(dir: &Path) -> AgentSettings {