2 Commits
Author SHA1 Message Date
sorcnr a444b27835 fix(security): close traversal/symlink, injection and unsafe-install gaps
Audited by clean-context subagents across three rounds; every finding fixed and
re-verified.

- F1 path traversal: sessionId allowlist + lexical & realpath containment;
  refuse a symlinked run root, symlinked run dir, and any symlinked run file
  (lstat-based, dangling-safe)
- F2 command injection: no shell interpolation of session ids — server-derived
  $SESSION_ID, quoted; lint scans agent files AND command templates (incl.
  backslash line-continuations)
- F3 read-only guardrail: per-agent deny list (real permission actions),
  fail-closed when the permission API is unavailable
- F4 stored prompt injection: sanitised run-state injection (phase allowlist,
  validated dir name, no raw newlines/paths)
- F5 installer is non-destructive by default (refresh opt-in via --refresh)
- F6 refuse symlinked/JSONC configs; string-aware comment/trailing-comma strip
- F8 create-only reference copy on plugin load
- add team/security-auditor agent + docs/GUARDRAILS.md + guardrail lint rules
2026-10-12 02:53:25 +03:00
sorcnr 1d6ffee130 feat: OpenCode V2 port of opencode-teamwork
Port the V1 opencode-teamwork plugin to the OpenCode V2 plugin API.

- plugin now default-exports { id, setup } and registers the 7 /team* commands
  via ctx.command.transform (V1 config-hook injection no longer exists)
- agents moved to markdown files under agents/team/ (V2 plugins cannot add agents)
- command templates converted from {{ }} handlebars to $ARGUMENTS
- agent permissions converted to the V2 permissions array (edit/shell/webfetch/subagent)
- no runtime dependency on @opencode/plugin

Verified against OpenCode v2.0.26.
2026-10-11 17:24:21 +03:00