fix(agent): the low integrity label on a folder whose drive gives no WRITE_OWNER #102

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:fix/label-write-owner into main 2026-11-19 19:19:53 +00:00
Owner

A tester's agent failed a job with:

the agent failed: WinError: SetNamedSecurityInfoW (the low integrity label on E:\BeanstalkCACHE\game-home): error 5 (0x5, Access denied)

Setting an integrity label takes WRITE_OWNER, and owning a folder doesn't give that right. An owner can only read and change the permissions. C:\Users gives its user full control. A second drive's root usually gives Authenticated Users Modify and nothing more, and the agent's folders under it inherit that. So the DACL grant just before the label works, because the owner can change the DACL, and the label is refused.

On access denied, WinAcl.SetLabel now gives the agent's own account WRITE_OWNER on that folder, inherited by what it holds, then sets the label again. The owner may always do this. Because the ACE is inherited, later labels under the folder work on the first try. The sandbox's SID gets nothing new. An AppContainer has to be granted access itself, and the runner account is a different user. If the label is still refused, the error now says the agent's account needs full control of the folder.

Not built or run here: there is no Windows build on this PC. CI or a Windows tester has to build it.

Until a nightly with this fix is out, the tester can unblock themselves (from a terminal, as the account the agent runs as):

icacls E:\BeanstalkCACHE /grant "%USERNAME%":(OI)(CI)F

🤖 Generated with Claude Code

A tester's agent failed a job with: > the agent failed: WinError: SetNamedSecurityInfoW (the low integrity label on E:\BeanstalkCACHE\game-home): error 5 (0x5, Access denied) Setting an integrity label takes WRITE_OWNER, and owning a folder doesn't give that right. An owner can only read and change the permissions. `C:\Users` gives its user full control. A second drive's root usually gives Authenticated Users Modify and nothing more, and the agent's folders under it inherit that. So the DACL grant just before the label works, because the owner can change the DACL, and the label is refused. On access denied, `WinAcl.SetLabel` now gives the agent's own account WRITE_OWNER on that folder, inherited by what it holds, then sets the label again. The owner may always do this. Because the ACE is inherited, later labels under the folder work on the first try. The sandbox's SID gets nothing new. An AppContainer has to be granted access itself, and the runner account is a different user. If the label is still refused, the error now says the agent's account needs full control of the folder. Not built or run here: there is no Windows build on this PC. CI or a Windows tester has to build it. Until a nightly with this fix is out, the tester can unblock themselves (from a terminal, as the account the agent runs as): ``` icacls E:\BeanstalkCACHE /grant "%USERNAME%":(OI)(CI)F ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(agent): the low integrity label on a folder whose drive gives no WRITE_OWNER
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 20s
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
CI / Agent build and checks (pull_request) Successful in 36s
CI / Coordinator image (pull_request) Successful in 8s
CI / Coordinator tests (pull_request) Failing after 11m15s
c0aaff3829
A tester's agent failed with "SetNamedSecurityInfoW (the low integrity label on
E:\BeanstalkCACHE\game-home): error 5". Setting a label takes WRITE_OWNER, which
owning a folder does not give. C:\Users gives its user full control, but another
drive's root often lets users modify and no more, and the agent's folders inherit
that. The owner may still change the permissions, so on access denied the agent
gives its own account WRITE_OWNER on the folder (inherited beneath) and sets the
label again. The sandbox's SID gets nothing new.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean changed title from WIP: fix(agent): the low integrity label on a folder whose drive gives no WRITE_OWNER to fix(agent): the low integrity label on a folder whose drive gives no WRITE_OWNER 2026-11-19 19:19:49 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Beanstalk!102
No description provided.