Agent contract: boundaries
Doc status: current contract. Full text moved verbatim from AGENTS.md on 2026-11-11 (the Boundaries section). Checked 2026-11-11.
This file is part of the binding contract of AGENTS.md and binds exactly as it does. AGENTS.md
keeps the short rule and points here; when the two differ, this file wins, and a change to one
updates the other in the same commit. The headings below are the sections of AGENTS.md that held
this text until 2026-11-11, so references such as "AGENTS.md, Host/core maintenance" resolve here.
Boundaries
Each bullet is the short invariant of its feature. Where a bullet points to a section Binding contract (from AGENTS.md) of a doc, that section holds the full text that AGENTS.md had until 2026-11-10, with its dates, owner quotes, phases and exceptions, and it binds exactly as AGENTS.md does. When the summary here and that section differ, the section wins; a change to one updates the other in the same commit.
- web-shell/core/: Node core, persistence, OpenCode and narrow tools.
- web-shell/host/: protected controls and recovery; maintenance by the authenticated agent follows openspec/specs/self-maintenance/spec.md. Generated HTML and the editable UI do not receive this authority.
- Inline interactive HTML responses are central. Do not replace them with escaped code, a simple color change or a separate window. Pinning an inline component beside the chat is additional and implemented as a protected host control (see openspec/specs/interaction-decisions/spec.md, section Pinned surfaces). Generated HTML cannot pin, unpin or resize itself. Collapsing and placing pins on the window grid are not implemented.
- web-shell/core/surfaces.js and host/surface.js: publishing and isolation of the inline components, without editing the shell.
- web-shell/ui/: seed of the visual project. The runtime copy has only index.html, style.css and app.js.
- web-shell/desktop.cjs: Electron host, renderer without Node, no privileged preload, sandbox/context isolation and navigation/network restrictions.
- The user authorized starting any executable by name in the PATH or by absolute path, with separate arguments and working directory. The catalog is optional discovery, never an allowlist. Execution has the privileges of the system user; do not claim a sandbox for launched processes. Mouse/keyboard automation is not implemented. The narrow tools desktop_state, open_application, window_action and arrange_windows are authorized to manage real Smithay windows. set_window_style customizes the outer window frames through typed parameters. The shell and recovery always stay without a window frame. Generic execution belongs only to the authenticated maintenance tools; do not grant it to generated HTML and do not simulate control of application content. Credentials stay in the existing OpenCode storage.
- The user authorized ChatGPT login through the UI. The agent and the helper use the same selected model: native OpenCode models at zero cost, or ChatGPT plan models after OAuth confirmed by OpenCode. Never accept an API key or a paid fallback. Do not copy credentials from other applications and do not pass them to the renderer.
- The user authorized a catalog of installed applications and local operations through conversation. list_applications queries desktop shortcuts; open_application accepts arbitrary executables and optionally their IDs, list_directory lists names and open_path asks the associated application to open the path. The core resolves shortcuts and paths. Do not confuse a dispatched request with a confirmed window and do not grant these tools to generated HTML. Other system operations still need their own implementation.
- Scheduled intents (core/schedules.js, openspec/specs/scheduled-intents/spec.md): the core sends the stored prompt as a normal turn marked as scheduled. The tools schedule_list/create/update/delete are authenticated and only propose changes; the protected host approves them. Nothing is auto-approved, and a scheduled turn cannot change schedules. Do not grant these tools to generated HTML.
- Generated code runs only in the isolated renderer; node:vm is used only for syntax analysis, never as an execution sandbox.
- read_window_text (core/window-text.js) reads the AT-SPI text of one window, read-only, only after the user allows that window in the protected settings. Consent is per window and in memory only. Do not grant it to generated HTML.
- Window capture ("Mostrar ao agente", docs/capture-tty4.md): only the user starts a capture of the focused window from the protected composer and sees it before sending. The agent cannot start a capture.
- User screenshots (openspec/specs/screenshots/spec.md): only user input starts one (the compositor keys, the
protected
screenshotpanel, the protected quick settings button, or a hot corner set toscreenshot). No agent tool, MCP entry, generated HTML, plugin panel or scheduled turn can start one, read one or get the pixels; pixels never enter the state JSON, logs or the model context, the core deletes the full-output PPM after it reads it, and there is no screenshot while locked (a lock during the UI closes it without saving). Full text: openspec/specs/screenshots/spec.md, section Binding contract (from AGENTS.md). - Wallpaper effect (openspec/specs/hex-crystals-wallpaper/spec.md): only the protected settings choose
wallpaperEffectthrough/api/wallpaper-effect, which writes the entry of the active window theme inwallpaperByTheme; the change of theme also sets the wallpaper (the entry, or the default of the theme), through the same function as the route. The wallpaper page only reads the cookie-only streamGET /desktop-wallpaper/events(effect, palette, legibility regions, Canvas camera) in its own partition, and only the protected chat host and the recovery page report text regions. No agent tool, MCP entry, scheduled turn, generated HTML or plugin panel reaches the setting, the routes or the stream. Full text: openspec/specs/hex-crystals-wallpaper/spec.md, section Binding contract (from AGENTS.md). - Black-hole wallpaper and close effect (openspec/specs/hex-crystals-wallpaper/spec.md, openspec/specs/black-hole-close/spec.md):
the core projects only normalized pointer fractions (no buttons, window identities or raw state)
into the wallpaper stream, only while unlocked, connected and outside the overview, and forwards
only a typed expiring
wallpaper_sinkcommand from the cookie-only/desktop-wallpaper/sinkendpoint; reduced motion disables the close effect. No agent tool or generated HTML reaches them. Full text: openspec/specs/hex-crystals-wallpaper/spec.md, section Binding contract (from AGENTS.md). - Profile color (openspec/specs/color-palette/spec.md): the protected settings and the first-run card set the main
color through
/api/profile-color; the agent toolsread_profile_colorandset_profile_coloraccept only one#RRGGBBcolor, and the core picks every tone with AA contrast. Generated HTML does not get them. The approval dialogs and the lock screen keep fixed colors. - Compositor visual style (docs/smithay-development.md, Visual style from the core): only the core
sends
visual_style(dark accent, error and background tones of the active palette and the window radius and, withcapabilities.visualStyleInk, the accent and text color of the system mode, withcapabilities.visualStyleShapethe window shape and the three accents of a theme that cuts the windows,capabilities.visualStyle) on the control connection; no agent tool, MCP entry, generated HTML, scheduled turn or plugin reaches it. Without it the compositor keeps the sage values of before. - create_theme (openspec/specs/themes/spec.md) only proposes a theme: the compositor compiles its shaders first, then the user approves it in the protected host. It never overwrites a built-in theme.
- The core is the notification server of the session (openspec/specs/notifications/spec.md). No model tool reads notification content; the protected host shows it.
- The core is the StatusNotifierWatcher and the tray host of the session (openspec/specs/system-tray/spec.md). Only
the protected bar and the protected
tray-menupanel show tray icons and menus and send tray actions; no model tool or generated HTML reads tray content or calls a tray action.system_contexthas only the tray status. XEmbed is not implemented. - Media controls and the per-application mixer (openspec/specs/quick-settings/spec.md) are protected host routes with typed actions on listed players and streams. No agent tool controls them.
- The trash of the Lumen dock (openspec/changes/archive/2026-11-16-dock-theme/specs/desktop-trash/spec.md, design.md D10) is a
core service over GIO (
core/desktop-trash.js). Only the protected bar and the protected paneldock-trash-menuread its state, which is the empty flag and the count, never a name, through/api/dock-trash(shell token, typed actionsopen,empty,cancelandtrash;opentakes no path or URI).emptyonly asks: the Electron main process (desktop.cjs, host main key route/host-trash-confirm, which only it holds) shows the protected confirmation, and only its confirm event makes the core mint a token, random, single use, 30 s, bound to the count shown and the output, which the core redeems itself; no page receives it, and a changed count asks again. A drop sends absolute paths that the bar preload read withwebUtils.getPathForFile, at most 64, and the core trashes by real parent and name (a symlink as the link), never the profile, the checkout, an ancestor of either,$HOME,/or a mount point, skipping a path whose device and inode changed. Every action is refused while locked. No agent tool, MCP entry, scheduled turn, generated HTML or plugin panel reaches the routes, the state, the token or the panel. - Memory policy (docs/web-shell-development.md): the core only proposes closing idle windows; each close needs the user button in the protected host and sends one normal close request.
- Session lock (openspec/specs/lock-screen/spec.md): the core unlocks only after PAM accepts the password from the protected lock page. No agent tool locks or unlocks.
- window_action send_to_output moves a window between monitors with the rules of the other window actions: refused for a held window and while locked.
- Window declarations (openspec/specs/window-layers/spec.md): the compositor takes
window_declare,window_forgetandwindow_statusonly on the host connection, and the core sends them only for the main-key routes/host-windowand/host-window-forget, which the launch key does not open, built from its own templates and registry. No agent tool, generated HTML or trusted page declares, changes or forgets a window, a title or a token, and no title gives a role; a shell lock is refused without a live lock token. An isolated panel chooses only the desktop or hud band below the chat, its order, its space and its input, and a protected panel takes none of these fields; no plugin draws above the chat or takes its input. Full text: openspec/specs/window-layers/spec.md, section Binding contract (from AGENTS.md). - Bar glass (openspec/specs/web-panels/spec.md): the protected bar reports its pill geometry and Smithay draws the
blur behind it. Only the core declares the alpha glass of the protected top bar, the protected
bottom bar (only for the islands of Ninja and the app dock of Lumen) and the protected
notificationspanel; the compositor refuses it on an isolated panel. Generated HTML andweb-panels.jsoncannot set it. Full text: openspec/specs/web-panels/spec.md, section Binding contract (from AGENTS.md). - App dock of Lumen (openspec/specs/ui-themes/spec.md): the protected panels
dock-conversations,app-grid,dock-item-menuanddock-trash-menuand the routes/api/app-dock-region,/api/app-dock-hold,/api/dock-item-menuand/api/dock-trashbelong to the protected bar and the protected panels; no agent tool, MCP entry, scheduled turn, generated HTML or isolated plugin panel reaches them, a plugin cannot take these ids, and the chat document opens neither (panelOpenersofdesktop.cjslists none of them). The dock only focuses, restores or minimizes windows through/api/taskbar-windowand opens applications through/api/applications/open. - Window theme (openspec/specs/ui-themes/spec.md): only the protected settings set
uiThemethrough/api/ui-theme, a closed list that the core validates (office,galaxy,ninjaorlumen, with an ambiance of Ninja's closed list; a storedglassreads asgalaxy, and the route refusesglassas a new value). While Ninja is on, the profile color is its main accent and its surfaces, coral and amber stay fixed;set_profile_colorsays so. The Office taskbar, Start menu, Task View and tray overflow routes and panel ids belong to the protected bar and the protected panels, only the core chooses the bar height (48 px under the Office layout), and besides the bars only the chat document opens a panel, onlydesktop-actionsandworkspace-menu, whiletray-overflowopens onlytray-menu(panelOpenersofdesktop.cjs). These routes are/api/taskbar-window,/api/start-menu,/api/taskbar-pinsand/api/task-view, and only/api/applications/openrecords the recent applications. No agent tool, MCP entry, scheduled turn, generated HTML or isolated plugin panel reaches them, and a plugin cannot take these panel ids. A theme without glass ends the chat glass lease, the regions and the bar glass. Full text: openspec/specs/ui-themes/spec.md, section Binding contract (from AGENTS.md). - Chat glass (openspec/specs/web-panels/spec.md, openspec/specs/glass-alpha-mask/spec.md): only the protected chat host reports
glass regions of the chat window through
/api/desktop-chat-glass-regions, measuring inline frames from outside, and only the core sendschat_alpha_glassfrom the protected settingchatBlur, on the control connection. Generated HTML, agent tools, MCP entries, scheduled turns and plugins cannot set regions or reach the command..inline-surfacestays opaque, except through profile CSS that the agent applies withreplace_ui. On a compositor with alpha glass, translucent chat pixels with alpha of 0.18 or more outside a glass surface become glass, so the trusted chat CSS must keep them out (openspec/specs/css-structure/spec.md, Alpha in the chat window). Full text: openspec/specs/web-panels/spec.md, section Binding contract (from AGENTS.md). - Workspaces on several outputs (openspec/specs/multi-output-workspaces/spec.md, openspec/specs/shared-workspace-cameras/spec.md):
only the protected host moves a workspace to an output or opens or takes off a view, through
/api/workspace-outputand the protectedworkspace-menupanel. The core always renewsworkspace_outputs(no settings toggle) and, with the capabilities,shared_workspaces; its own resends ofworkspacenever open a view, and the login restore of window-session.json validates every field. No agent tool, MCP entry, scheduled turn, generated HTML or isolated plugin panel opens, closes or moves a view or reaches these routes or the panel id, and no route, agent tool, MCP entry, scheduled turn, generated HTML or plugin panel reads or writes the saved assignments. An approval shows in and is answered from only the chat of the agent view. Full text: openspec/specs/multi-output-workspaces/spec.md, section Binding contract (from AGENTS.md). - Overview planes: the protected host reports the card slots of the workspace overview through
/api/overview-planes, and Smithay draws a live plane of each workspace behind the shell window (openspec/specs/canvas-windows/spec.md, phase 2). The protected settingoverviewPlanesturns them off. Generated HTML cannot set them. - Canvas layout (openspec/specs/canvas-windows/spec.md, openspec/specs/super-mode/spec.md): the protected settings
canvas(on by default,/api/canvas-enabled) andcanvasSharpZoomchange only through the protected settings. The camera keys, the Super tap, Super+N and Alt+scroll are compositor input; only the protected host changes the chat dock, its side, its box state and its glass, and only the protected bottom bar calls/api/canvas-organize. The authenticated agent gets only the typed canvas actions of phase 7, under the compositor limits (held windows,user_active,rate_limited,agentWindow), and cannot switch a Canvas workspace to Grid; the accepted exceptions without those limits are thatopen_applicationfocuses and fits the new window, and thatwindow_action minimize,moveandarrange_windows rowcan give the keyboard to another window that shows. Besides the protected host, only the core expands a hidden chat or the box for an approval and sendschat_holdwhile a dialog waits. No agent tool, MCP entry, scheduled turn, generated HTML or plugin panel pans or zooms the camera freely, changes these settings, or reaches the box state, the camera field,new_chator the focus actions. TurncanvasSharpZoomoff before a rollback of the core or the compositor. Full text: openspec/specs/canvas-windows/spec.md, section Binding contract (from AGENTS.md). - A click on a workspace (openspec/specs/canvas-windows/spec.md): only the protected bar calls
/api/workspace-show-all(workspace_show_all), which changes no window and no chat state. No agent tool, MCP entry, scheduled turn, generated HTML or plugin panel reaches it. Full text: openspec/specs/canvas-windows/spec.md, section Binding contract (from AGENTS.md). - A switch during a response (openspec/changes/super-mode/design.md, Phase 3): under the live
workspace_outputslease, a selection of an open workspace by the user runs during a turn, unless a dialog waits or an agentopen_application,open_pathorarrange_windowsruns; create and archive still wait for the turn. Only the core sendsagent_route, so the windows of the turn open on its workspace without the keyboard or a camera move on the workspace of the user. A dialog of a turn that the user left takes the keyboard only after the input rests, and an agentwindow_actionon the chat window of such a turn is refused. No agent tool selects a workspace, and the host names the origin of a card with a fixed line, never from agent text. Full text: openspec/specs/super-mode/spec.md, section Binding contract (from AGENTS.md). - Hot corners (openspec/specs/hot-corners/spec.md): only the protected settings set
hotCornersthrough/api/hot-corners; the core owns the value and sendshot_corners, and the compositor starts with every corner off and runs no corner while locked. No agent tool, MCP entry, scheduled turn, generated HTML or plugin panel reaches the setting, the route or the command. Full text: openspec/specs/hot-corners/spec.md, section Binding contract (from AGENTS.md). - Display off when idle (openspec/specs/idle-display-off/spec.md): only the protected settings set
idleDisplayOffthrough/api/idle-display-off; the core owns the value and the default and sendsidle_display_off, and the compositor starts with no time. Only input of a device resets the idle clock and wakes the display, and the event that wakes is not delivered. No agent tool, MCP entry, scheduled turn, generated HTML or plugin panel reaches the setting, the route or the command, reports activity, turns the display off or on, or holds it on. Full text: openspec/specs/idle-display-off/spec.md, section Binding contract (from AGENTS.md). - Canvas window sizing (openspec/specs/canvas-windows/spec.md, Window-attached controls): only the protected React
window-sizepanel and/api/canvas-sizeresize the focused application, and the compositor owns target and placement. Since 2026-11-12 presets, a drop, a tile assist choice and the client maximize place the window as a tile of the usable area of the output at its pixel size (the side picked from the window center in the visible area) and animate only that view to zoom 1; the 100% logical-monitor cap still applies to pointer resizes, with client minimums respected. The automatic organize of a Canvas workspace (openspec/specs/canvas-windows/spec.md, Automatic organize in Canvas) is a compositor reaction that no agent tool calls. Plugins cannot use this panel id, and no agent tool, scheduled turn or generated HTML receives these controls. Full text: openspec/specs/canvas-windows/spec.md, section Binding contract (from AGENTS.md). - Real full screen (openspec/specs/canvas-windows/spec.md, Binding contract, 2026-11-12): only a client
fullscreen request of the canvas window with the keyboard, made within 5 s of the last user input,
covers an output (xdg Fullscreen state, band
fullscreenbelow protected panels and the lock), and the user ends it with the client, a Super tap, a workspace switch, the overview or another window.desktop_statereports it read only (windows[].fullscreen, the output name or null;capabilities.canvasFullscreen); no agent tool, MCP entry, route, scheduled turn, generated HTML or plugin panel requests or ends it, and no declaration can name the band. Accepted agent effects: aclose,minimize, focus on that output,move,fit, row, size or camera action ends full screen as the same user action would; the agent camera does not move while a window covers that output otherwise. - Tile assist (openspec/changes/archive/2026-11-12-canvas-tile-assist/design.md, decisions 4 to 7 and 10; the spec of the change,
specs/tile-assist/spec.md): only the protected React
tile-assistpanel and/api/tile-assist(the shell token) choose the window for the empty tile that a user drop or preset leaves, or dismiss the assist. The compositor owns the state and the keyboard grant, the core declares the panel only withcapabilities.tileAssist, resolves a choice to a window id only if the identifier is a current candidate of that output, and sendstile_assist_chooseortile_assist_dismiss; the panel names its keys. The assist never opens from an agent action. The statetileAssistand the capability stay out ofdesktop_state,system_contextand MCP, plugins cannot use the panel id or the route, and no agent tool, scheduled turn or generated HTML opens it, reads it or places a window through it. - Canvas lens (openspec/specs/inverted-sphere-view/spec.md): only the protected settings set
canvasWarpthrough/api/canvas-warp(the core refusessphereuntil phase 4), and only the core sends the leasedcanvas_warpcommand. No agent tool, scheduled turn, generated HTML or isolated plugin panel reaches the setting, the route or the command. Turn the setting off before a rollback of the core or the compositor. Full text: openspec/specs/inverted-sphere-view/spec.md, section Binding contract (from AGENTS.md). - These consent flows bind the agent tools and generated HTML. They are advisory against a prompt-injected agent that uses execute_command, which runs as the user; see openspec/specs/self-maintenance/spec.md, section "What a job can still reach".
- Product changes to the interface, window frames, profile color and model go through the trusted process of core/changes.js, with journal, per-profile lock, verification and recovery. Use change_status to query; pending recovery is handled by the host at /recovery. Do not bypass locks and do not edit checkpoints directly through the product agent. This automatic record stays in the data directory; coordination.log stays reserved for external development/installation operations.
- Changes to the product sources go through the review card (openspec/specs/self-maintenance/spec.md, section "Source change review card"): the agent uses change_propose, edits only the proposal worktree and runs the gates with change_submit; only the user approves, in the protected opaque card with fixed colors and a delayed armed button. The gates run code of the proposal, so green proves no safety. Approval fast-forwards the clean active checkout under coordination.lock and takes effect at the next login; it never pushes and never restarts anything. Do not give these actions to generated HTML. Full text: openspec/specs/self-maintenance/spec.md, section Binding contract (from AGENTS.md).
- Overlay of the chat host (openspec/specs/immutable-base/spec.md, The overlay): whole files under
<profile>/overlay/ui-srcreplace base files only for the script and the stylesheet of the chat host, and they run with the whole authority of the host. The agent proposes one withchange_proposeandtarget: "overlay"; only the user approves it, approval only records it, activation is a separate step, a build that no chat document mounts within 60 s goes back, and only the user clears safe mode, in the protected settings. No agent tool, MCP entry, scheduled turn, generated HTML or plugin panel approves, activates or clears;execute_commandruns as the user and can write these files. Full text: openspec/specs/immutable-base/spec.md, section Binding contract (from AGENTS.md). - Preserve the conversation/session when the UI reloads. A preview startup does not prove visual quality, accessibility or the absence of malicious code.
- The only visible send field belongs to the protected host and blends visually into the chat. Recovery stays in the native menu and at /recovery. Do not grant automatic sending or privileged access to generated HTML.