Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

docs: record why unattended CoS agents keep full-bypass permissions instead of vendor auto-approve modes

Adam Eivyfe82896895f3
diff --git a/docs/README.md b/docs/README.md
index 72001a8d31..76c2da1711 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -73,6 +73,7 @@ Comms & voice: [beeper](./features/beeper.md) · [messages-browser-send](./featu
- [Music Video render-grade validation](validation/9302-music-video-grade.md) — synthetic encoder parity, visual references, and remaining generated-shot acceptance.
- [Explicit Music Video render pools](decisions/2026-10-04-music-video-render-pools.md) — proposed initial shot placement and supplied-audio conditioning; final composition export remains local.
+- [CoS agent permission posture](decisions/2026-10-06-cos-agent-permission-posture.md) — why unattended agents keep full-bypass instead of vendor auto-approve modes, and where stricter modes apply.
- **[plans/](./plans/README.md)** — dated design plans (`YYYY-MM-DD-<slug>.md`), archived on approval before implementation. Historical records, not living docs. See [provider connections and harnesses](./plans/2026-09-06-provider-connections-and-harnesses.md) for stable executable routes, migration and management flows.
- **decisions/** — ADRs (`YYYY-MM-DD-<slug>.md`), e.g. the [Postgres-as-primary-datastore decision](./decisions/2026-06-07-postgres-as-primary-datastore.md) and what may cross the federation layer ([user-controlled federation](./decisions/2026-09-19-user-controlled-federation.md), [Privacy Center storage](./decisions/2026-08-08-privacy-records-machine-local.md), [federated visual prompts](./decisions/2026-08-20-federated-visual-prompts.md), [conditioning crosses to an allowlisted peer](./decisions/2026-08-22-federated-media-input-assets.md), [AI usage metrics federate on by default](./decisions/2026-09-01-federated-usage-metrics.md), [Eidoverse guest chat](./decisions/2026-09-05-eidoverse-guest-chat.md), [numeric PortOS quality federation](./decisions/2026-09-10-portos-quality-federation.md), [federated Eidoverse foundations](./decisions/2026-09-18-federated-eidoverse-foundations.md)), why H3 [ships the draft-decode gates without an asset](./decisions/2026-08-30-h3-draft-decoder-asset.md), and why closed-set decisions run on a [local entailment model that abstains](./decisions/2026-09-18-local-jev-decision-service.md).
diff --git a/docs/decisions/2026-10-06-cos-agent-permission-posture.md b/docs/decisions/2026-10-06-cos-agent-permission-posture.md
new file mode 100644
index 0000000000..14b309da32
--- /dev/null
+++ b/docs/decisions/2026-10-06-cos-agent-permission-posture.md
@@ -0,0 +1,69 @@
+# ADR: Keep full-bypass permissions for unattended CoS task agents
+
+**Date:** 2026-10-06
+**Status:** Accepted — no change to the default posture
+
+## Question
+
+CoS task agents launch with each vendor's "skip every approval" switch
+(`claude --dangerously-skip-permissions`, `codex --dangerously-bypass-approvals-and-sandbox`,
+`agy --dangerously-skip-permissions`, grok `--permission-mode bypassPermissions`,
+cursor `--force`, kimi TUI `--yolo`). Several vendors now ship a middle mode
+that auto-approves routine actions and gates the rest: Claude Code
+`--permission-mode auto` (a classifier judges each action), Codex
+`--approve-for-me` (automatic review inside a workspace-write sandbox), and
+`acceptEdits`-class modes. Should unattended agents move to those?
+
+## Decision
+
+**No — bypass stays the default for unattended CoS agents.** An approval mode is
+only safer when something can answer the escalation. A CoS agent has nobody to
+answer it ([ETHOS.md](../../ETHOS.md): unsupervised operation is the design
+target), so a blocked action is not "asked and resolved", it is a stalled or
+failed run.
+
+## Why
+
+- **A denial is a dead end.** In headless `-p` / PTY runs a classifier block or
+ sandbox denial either aborts the session after repeated blocks or leaves the
+ agent retrying around the refusal. The Completion Workflow routinely does what
+ such classifiers treat as sensitive: `git push`, `gh pr merge --delete-branch`,
+ deleting a remote branch, hitting PortOS's own API with `PORTOS_API_TOKEN`,
+ `npm`/`gh` network access. Each would become a flaky stop with no operator.
+- **Codex's `--approve-for-me` runs in a workspace-write sandbox**, which
+ withholds the network the agent needs for `gh`, `git push`, and installs.
+ Claude's sandbox posture is already used where it fits: the *public-review*
+ recipes (`CLAUDE_PUBLIC_REVIEW_*` in `server/lib/providerVendors.js`) pin
+ `plan`/`acceptEdits` plus an OS sandbox because that stage handles untrusted
+ PR content and needs no network.
+- **Auto mode is not universally available.** Claude's classifier depends on
+ plan, model, and API provider; local-model wrappers (Ollama/LM Studio) and
+ third-party endpoints do not have it. A fleet-wide default would silently
+ differ per provider, and agy has only bypass or `--sandbox` (terminal
+ restrictions, no auto-approve tier).
+- **Containment already lives in the harness**, not the approval prompt: an
+ isolated git worktree per task, the guarded `pm2` shim
+ (`server/lib/agentGuard/`), `commandSecurity.js` policies, loopback-scoped
+ `PORTOS_API_TOKEN`, and the no-public-exposure rule in AGENTS.md. A classifier
+ adds latency, token cost, and non-determinism on every tool call without
+ covering a threat those guards do not.
+- **Honest limit:** bypass means an agent that is prompt-injected by repo or web
+ content can act with the host user's privileges. That is the accepted
+ single-user trust model; the mitigation is the guards above and keeping
+ untrusted-content stages (public review) on the hardened recipes, not an
+ approval prompt nobody reads.
+
+## Where a stricter mode is appropriate
+
+- Untrusted-content stages: already `plan` / `acceptEdits` + sandbox.
+- A user who wants auto mode for an interactive-attached session can pin it in
+ `provider.args`. Codex and kimi already skip their injected bypass when the
+ argv declares a posture (`codexHasApprovalPolicy`); the Claude headless
+ builder (`claudeSpawnArgs`) always prepends `--dangerously-skip-permissions`,
+ so that override is not yet honored — tracked as a follow-up.
+
+## Revisit when
+
+A vendor's auto mode runs headless with a documented non-aborting fallback, works
+on every provider PortOS routes to, and permits the network/git operations the
+Completion Workflow needs without per-action escalation.