Add `Workspace.authority` and `AuthorityWorkspace` for workspaces whose files the operator does not control
-
Adds
Workspace.authority(default'operator') and theAuthorityWorkspace(workspace, authority=...)wrapper, next toread_onlyandReadOnlyWorkspace. -
Adds
LocalWorkspace(authority='user' | 'none'), mirroringread_only=True; it also works in agent specs. -
The levels are
Authority = Literal['operator', 'user', 'none']inpydantic_ai.messages, the vocabularyCapabilityPartsources use in #11935.'user'is for the user's own files (uploads),'none'for files nobody on the application's side wrote (a cloned repo). -
A wrapper only lowers the level: through a chain of wrappers the lowest wins.
-
Tools behave the same whatever the authority. A capability that puts workspace text in instructions sends it with no more authority than the workspace has. No built-in capability reads it yet; the stacked PRs add the readers.
-
Durable execution:
AuthorityWorkspacereturns its level fromdurable_policy(), so a run-level wrapper with a different level than the agent rebuilds is rejected, likeReadOnlyWorkspace. -
Docs: a "Files you didn't write" section in
docs/workspace.md, the durable-execution bullet, the API reference and the Pydantic AI skill references. -
Nothing changes for existing users.
-
Not included:
authority=on the sandbox and SSH capabilities (they don't takeread_only=either). Planned as a follow-up.
This PR first added a trusted: bool flag and an UntrustedWorkspace wrapper. On 2026-11-03 Douwe decided to rename it to authority before merge, to match the three authority levels in #11935. trusted never shipped, so there are no deprecated aliases.
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.