-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathawf-config.schema.json
More file actions
334 lines (334 loc) · 11.4 KB
/
awf-config.schema.json
File metadata and controls
334 lines (334 loc) · 11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/__raw/github/gh-aw-firewall/main/docs/awf-config.schema.json",
"title": "AWF Configuration",
"version": "1",
"description": "JSON/YAML configuration for awf CLI. CLI flags override config file values. See https://github.com/github/gh-aw-firewall for documentation.",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"description": "JSON Schema URL for IDE validation and autocomplete."
},
"network": {
"type": "object",
"description": "Network egress configuration.",
"additionalProperties": false,
"properties": {
"allowDomains": {
"type": "array",
"items": {
"type": "string"
},
"description": "Domains that the agent is allowed to reach. Both the bare domain and all subdomains are permitted (e.g. \"github.com\" also allows \"api.github.com\")."
},
"blockDomains": {
"type": "array",
"items": {
"type": "string"
},
"description": "Domains that are explicitly blocked, overriding allowDomains."
},
"dnsServers": {
"type": "array",
"items": {
"type": "string"
},
"description": "DNS servers to use inside the container. Defaults to Google DNS (8.8.8.8, 8.8.4.4). Accepts IPv4 and IPv6 addresses."
},
"upstreamProxy": {
"type": "string",
"description": "Upstream HTTP proxy URL (e.g. \"http://proxy.corp.example.com:8080\"). When set, the AWF Squid proxy forwards traffic through this proxy."
}
}
},
"apiProxy": {
"type": "object",
"description": "API proxy sidecar configuration. The sidecar injects real API credentials so the agent never has direct access to them.",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable the API proxy sidecar container."
},
"enableOpenCode": {
"type": "boolean",
"description": "Enable the OpenCode API proxy endpoint (port 10004)."
},
"anthropicAutoCache": {
"type": "boolean",
"description": "Automatically apply Anthropic prompt-cache optimizations on /v1/messages requests."
},
"anthropicCacheTailTtl": {
"type": "string",
"enum": [
"5m",
"1h"
],
"description": "TTL for Anthropic cache tail optimization. Only applies when anthropicAutoCache is enabled. Allowed values: \"5m\" or \"1h\"."
},
"targets": {
"type": "object",
"description": "Override upstream API endpoints for each provider.",
"additionalProperties": false,
"properties": {
"openai": {
"$ref": "#/$defs/providerTarget",
"description": "OpenAI API target override."
},
"anthropic": {
"$ref": "#/$defs/providerTarget",
"description": "Anthropic API target override."
},
"copilot": {
"$ref": "#/$defs/providerHostOnlyTarget",
"description": "GitHub Copilot API target override (basePath not supported)."
},
"gemini": {
"$ref": "#/$defs/providerTarget",
"description": "Google Gemini API target override."
}
}
},
"models": {
"type": "object",
"description": "Model alias mapping. Keys are canonical model names; values are arrays of alternative names or patterns that should be rewritten to the canonical name.",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"security": {
"type": "object",
"description": "Security and isolation configuration.",
"additionalProperties": false,
"properties": {
"sslBump": {
"type": "boolean",
"description": "Enable SSL bumping (TLS interception) in the Squid proxy. Requires a custom CA certificate."
},
"enableDlp": {
"type": "boolean",
"description": "Enable Data Loss Prevention (DLP) inspection of outbound traffic."
},
"enableHostAccess": {
"type": "boolean",
"description": "Mount the host filesystem (read-only for system paths, read-write for the workspace). Enabled by default; set to false to run without host filesystem access."
},
"allowHostPorts": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": "Host TCP ports the agent may connect to (e.g. local dev services). Accepts a single port string or an array of port strings."
},
"allowHostServicePorts": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": "Named service ports on the host that the agent may connect to. Accepts a single port string or an array of port strings."
},
"difcProxy": {
"type": "object",
"description": "DIFC (Data-in-Flight Control) proxy configuration.",
"additionalProperties": false,
"properties": {
"host": {
"type": "string",
"description": "DIFC proxy host."
},
"caCert": {
"type": "string",
"description": "Path to the CA certificate for DIFC proxy TLS verification."
}
}
}
}
},
"container": {
"type": "object",
"description": "Container and Docker configuration.",
"additionalProperties": false,
"properties": {
"memoryLimit": {
"type": "string",
"description": "Docker memory limit for the agent container (e.g. \"4g\", \"512m\"). Uses Docker memory limit syntax."
},
"agentTimeout": {
"type": "integer",
"minimum": 1,
"description": "Maximum time (in minutes) the agent command is allowed to run."
},
"enableDind": {
"type": "boolean",
"description": "Enable Docker-in-Docker support inside the agent container."
},
"workDir": {
"type": "string",
"description": "Host path used as the AWF working directory for generated configs and logs. Defaults to a temporary directory."
},
"containerWorkDir": {
"type": "string",
"description": "Working directory inside the agent container."
},
"imageRegistry": {
"type": "string",
"description": "Container image registry to pull from. Defaults to \"ghcr.io/github/gh-aw-firewall\"."
},
"imageTag": {
"type": "string",
"description": "Container image tag to use. Defaults to \"latest\"."
},
"skipPull": {
"type": "boolean",
"description": "Skip pulling container images (use locally cached images)."
},
"buildLocal": {
"type": "boolean",
"description": "Build container images from source instead of pulling from the registry."
},
"agentImage": {
"type": "string",
"description": "Override the agent container image (e.g. for a GitHub Actions parity image)."
},
"tty": {
"type": "boolean",
"description": "Allocate a pseudo-TTY for the agent container."
},
"dockerHost": {
"type": "string",
"description": "Docker daemon socket or host to connect to (e.g. \"unix:///var/run/docker.sock\")."
}
}
},
"environment": {
"type": "object",
"description": "Environment variable propagation into the agent container.",
"additionalProperties": false,
"properties": {
"envFile": {
"type": "string",
"description": "Path to a .env file whose variables are injected into the agent container."
},
"envAll": {
"type": "boolean",
"description": "Forward all host environment variables into the agent container. Use with caution — may expose secrets."
},
"excludeEnv": {
"type": "array",
"items": {
"type": "string"
},
"description": "Environment variable names to exclude when envAll is true."
}
}
},
"logging": {
"type": "object",
"description": "Logging and diagnostics configuration.",
"additionalProperties": false,
"properties": {
"logLevel": {
"type": "string",
"enum": [
"debug",
"info",
"warn",
"error"
],
"description": "Log verbosity level. Defaults to \"info\"."
},
"diagnosticLogs": {
"type": "boolean",
"description": "Enable diagnostic logging (Squid access logs, iptables logs). Logs are written to the work directory."
},
"auditDir": {
"type": "string",
"description": "Directory path for audit logs."
},
"proxyLogsDir": {
"type": "string",
"description": "Directory path for Squid proxy access logs."
},
"sessionStateDir": {
"type": "string",
"description": "Directory path for agent session state (e.g. conversation history). Set to \"/tmp/gh-aw/sandbox/agent/session-state\" for Copilot agent runs."
}
}
},
"rateLimiting": {
"type": "object",
"description": "Egress rate limiting configuration.",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable egress rate limiting."
},
"requestsPerMinute": {
"type": "integer",
"minimum": 1,
"description": "Maximum number of HTTP requests per minute."
},
"requestsPerHour": {
"type": "integer",
"minimum": 1,
"description": "Maximum number of HTTP requests per hour."
},
"bytesPerMinute": {
"type": "integer",
"minimum": 1,
"description": "Maximum number of bytes transferred per minute."
}
}
}
},
"$defs": {
"providerTarget": {
"type": "object",
"description": "API provider target override.",
"additionalProperties": false,
"properties": {
"host": {
"type": "string",
"description": "Override the provider API host."
},
"basePath": {
"type": "string",
"description": "Override the provider API base path."
}
}
},
"providerHostOnlyTarget": {
"type": "object",
"description": "API provider target override (host only; basePath not supported).",
"additionalProperties": false,
"properties": {
"host": {
"type": "string",
"description": "Override the provider API host."
}
}
}
}
}