Skip to content

#963 remainder: write-dir confinement, per-Ticket budget caps, host MCP-config scrub #1082

Open
1 of 2 issues completed

Description

@HugoXK

#963 shipped only its first row — the nested-run refusal (PR #1080). The rest of the host-worker guard is still convention, not a tested contract, so a worker that writes outside its allowed dirs or asks for an unbounded run is caught by nothing but review. This is the remainder of #963.

Add write-dir enforcement on every write path:

  • apply AGENTDESCENT_SURFACE_WRITE_DIRS in apply, in show --diff output and in the materialised tree, not only on the MCP surface;
  • reject the write before it touches disk, with a test that a path outside the allowed dirs is refused.

Add host-worker budget defaults:

  • max_calls, max_usd (or max_tokens) and max_concurrency, plus a per-Ticket cap the caller cannot silently exceed;
  • a run that reaches the cap stops with stop_reason=budget (or the existing equivalent) instead of crashing.

Add the child-env scrubbing test:

  • an offline test that the child env carries no host session markers and no host MCP config.

Acceptance: apply outside the allowed write dirs is rejected before disk is touched; a capped run stops with stop_reason=budget rather than crashing; the child env has no host session markers and no host MCP config; all three behaviours covered by offline tests, no new sandbox and no auth layer; docs/changelog.

Remainder of #963. Not assigned; on the bench until it is picked up.

Activity

  1. added
    enhancementNew feature or request
    area:pluginsHost plugins and installers: Claude Code, Codex, DSH, OpenCode, MCP server
    area:cliThe agentdescent command line (cli.py, doctor, plan/evolve/status/apply)
    on Nov 14, 2026
  2. HugoXK commented on Nov 14, 2026

    @HugoXK
    CollaboratorAuthor

    Claimed for AgentDescent Dev-1, row 1 only: write-dir enforcement on every write path.

    Branch: agent/1082-write-dir-enforcement. The PR will say Partial: write-dir enforcement for #1082 and will not close this issue: rows 2 (host-worker budget caps) and 3 (child-env scrubbing) stay here and get their own carriers after row 1 lands.

    Row 1 scope: AGENTDESCENT_SURFACE_WRITE_DIRS applied in apply, in show --diff output and in the materialised tree, not only on the MCP surface; a write outside the allowed dirs is refused before it touches disk, pinned by a test.

  3. self-assigned this
    on Nov 14, 2026
  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 20, 2026
  5. HugoXK commented on Nov 20, 2026

    @HugoXK
    CollaboratorAuthor

    Claiming one slice of this remainder, not the whole issue.

    Branch agent/1082-operator-run-cap off main @ 14ba9529: an operator per-run call ceiling, AGENTDESCENT_MAX_CALLS, clamped (min only) into runstore.launch / runstore.execute so a caller cannot raise it. Calls only — a process-wide AGENTDESCENT_MAX_USD would make every un-priced run a SpecError through require_budget_pair, so the USD question stays open. Not in this slice: max_concurrency, the MCP tool arguments, doctor, write-dir and child-env work (the last two rows are already shipped, PRs #1087 and #1088).

  6. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 20, 2026
  7. HugoXK commented on Nov 20, 2026

    @HugoXK
    CollaboratorAuthor

    Row status, so nobody re-opens the shipped ones the way I just did:

    • Row 1 (write-dir enforcement on every write path) — shipped, PR #1087; recorded in this thread at 2026-11-20T05:12:58Z. I opened #1188 for it from the acceptance text alone and closed it the same hour with that evidence.
    • Row 3 (child-env scrubbing test) — shipped, PR #1088 (23979b73), tests/test_host_env_scrub.py at f5017f93 pins the spawn boundary (three launch rows) and every SESSION_MARKERS entry. I opened #1189 for it and closed it the same way.
    • Row 2 (host-worker budget defaults) — the only live part: AGENTDESCENT_MAX_CALLS shipped as the operator ceiling in #1181 (Partial: #1082), and the MCP surface arguments are in review as #1186. Still open here: max_concurrency, a per-Ticket cap, and the USD question. Not sliced yet on purpose — it edits the same mcp.py helper #1186 is changing, and a second PR on that helper would be the real conflict.

    So the remaining acceptance for this issue is row 2 only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cliThe agentdescent command line (cli.py, doctor, plan/evolve/status/apply)area:pluginsHost plugins and installers: Claude Code, Codex, DSH, OpenCode, MCP serverenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions