@@ -10,11 +10,12 @@ The reader opens every directory component and the file without following
1010symlinks, using directory descriptors rather than a check-then-open pathname.
1111Replacing a directory or file with a symlink cannot redirect a read outside the
1212upload directory. It rejects traversal, absolute paths, Windows-style paths,
13- control characters, directory/file symlinks, non-regular files, invalid UTF-8 and
13+ control characters, directory/file symlinks, hard links, non-regular files, invalid UTF-8 and
1414files larger than ** 1,000,000 bytes** . It checks size before reading, then uses a
1515bounded read to catch growth during the read. POSIX descriptor-relative,
16- ` O_NOFOLLOW ` and ` O_DIRECTORY ` support are required; unsupported platforms fail
17- closed rather than falling back to an unsafe reader.
16+ ` O_NOFOLLOW ` and ` O_DIRECTORY ` support are required ** inside the sandbox** and
17+ for local staging; unsupported platforms fail closed rather than falling back
18+ to an unsafe sandbox reader. The hosted-upload helper can run on Windows.
1819
1920## Prerequisites and lifecycle
2021
@@ -49,8 +50,12 @@ curl -X POST http://localhost:8088/responses \
4950 -d ' {"input":"Read contoso_q1_2026_report.txt and compare Q1 revenue."}'
5051```
5152
52- The helper applies the same bounded-read and symlink checks to the selected
53- source and destination. ` --local ` never calls Azure. Local query/body session IDs
53+ The explicitly selected developer source is read portably: symlinked source
54+ directories are resolved, the opened file must be regular UTF-8, and the byte
55+ limit is checked before and after a bounded read. That source is operator-chosen,
56+ not a path supplied by the model. The ` --local ` destination retains the strict
57+ descriptor-relative, no-follow and hard-link checks. ` --local ` never calls Azure.
58+ Local query/body session IDs
5459do ** not** create separate filesystem sandboxes: a local server is a single-user
5560development process. To simulate two sandboxes, run hosts with separate ` HOME `
5661directories and upload only to the first. The second must list no uploads and
@@ -74,7 +79,8 @@ SDK prerequisite for hosted-session file operations. The SDK uploads to
7479` sample_files/contoso_q1_2026_report.txt ` , relative to that
7580sandbox's home directory. A portal/CLI upload to the home directory's root will
7681not be visible to these tools; specify the ` sample_files/ ` destination, or use
77- this helper. No real upload is performed by the sample's offline tests.
82+ this helper. Live uploads require separately configured credentials and an
83+ explicitly selected agent/session.
7884
7985Send the request to the deployed agent's Responses endpoint, routing to the same
8086sandbox with the ** request body** selector:
@@ -101,14 +107,3 @@ same prompt to a fresh sandbox B without uploading: its `list_files()` must be
101107empty and the named read must fail. Upload separately to B if it needs the file.
102108Do not claim this live check ran unless those resources and uploads were
103109explicitly authorized.
104-
105- ## Offline checks
106-
107- From ` python/ ` , run:
108-
109- ``` bash
110- uv run pytest samples/04-hosting/foundry-hosted-agents/responses/files/tests -q
111- ```
112-
113- The tests use temporary home directories, including descriptor-replacement
114- checks. They require no Foundry project, credentials, deployment or real files.
0 commit comments