The experimental TUI tools (client MCP) give the model a tui_write_terminal
tool that types text into the user's live terminal, which runs commands when
the text ends in a newline. It was only checked as action
tui_write_terminal, which the base '* allow' policy permits, so shell ask and
deny rules (and Console policies that block shell) never applied: a
prompt-injected model could run commands in the user's interactive shell with
no prompt.
The MCP tool wrapper now also asserts the shell permission for
tui_write_terminal, with the typed text (trimmed) as the resource and save
pattern, the same shape the shell tool uses for its commands. The existing
tui_write_terminal assertion stays, so rules written against it keep working.
The experiment description now says the agent can type commands into
terminals.
Verified: new mcp-attach case proves shell '*' deny blocks the call before it
reaches the client, a 'rm *' deny blocks rm while shell '*' allow lets ls
through; it fails with the shell assertion removed and with the resource
replaced by '*'. bun typecheck (core, tui), core mcp-attach/mcp/permission
tests, server client-mcp tests and bun run check pass.