Scope a worker brief
Direct worker briefs can opt into a path check with YAML frontmatter. Use this brief template with the existing the agent-owned models operation flow:
Scope a worker brief
Prompt-first procedure: Describe the outcome you want in your agent conversation. The agent should select and load the appropriate AIWG assets, explain material changes, request any needed approval, and report verification evidence. Exact commands and flags appear only in the CLI reference.
First time using AIWG? Begin with Install, Connect, and Verify.
Direct worker briefs can opt into a path check with YAML frontmatter. Use this brief template with the existing the agent-owned models operation flow:
---
allowedPaths:
- src/example/**
- test/unit/example/*.test.ts
forbiddenPaths:
- src/example/private/**
scopePolicy: warn
runtimeExcludes:
- .cache/task/**
---
Implement the bounded task. Preserve the existing workerClaims final contract.
Put this block at the beginning of a prose brief, before its task text. JSON WorkerBrief and WorkerDirectBrief contracts remain unchanged; this extension is for prose briefs. Without frontmatter scope fields, dispatch retains its existing behavior. A scoped brief requires `allowedPaths`; an empty list permits no changes. `forbiddenPaths` and `runtimeExcludes` default to empty lists. Patterns are relative POSIX globs, with `*`, `**`, braces and character classes supported. Absolute paths, parent traversal, backslashes and negated patterns are refused. Forbidden paths win over allowed paths; runtime excludes are removed before either comparison. Ordinary glob matching follows Node `path.matchesGlob`; match dotfiles explicitly. The two standard runtime directories exclude hidden descendants too. Only declare runtime excludes for generated files that need no integration review.
The launcher pins the worker tree's HEAD commit before starting the worker. At settlement it compares tracked files against that commit and includes untracked files, including ignored files. Renames check both source and destination paths; deletes check the removed path. Existing dirty changes also count, so begin with an isolated worktree. Scoped dispatch requires its cwd to be the Git worktree root. The standard `.handoff/` and `.aiwg/effects/` runtime directories and exact output capture paths are excluded. Findings never revert or remove worker edits.
`invocation.json` records `scope` and its base revision. The launcher result, `exit.json` and `final-evidence.json` contain `scopeViolations` entries with `path` and `reason`, plus `scopePolicy` and `acceptableForIntegration`. A failed Git scan adds `scopeCheckError`. These fields are launcher observations; the worker-written workerClaims file is preserved. Raw shell commands also run a completion check and record findings in their existing `.shell-*` run's `final-evidence.json`; that evidence retains `verified: false` and grants no integration authority.
The default `warn` policy records findings for review. `reject` sets `acceptableForIntegration: false` when violations exist or inspection fails, marks the launch result `WORKER_SCOPE_REJECTED`, and makes the raw shell command fail. The existing the agent-owned ralph-external operation boundary rechecks the current tree against the recorded base before executing protected checks or delivering bytes. A rejected scope produces no accepted delivery receipt, so the conductor's existing guard continues to refuse integration. Changes after worker exit are checked again; the original rejection remains until a new attempt or explicit operator acceptance, even if the offending paths are later removed. Scope checks do not replace content checks or worker verification.
Use a fresh attempt to correct a rejected result. After an operator explicitly reviews and accepts the listed changes, they may add the accept-scope-violations option to the existing the verify-worker option command. This bypasses only the scope rejection; protected checks, artifact checks and delivery controls still apply. The verdict retains the findings and records `scopeAcceptedByOperator: true`. The scope flag must never be supplied merely because a worker asks for it.