Skip to content

Foreign-Agent Compatibility

Several popular agent tools expose a “skip all permissions” flag under their own vocabulary. Wayland Core accepts those values as aliases for SessionMode::Force at the wire level, so a host written for Claude Code, Codex CLI, or Gemini can embed wcore as a drop-in engine without renaming anything.


SessionMode is defined in crates/wcore-protocol/src/commands.rs:113. The canonical serialized value is "force" (from #[serde(rename_all = "snake_case")]). Four additional aliases are accepted on deserialization only, via #[serde(alias = "...")]:

#[derive(Debug, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum SessionMode {
Default,
AutoEdit,
#[serde(
alias = "yolo",
alias = "dangerously_skip_permissions",
alias = "dangerously-skip-permissions",
alias = "dangerously_skip_sandbox_and_permissions"
)]
Force,
}

All five of these set_mode commands deserialize to SessionMode::Force:

{"type":"set_mode","mode":"force"}
{"type":"set_mode","mode":"yolo"}
{"type":"set_mode","mode":"dangerously_skip_permissions"}
{"type":"set_mode","mode":"dangerously-skip-permissions"}
{"type":"set_mode","mode":"dangerously_skip_sandbox_and_permissions"}

This is verified by five round-trip tests at commands.rs:316-378.


Wire valueSource
"force"Canonical wcore value
"yolo"Gemini CLI (--yolo flag surface)
"dangerously_skip_permissions"Claude Code (snake_case form)
"dangerously-skip-permissions"Claude Code (kebab-case form)
"dangerously_skip_sandbox_and_permissions"Codex CLI

SessionMode::Force sets the ToolApprovalManager’s mode so that is_auto_approved_cmd returns true for every tool category ("info", "edit", "exec", "mcp"). The engine never emits a tool_request event for human approval; all tool calls execute immediately.

This is equivalent to passing --force on the command line, which sets Force mode before the session loop starts (main.rs:2044-2046):

if force {
approval_manager.set_mode(wcore_protocol::commands::SessionMode::Force);
}

A set_mode command sent at runtime has the same effect and takes effect immediately for all subsequent tool calls in the session.


The aliases exist only on the deserialization path. When the engine serializes SessionMode::Force (for example, in ready.capabilities.current_mode or ready.capabilities.modes), it always emits "force", never any alias. A host that reads modes[] or current_mode to build a UI dropdown will see "force", not "yolo" or "dangerously_skip_permissions".

This is a deliberate design choice (DECISIONS.md §D1): "force" is the canonical name; the aliases are a decode-only compatibility shim so foreign hosts do not need to translate their existing vocabulary before sending a set_mode command.


The full SessionMode enum has three variants, all accepted at the wire level:

Wire valueRust variantApproval behavior
"default"DefaultAll tool categories require explicit tool_approve
"auto_edit"AutoEdit"info" and "edit" are auto-approved; "exec" and "mcp" require approval
"force" (+ aliases)ForceAll categories auto-approved; no tool_request events emitted

"auto_edit" has no foreign-agent aliases; it is a wcore-native mode with no equivalent in the tools that inspired the Force aliases.


When running wayland-core acp serve, the --allow-all-tools flag sets SessionMode::Force for the engine session:

Terminal window
wayland-core acp serve --bind 127.0.0.1:8080 --allow-all-tools

Anyone who can reach the server with the configured API key can run arbitrary tools. This flag is off by default. Evidence: wcore-cli/src/acp.rs:24-131.