Skip to content

Commit 5542b72

Browse files
feat: Add AI gateway and MCP gateway flags to network policy create (#7638)
1 parent df98444 commit 5542b72

3 files changed

Lines changed: 61 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1a92de99959f20ab5850a7f89db21cb66269b2e0002ffc5e5afbe660d05b0768.yml
3-
openapi_spec_hash: 41e4660f26e27e6ab94d223da4ec1253
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-dd0f43e15cb67179deaf86f83ae04c6fae4ff858ee33e82a3b89231566cdc5bb.yml
3+
openapi_spec_hash: 569176c1c4f48efd25a44fa526fad9d1
44
config_hash: cbda3692cb48ab8582a0df1674b9e5c8

src/resources/network-policies.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ export interface NetworkPolicyCreateParameters {
8888
*/
8989
name: string;
9090

91+
/**
92+
* (Optional) If true, allows devbox egress to the AI credential gateway for
93+
* credential proxying. Defaults to false.
94+
*/
95+
allow_ai_gateway?: boolean | null;
96+
9197
/**
9298
* (Optional) If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults
9399
* to false.
@@ -101,6 +107,12 @@ export interface NetworkPolicyCreateParameters {
101107
*/
102108
allow_devbox_to_devbox?: boolean | null;
103109

110+
/**
111+
* (Optional) If true, allows devbox egress to the MCP hub for MCP server access.
112+
* Defaults to false.
113+
*/
114+
allow_mcp_gateway?: boolean | null;
115+
104116
/**
105117
* (Optional) DNS-based allow list with wildcard support. Examples: ['github.com',
106118
* '*.npmjs.org'].
@@ -138,6 +150,11 @@ export interface NetworkPolicyListView {
138150
* Parameters for updating an existing NetworkPolicy. All fields are optional.
139151
*/
140152
export interface NetworkPolicyUpdateParameters {
153+
/**
154+
* If true, allows devbox egress to the AI credential gateway.
155+
*/
156+
allow_ai_gateway?: boolean | null;
157+
141158
/**
142159
* If true, all egress traffic is allowed (ALLOW_ALL policy).
143160
*/
@@ -148,6 +165,11 @@ export interface NetworkPolicyUpdateParameters {
148165
*/
149166
allow_devbox_to_devbox?: boolean | null;
150167

168+
/**
169+
* If true, allows devbox egress to the MCP hub.
170+
*/
171+
allow_mcp_gateway?: boolean | null;
172+
151173
/**
152174
* Updated DNS-based allow list with wildcard support. Examples: ['github.com',
153175
* '*.npmjs.org'].
@@ -206,6 +228,12 @@ export namespace NetworkPolicyView {
206228
* The egress rules for this policy.
207229
*/
208230
export interface Egress {
231+
/**
232+
* If true, allows devbox egress to the AI credential gateway for credential
233+
* proxying.
234+
*/
235+
allow_ai_gateway: boolean;
236+
209237
/**
210238
* If true, all egress traffic is allowed and other fields are ignored. Used for
211239
* ALLOW_ALL policies.
@@ -217,6 +245,11 @@ export namespace NetworkPolicyView {
217245
*/
218246
allow_devbox_to_devbox: boolean;
219247

248+
/**
249+
* If true, allows devbox egress to the MCP hub for MCP server access.
250+
*/
251+
allow_mcp_gateway: boolean;
252+
220253
/**
221254
* DNS-based allow list with wildcard support. Examples: ['github.com',
222255
* '*.npmjs.org', 'api.openai.com']. Empty list with allow_all=false means no
@@ -233,6 +266,12 @@ export interface NetworkPolicyCreateParams {
233266
*/
234267
name: string;
235268

269+
/**
270+
* (Optional) If true, allows devbox egress to the AI credential gateway for
271+
* credential proxying. Defaults to false.
272+
*/
273+
allow_ai_gateway?: boolean | null;
274+
236275
/**
237276
* (Optional) If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults
238277
* to false.
@@ -246,6 +285,12 @@ export interface NetworkPolicyCreateParams {
246285
*/
247286
allow_devbox_to_devbox?: boolean | null;
248287

288+
/**
289+
* (Optional) If true, allows devbox egress to the MCP hub for MCP server access.
290+
* Defaults to false.
291+
*/
292+
allow_mcp_gateway?: boolean | null;
293+
249294
/**
250295
* (Optional) DNS-based allow list with wildcard support. Examples: ['github.com',
251296
* '*.npmjs.org'].
@@ -259,6 +304,11 @@ export interface NetworkPolicyCreateParams {
259304
}
260305

261306
export interface NetworkPolicyUpdateParams {
307+
/**
308+
* If true, allows devbox egress to the AI credential gateway.
309+
*/
310+
allow_ai_gateway?: boolean | null;
311+
262312
/**
263313
* If true, all egress traffic is allowed (ALLOW_ALL policy).
264314
*/
@@ -269,6 +319,11 @@ export interface NetworkPolicyUpdateParams {
269319
*/
270320
allow_devbox_to_devbox?: boolean | null;
271321

322+
/**
323+
* If true, allows devbox egress to the MCP hub.
324+
*/
325+
allow_mcp_gateway?: boolean | null;
326+
272327
/**
273328
* Updated DNS-based allow list with wildcard support. Examples: ['github.com',
274329
* '*.npmjs.org'].

tests/api-resources/network-policies.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ describe('resource networkPolicies', () => {
2323
test('create: required and optional params', async () => {
2424
const response = await client.networkPolicies.create({
2525
name: 'name',
26+
allow_ai_gateway: true,
2627
allow_all: true,
2728
allow_devbox_to_devbox: true,
29+
allow_mcp_gateway: true,
2830
allowed_hostnames: ['string'],
2931
description: 'description',
3032
});
@@ -72,8 +74,10 @@ describe('resource networkPolicies', () => {
7274
client.networkPolicies.update(
7375
'id',
7476
{
77+
allow_ai_gateway: true,
7578
allow_all: true,
7679
allow_devbox_to_devbox: true,
80+
allow_mcp_gateway: true,
7781
allowed_hostnames: ['string'],
7882
description: 'description',
7983
name: 'name',

0 commit comments

Comments
 (0)