feat: deployment-level no_shell policy (agents.yaml no_shell: true) #3

Merged
r merged 1 commits from feat/no-shell-config into main 2026-07-17 22:43:04 +00:00
Owner

What

Adds a team-level opt-out of fast-agent's shell tool:

  • _fastagent_patch.install_no_shell() — wraps fast_agent.context.initialize_context to stamp no_shell = True on every context it returns. Idempotent, house patch style. Not part of install() — this is deployment policy, not a runtime fix.
  • server.main() — calls it (after setup_logging(), so the install record isn't lost) when the deployment's agents.yaml has a truthy top-level no_shell: key.
  • Version 0.5.1 → 0.5.2.

Why

fast-agent auto-activates its execute shell tool on any agent that has skills configured (MCPAgent._ensure_shell_runtime_for_skills); the access_modes=("skills",) label on that activation is display-only, not a sandbox. The only opt-out is Context.no_shell, which fast-agent's own CLI sets by direct assignment but which has no FastAgent-constructor or config-file knob — and the context is created inside run() before agents are constructed, hence the wrapper.

Skill loading is unaffected: read_skill (pure-Python, path-validated file reader) registers independently of the shell. Verified against both dev fast-agent 0.7.21 and the pinned 0.7.15.

First consumer: iolaus (no_shell: true lands with r/iolaus's piano-coach skill PR — merge this one first, iolaus deploys pallas_rel: main). Deployments without the key are unchanged.

Verified

  • Hypatia (iolaus, skill configured) with this patch: read_skill present, no execute tool, <available_skills> rendered.
  • Startup log shows no_shell patch installed once; no shell-activation notice.
  • Agents without skills (bourdain): unchanged.

🤖 Generated with Claude Code

## What Adds a team-level opt-out of fast-agent's shell tool: - **`_fastagent_patch.install_no_shell()`** — wraps `fast_agent.context.initialize_context` to stamp `no_shell = True` on every context it returns. Idempotent, house patch style. Not part of `install()` — this is deployment policy, not a runtime fix. - **`server.main()`** — calls it (after `setup_logging()`, so the install record isn't lost) when the deployment's `agents.yaml` has a truthy top-level `no_shell:` key. - Version 0.5.1 → 0.5.2. ## Why fast-agent auto-activates its `execute` shell tool on any agent that has skills configured (`MCPAgent._ensure_shell_runtime_for_skills`); the `access_modes=("skills",)` label on that activation is display-only, not a sandbox. The only opt-out is `Context.no_shell`, which fast-agent's own CLI sets by direct assignment but which has no `FastAgent`-constructor or config-file knob — and the context is created inside `run()` before agents are constructed, hence the wrapper. Skill loading is unaffected: `read_skill` (pure-Python, path-validated file reader) registers independently of the shell. Verified against both dev fast-agent 0.7.21 and the pinned 0.7.15. First consumer: iolaus (`no_shell: true` lands with r/iolaus's piano-coach skill PR — merge this one first, iolaus deploys `pallas_rel: main`). Deployments without the key are unchanged. ## Verified - Hypatia (iolaus, skill configured) with this patch: `read_skill` present, **no `execute` tool**, `<available_skills>` rendered. - Startup log shows `no_shell patch installed` once; no shell-activation notice. - Agents without skills (bourdain): unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
r added 1 commit 2026-07-17 18:04:45 +00:00
fast-agent auto-activates its shell execute tool on any agent with
skills configured, and Context.no_shell — the only opt-out — has no
constructor or config knob. Add install_no_shell(), a wrapper on
fast_agent.context.initialize_context that stamps no_shell=True on
every context, installed from server.main() when the deployment's
agents.yaml sets a truthy top-level no_shell: key. Skill loading via
read_skill is unaffected. Default behaviour unchanged for deployments
without the key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
r merged commit 9193b6d385 into main 2026-07-17 22:43:04 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: r/pallas#3