Skip to content

Commit 5853b08

Browse files
lpcoxCopilot
andauthored
docs: document .awf-home prerequisite for Cloud Hypervisor allowWrite (#7670)
The allowWrite guidance told readers to add `/workspace/.awf-home` to `filesystem.allowWrite` when a narrowed policy makes the guest home read-only, but that remedy fails as written. The Cloud Hypervisor workspace export is backed by the host workspace directory itself, and nothing in the Cloud Hypervisor path creates `.awf-home` on the host before planning. Without a policy this is invisible: the export is writable and the directory is created at runtime. Under a narrowing policy the export root is staged read-only, so runtime creation is no longer possible, and because the planner only accepts paths that already exist, naming it in `allowWrite` throws: filesystem.allowWrite path is not an existing path within a writable Cloud Hypervisor export: /workspace/.awf-home Document the missing prerequisite in both the Cloud Hypervisor foundation doc and the config spec: create the host directory `$GITHUB_WORKSPACE/.awf-home` before AWF starts, then list the guest path. Include a short setup example and state plainly that AWF does not auto-create or exempt the guest home, since either would widen the boundary implicitly or reintroduce an always-writable internal mount. Documentation only; no behaviour, existing-path, or narrowing semantics change. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 248b577f-2e6f-4e03-90bc-96c75c0d395e
1 parent 4017c61 commit 5853b08

2 files changed

Lines changed: 41 additions & 2 deletions

File tree

docs/awf-config-spec.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,14 @@ where it is enforced by the host mount tree that backs each virtio-fs export
106106
Cloud Hypervisor has no always-writable internal mounts, so every export it
107107
publishes is subject to the policy, including `/tmp/gh-aw` and the guest home
108108
directory at `/workspace/.awf-home`; paths not covered by `allowWrite` become
109-
read-only. AWF rejects `filesystem.allowWrite` with the sbx
110-
runtime and with Docker-in-Docker agent execution.
109+
read-only. Because every listed path MUST already exist, and because AWF MUST
110+
NOT auto-create or exempt the guest home, a Cloud Hypervisor workload that needs
111+
a writable home MUST have the backing host directory
112+
`$GITHUB_WORKSPACE/.awf-home` created before AWF starts and MUST then list the
113+
guest path `/workspace/.awf-home` in `allowWrite`; otherwise planning fails
114+
because the path does not exist within a writable export. AWF rejects
115+
`filesystem.allowWrite` with the sbx runtime and with Docker-in-Docker agent
116+
execution.
111117

112118
### 4.2 Cloud Hypervisor microVM preview
113119

docs/cloud-hypervisor-foundation.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,39 @@ One consequence is worth stating plainly: the guest `HOME` is
357357
directory read-only. That is the policy working as specified, not an oversight;
358358
add the home path to `allowWrite` if the workload needs it.
359359

360+
Doing so has a prerequisite. The workspace export is backed by the host
361+
workspace directory itself (`$GITHUB_WORKSPACE`, falling back to the current
362+
working directory), and nothing in the Cloud Hypervisor path creates
363+
`.awf-home` on the host before planning. That is harmless without a policy,
364+
because the export is writable and the directory is simply created at runtime.
365+
Under a narrowing policy the export root is staged read-only, so it can no
366+
longer be created at runtime — and the planner only accepts paths that already
367+
exist, so naming it in `allowWrite` fails too, with a single-line error:
368+
369+
```text
370+
filesystem.allowWrite path is not an existing path within a writable
371+
Cloud Hypervisor export: /workspace/.awf-home
372+
```
373+
374+
AWF deliberately does not auto-create or exempt the guest home: doing either
375+
would either widen the boundary implicitly or reintroduce an always-writable
376+
internal mount, both of which contradict the narrowing semantics above. Create
377+
the host directory before AWF starts, then list the guest path:
378+
379+
```bash
380+
mkdir -p "$GITHUB_WORKSPACE/.awf-home"
381+
```
382+
383+
```yaml
384+
filesystem:
385+
allowWrite:
386+
- /workspace/.awf-home
387+
```
388+
389+
That yields a `selective` workspace plan — host root staged `ro`, guest mount
390+
`rw`, one directory overlay at `.awf-home` — leaving the rest of the workspace
391+
read-only.
392+
360393
## Limitations
361394

362395
The preview rejects configurations that weaken or conflict with its boundary,

0 commit comments

Comments
 (0)