Skip to content

Commit e600010

Browse files
committed
app-server: accept command permission profiles
1 parent 1047754 commit e600010

10 files changed

Lines changed: 532 additions & 16 deletions

File tree

codex-rs/app-server-protocol/schema/json/ClientRequest.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,17 @@
228228
"null"
229229
]
230230
},
231+
"permissionProfile": {
232+
"anyOf": [
233+
{
234+
"$ref": "#/definitions/PermissionProfile"
235+
},
236+
{
237+
"type": "null"
238+
}
239+
],
240+
"description": "Optional full permissions profile for this command.\n\nDefaults to the user's configured permissions when omitted. Cannot be combined with `sandboxPolicy`."
241+
},
231242
"processId": {
232243
"description": "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.",
233244
"type": [
@@ -244,7 +255,7 @@
244255
"type": "null"
245256
}
246257
],
247-
"description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted."
258+
"description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with `permissionProfile`."
248259
},
249260
"size": {
250261
"anyOf": [

codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6317,6 +6317,17 @@
63176317
"null"
63186318
]
63196319
},
6320+
"permissionProfile": {
6321+
"anyOf": [
6322+
{
6323+
"$ref": "#/definitions/v2/PermissionProfile"
6324+
},
6325+
{
6326+
"type": "null"
6327+
}
6328+
],
6329+
"description": "Optional full permissions profile for this command.\n\nDefaults to the user's configured permissions when omitted. Cannot be combined with `sandboxPolicy`."
6330+
},
63206331
"processId": {
63216332
"description": "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.",
63226333
"type": [
@@ -6333,7 +6344,7 @@
63336344
"type": "null"
63346345
}
63356346
],
6336-
"description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted."
6347+
"description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with `permissionProfile`."
63376348
},
63386349
"size": {
63396350
"anyOf": [

codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2868,6 +2868,17 @@
28682868
"null"
28692869
]
28702870
},
2871+
"permissionProfile": {
2872+
"anyOf": [
2873+
{
2874+
"$ref": "#/definitions/PermissionProfile"
2875+
},
2876+
{
2877+
"type": "null"
2878+
}
2879+
],
2880+
"description": "Optional full permissions profile for this command.\n\nDefaults to the user's configured permissions when omitted. Cannot be combined with `sandboxPolicy`."
2881+
},
28712882
"processId": {
28722883
"description": "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.",
28732884
"type": [
@@ -2884,7 +2895,7 @@
28842895
"type": "null"
28852896
}
28862897
],
2887-
"description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted."
2898+
"description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with `permissionProfile`."
28882899
},
28892900
"size": {
28902901
"anyOf": [

codex-rs/app-server-protocol/schema/json/v2/CommandExecParams.json

Lines changed: 281 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
"description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.",
66
"type": "string"
77
},
8+
"AdditionalNetworkPermissions": {
9+
"properties": {
10+
"enabled": {
11+
"type": [
12+
"boolean",
13+
"null"
14+
]
15+
}
16+
},
17+
"type": "object"
18+
},
819
"CommandExecTerminalSize": {
920
"description": "PTY size in character cells for `command/exec` PTY sessions.",
1021
"properties": {
@@ -27,13 +38,271 @@
2738
],
2839
"type": "object"
2940
},
41+
"FileSystemAccessMode": {
42+
"enum": [
43+
"read",
44+
"write",
45+
"none"
46+
],
47+
"type": "string"
48+
},
49+
"FileSystemPath": {
50+
"oneOf": [
51+
{
52+
"properties": {
53+
"path": {
54+
"$ref": "#/definitions/AbsolutePathBuf"
55+
},
56+
"type": {
57+
"enum": [
58+
"path"
59+
],
60+
"title": "PathFileSystemPathType",
61+
"type": "string"
62+
}
63+
},
64+
"required": [
65+
"path",
66+
"type"
67+
],
68+
"title": "PathFileSystemPath",
69+
"type": "object"
70+
},
71+
{
72+
"properties": {
73+
"pattern": {
74+
"type": "string"
75+
},
76+
"type": {
77+
"enum": [
78+
"glob_pattern"
79+
],
80+
"title": "GlobPatternFileSystemPathType",
81+
"type": "string"
82+
}
83+
},
84+
"required": [
85+
"pattern",
86+
"type"
87+
],
88+
"title": "GlobPatternFileSystemPath",
89+
"type": "object"
90+
},
91+
{
92+
"properties": {
93+
"type": {
94+
"enum": [
95+
"special"
96+
],
97+
"title": "SpecialFileSystemPathType",
98+
"type": "string"
99+
},
100+
"value": {
101+
"$ref": "#/definitions/FileSystemSpecialPath"
102+
}
103+
},
104+
"required": [
105+
"type",
106+
"value"
107+
],
108+
"title": "SpecialFileSystemPath",
109+
"type": "object"
110+
}
111+
]
112+
},
113+
"FileSystemSandboxEntry": {
114+
"properties": {
115+
"access": {
116+
"$ref": "#/definitions/FileSystemAccessMode"
117+
},
118+
"path": {
119+
"$ref": "#/definitions/FileSystemPath"
120+
}
121+
},
122+
"required": [
123+
"access",
124+
"path"
125+
],
126+
"type": "object"
127+
},
128+
"FileSystemSpecialPath": {
129+
"oneOf": [
130+
{
131+
"properties": {
132+
"kind": {
133+
"enum": [
134+
"root"
135+
],
136+
"type": "string"
137+
}
138+
},
139+
"required": [
140+
"kind"
141+
],
142+
"title": "RootFileSystemSpecialPath",
143+
"type": "object"
144+
},
145+
{
146+
"properties": {
147+
"kind": {
148+
"enum": [
149+
"minimal"
150+
],
151+
"type": "string"
152+
}
153+
},
154+
"required": [
155+
"kind"
156+
],
157+
"title": "MinimalFileSystemSpecialPath",
158+
"type": "object"
159+
},
160+
{
161+
"properties": {
162+
"kind": {
163+
"enum": [
164+
"current_working_directory"
165+
],
166+
"type": "string"
167+
}
168+
},
169+
"required": [
170+
"kind"
171+
],
172+
"title": "CurrentWorkingDirectoryFileSystemSpecialPath",
173+
"type": "object"
174+
},
175+
{
176+
"properties": {
177+
"kind": {
178+
"enum": [
179+
"project_roots"
180+
],
181+
"type": "string"
182+
},
183+
"subpath": {
184+
"type": [
185+
"string",
186+
"null"
187+
]
188+
}
189+
},
190+
"required": [
191+
"kind"
192+
],
193+
"title": "KindFileSystemSpecialPath",
194+
"type": "object"
195+
},
196+
{
197+
"properties": {
198+
"kind": {
199+
"enum": [
200+
"tmpdir"
201+
],
202+
"type": "string"
203+
}
204+
},
205+
"required": [
206+
"kind"
207+
],
208+
"title": "TmpdirFileSystemSpecialPath",
209+
"type": "object"
210+
},
211+
{
212+
"properties": {
213+
"kind": {
214+
"enum": [
215+
"slash_tmp"
216+
],
217+
"type": "string"
218+
}
219+
},
220+
"required": [
221+
"kind"
222+
],
223+
"title": "SlashTmpFileSystemSpecialPath",
224+
"type": "object"
225+
},
226+
{
227+
"properties": {
228+
"kind": {
229+
"enum": [
230+
"unknown"
231+
],
232+
"type": "string"
233+
},
234+
"path": {
235+
"type": "string"
236+
},
237+
"subpath": {
238+
"type": [
239+
"string",
240+
"null"
241+
]
242+
}
243+
},
244+
"required": [
245+
"kind",
246+
"path"
247+
],
248+
"type": "object"
249+
}
250+
]
251+
},
30252
"NetworkAccess": {
31253
"enum": [
32254
"restricted",
33255
"enabled"
34256
],
35257
"type": "string"
36258
},
259+
"PermissionProfile": {
260+
"properties": {
261+
"fileSystem": {
262+
"anyOf": [
263+
{
264+
"$ref": "#/definitions/PermissionProfileFileSystemPermissions"
265+
},
266+
{
267+
"type": "null"
268+
}
269+
]
270+
},
271+
"network": {
272+
"anyOf": [
273+
{
274+
"$ref": "#/definitions/AdditionalNetworkPermissions"
275+
},
276+
{
277+
"type": "null"
278+
}
279+
]
280+
}
281+
},
282+
"type": "object"
283+
},
284+
"PermissionProfileFileSystemPermissions": {
285+
"properties": {
286+
"entries": {
287+
"items": {
288+
"$ref": "#/definitions/FileSystemSandboxEntry"
289+
},
290+
"type": "array"
291+
},
292+
"globScanMaxDepth": {
293+
"format": "uint",
294+
"minimum": 0.0,
295+
"type": [
296+
"integer",
297+
"null"
298+
]
299+
}
300+
},
301+
"required": [
302+
"entries"
303+
],
304+
"type": "object"
305+
},
37306
"ReadOnlyAccess": {
38307
"oneOf": [
39308
{
@@ -247,6 +516,17 @@
247516
"null"
248517
]
249518
},
519+
"permissionProfile": {
520+
"anyOf": [
521+
{
522+
"$ref": "#/definitions/PermissionProfile"
523+
},
524+
{
525+
"type": "null"
526+
}
527+
],
528+
"description": "Optional full permissions profile for this command.\n\nDefaults to the user's configured permissions when omitted. Cannot be combined with `sandboxPolicy`."
529+
},
250530
"processId": {
251531
"description": "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.",
252532
"type": [
@@ -263,7 +543,7 @@
263543
"type": "null"
264544
}
265545
],
266-
"description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted."
546+
"description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with `permissionProfile`."
267547
},
268548
"size": {
269549
"anyOf": [

0 commit comments

Comments
 (0)