Skip to content

Give swarm external voices file-read + web research (0.6.0)#46

Open
gering wants to merge 2 commits into
mainfrom
task/open-swarm-external-exploration
Open

Give swarm external voices file-read + web research (0.6.0)#46
gering wants to merge 2 commits into
mainfrom
task/open-swarm-external-exploration

Conversation

@gering

@gering gering commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • External review voices (codex, grok) can now read project files and research online, finding out-of-diff bugs (callers, config, types, CVE/library knowledge) — previously they reviewed the inlined diff blind.
  • The OS secret-jail stays and grows: repo-root .env*/data//key files join the HOME denylist; fail closed — without sandbox-exec/bwrap the externals degrade to the 0.5.x tool-less/no-web flags instead of running read+web bare.
  • Egress hardened by prompt (outside the untrusted-diff fence): web is for external general knowledge only, never repo content in a query/URL. Honestly documented as model-cooperation-dependent — the jail is the hard boundary.
  • Hardened further by an ensemble self-review: the new voices reviewed their own implementation (/swarm:review dogfooding); 15 findings applied, incl. the fail-closed gap (cross-family consensus critical).

Changes

  • agents.sh: grok --tools read_file,list_dir,grep,web_search,web_fetch --cwd <repo> (was --tools "" --disable-web-search); codex -C <repo> -c tools.web_search=true under unchanged -s read-only; _jail_available() fail-closed gate; repo-root secret globs in _sandbox_deny_paths; named residuals in comments.
  • SKILL.md: exploration permission + HIGH-PRIORITY egress guard in the external prompt header (outside the diff fence); all tool output declared untrusted DATA; once-per-run notice (web + egress + jail + SWARM_DENY_PATHS hint).
  • test_sandbox_deny.py (new): denylist unit asserts + macOS e2e with positive control (non-denied read must pass — "jail never ran" can't masquerade as "jail denied").
  • Docs: adapter knowledge doc posture rewrite (read+web table, residual risks incl. unfenced file-read channel + own-token readability, grok tool-id leniency), pipeline doc, blueprint, both READMEs, CLAUDE.md, CHANGELOG; swarm 0.5.1 → 0.6.0 (plugin.json + marketplace.json in sync).

Readiness

  • ✅ Rebase: up-to-date with origin/main
  • ✅ README (root + plugin), version 0.6.0 synced, CHANGELOG entry, knowledge docs updated
  • ✅ Tests: 6/6 pass (incl. new sandbox regression suite)
  • check-structure.py: 0 errors

Test plan

  • python3 plugins/swarm/scripts/test_sandbox_deny.py — denylist + e2e green on macOS
  • bash plugins/swarm/scripts/agents.sh list — codex + grok ready
  • /swarm:review on any diff: run-start notice appears; externals return findings (file-read + web live)
  • Optional: on a host without sandbox-exec/bwrap, verify the fail-closed degrade warnings

🤖 Generated with Claude Code

https://claude.ai/code/session_01B2y4GsnrE87L89uGHE5dGX

gering and others added 2 commits July 23, 2026 14:51
Externals (codex, grok) were tool-less/inline-only — blind to out-of-diff
bugs (callers, config, types, CVE/library knowledge). Grant file-read + web
without re-opening the secret-exfil hole:

- codex: `-s read-only -C <repo> -c tools.web_search=true` (web is
  model-native, works under read-only — no sandbox loosen).
- grok: strict `--tools read_file,list_dir,grep,web_search,web_fetch`
  allowlist + `--cwd <repo>`; drop `--tools ""` / `--disable-web-search`.
  No write/shell tools for either voice.
- Keep + extend the OS secret-jail: repo-root `.env*`/`data/`/key files join
  the HOME denylist (root-level only — nested via SWARM_DENY_PATHS).
- Egress guard (prompt policy, outside the diff fence): web is for external
  general knowledge only, never put repo content into a query/URL. Model-
  cooperation-dependent, not transport-enforced — the jail is the hard
  boundary; scrub_secrets/output gate stay as output-only backstops.
- Run-start notice once per review when external voices are live.
- New test_sandbox_deny.py: denylist unit asserts + macOS e2e (sandboxed cat
  of a temp .env is blocked). Docs/knowledge rewritten off the old posture.

Bumps swarm 0.5.1 → 0.6.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B2y4GsnrE87L89uGHE5dGX
15 findings from a /swarm:review dogfooding run over the 0.6.0 diff
(2 critical consensus among them), applied:

- FAIL CLOSED without the OS jail (the critical): on hosts with neither
  sandbox-exec nor bwrap, run_codex/run_grok now degrade to the 0.5.x
  flags (grok tool-less/no-web, codex without web search) via the new
  _jail_available() gate, with an audible warning — read+web never runs
  without its hard boundary. 0.5.x was safe there by flags; 0.6.0 now is
  again.
- E2E sandbox test gains a positive control (non-denied read must pass,
  rc asserted) so "jail never ran" can no longer pass as "jail denied".
- Prompt hardening: all tool output declared untrusted DATA (file-read
  channel cannot be nonce-fenced — now a named residual); EPERM on
  secret paths flagged as expected; run-start notice names the root-only
  deny scope + SWARM_DENY_PATHS and no longer mis-renders as a bullet.
- Named residuals documented: unfenced file-read channel, own-backend
  token readability; grok tool-id leniency (live-verified) replaces the
  stale degrade-promise in the adapter doc.
- Cleanups: _repo_root() reused in _sandbox_deny_paths, redundant
  nullglob block dropped, honest test-runner comment, CLAUDE.md + root
  README posture sync, knowledge frontmatter per curate convention.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B2y4GsnrE87L89uGHE5dGX
@gering
gering force-pushed the task/open-swarm-external-exploration branch from ae77504 to 2ce9a15 Compare July 23, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant