@foldrun/core 17.1.1 → 17.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/browse-egress.d.ts +31 -0
- package/dist/src/browse-egress.js +43 -0
- package/dist/src/egress.d.ts +9 -0
- package/dist/src/run-container.js +6 -1
- package/dist/src/runner.js +21 -3
- package/package.json +1 -1
- package/src/browse-egress.ts +49 -1
- package/src/egress.ts +6 -0
- package/src/run-container.ts +6 -1
- package/src/runner.ts +20 -3
|
@@ -29,6 +29,13 @@ export type BrowseVerdict = {
|
|
|
29
29
|
kind: "legacy";
|
|
30
30
|
} | {
|
|
31
31
|
kind: "hosted";
|
|
32
|
+
}
|
|
33
|
+
/** FOL-145: a vendor's browser held to the list through foldrun's vendor
|
|
34
|
+
* door — the vendor's key bound to its API, the proxy's session rules on
|
|
35
|
+
* every call, the door its only proxy. */
|
|
36
|
+
| {
|
|
37
|
+
kind: "vendor";
|
|
38
|
+
vendor: string;
|
|
32
39
|
} | {
|
|
33
40
|
kind: "refuse";
|
|
34
41
|
message: string;
|
|
@@ -42,6 +49,8 @@ export declare function browseVerdict(o: {
|
|
|
42
49
|
vendor: string | null | undefined;
|
|
43
50
|
/** Can this executor wall the step's network (Platform.confinesBrowsing)? */
|
|
44
51
|
confines: boolean;
|
|
52
|
+
/** The step's grant carries a vendor door for this vendor (vendorDoorFor). */
|
|
53
|
+
door?: boolean;
|
|
45
54
|
}): BrowseVerdict;
|
|
46
55
|
/** The trace's network line for a step that may browse, on an install with
|
|
47
56
|
* an egress proxy: the step's list, and whether it holds — `hosted` when
|
|
@@ -49,4 +58,26 @@ export declare function browseVerdict(o: {
|
|
|
49
58
|
* does not hold yet, for the browser or anything else in the step. */
|
|
50
59
|
export declare function browseNetworkLine(policy: NetworkPolicy, vendor: string | null | undefined, opts?: {
|
|
51
60
|
hosted?: boolean;
|
|
61
|
+
vendorDoor?: boolean;
|
|
52
62
|
}): string;
|
|
63
|
+
/** Set to "1" for a step whose vendor browser is held through the door:
|
|
64
|
+
* the web tool sends the vendor's API calls and its remote-control
|
|
65
|
+
* WebSocket through the egress proxy's /e/ door (Playwright's
|
|
66
|
+
* connectOverCDP ignores HTTPS_PROXY, so a walled sandbox has no other way). */
|
|
67
|
+
export declare const VENDOR_DOOR_ENV = "FOLDRUN_VENDOR_DOOR";
|
|
68
|
+
/** The hosts a vendor's key is bound to in door mode: its API, and the
|
|
69
|
+
* remote-control hosts known so far. Browserbase's and Hyperbrowser's
|
|
70
|
+
* remote-control hosts come back in their session answers and are added as
|
|
71
|
+
* FOL-151 qualifies them; until then those vendors fail closed there. */
|
|
72
|
+
export declare const VENDOR_DOOR_HOSTS: Readonly<Record<string, readonly string[]>>;
|
|
73
|
+
/**
|
|
74
|
+
* The vendor door for a step's vendor, or null. On only when the install
|
|
75
|
+
* says so — FOLDRUN_VENDOR_EGRESS=1, FOLDRUN_VENDOR_EGRESS_URL (the door's
|
|
76
|
+
* public address) — and the vendor is in FOLDRUN_VENDOR_EGRESS_VENDORS (the
|
|
77
|
+
* vendors qualified, or on trial while FOL-151 qualifies them; empty by
|
|
78
|
+
* default, so nothing changes until a vendor is listed).
|
|
79
|
+
*/
|
|
80
|
+
export declare function vendorDoorFor(vendor: string | null | undefined, env?: Record<string, string | undefined>): {
|
|
81
|
+
vendor: string;
|
|
82
|
+
server: string;
|
|
83
|
+
} | null;
|
|
@@ -54,6 +54,8 @@ export function browseVerdict(o) {
|
|
|
54
54
|
const { tier, title } = browseTier(o.vendor);
|
|
55
55
|
if (tier === "hosted")
|
|
56
56
|
return { kind: "hosted" };
|
|
57
|
+
if (tier === "vendor" && o.door)
|
|
58
|
+
return { kind: "vendor", vendor: (o.vendor ?? "").trim().toLowerCase() };
|
|
57
59
|
const why = tier === "vendor"
|
|
58
60
|
? `${title} browses from its own network, and foldrun cannot hold it to network: until that vendor is qualified (FOL-110 phase 4)`
|
|
59
61
|
: `${title} always browses through its own network, and nothing can hold it to network:`;
|
|
@@ -70,6 +72,10 @@ export function browseVerdict(o) {
|
|
|
70
72
|
* does not hold yet, for the browser or anything else in the step. */
|
|
71
73
|
export function browseNetworkLine(policy, vendor, opts = {}) {
|
|
72
74
|
const what = networkLine(policy, true);
|
|
75
|
+
if (opts.vendorDoor) {
|
|
76
|
+
const { title } = browseTier(vendor);
|
|
77
|
+
return `${what} — enforced — through foldrun's vendor door: ${title}'s browser runs on the vendor's machines, and the session it starts has foldrun's door as its only proxy, so its pages are held to this list (no site a secret is bound to: a vendor's browser cannot trust foldrun's certificate, FOL-145).`;
|
|
78
|
+
}
|
|
73
79
|
if (opts.hosted) {
|
|
74
80
|
return `${what} — enforced — hosted: the browser runs inside this step's sandbox, whose network reaches only the egress proxy (which holds the list), so a page, a script or a changed proxy setting reaches no site off the list.`;
|
|
75
81
|
}
|
|
@@ -84,3 +90,40 @@ export function browseNetworkLine(policy, vendor, opts = {}) {
|
|
|
84
90
|
: `. Its browser (${title}) always browses through its own network and cannot be held to network: — a restricted, enforced network: will refuse it (FOL-110)`;
|
|
85
91
|
return `${what}${now}${later}.`;
|
|
86
92
|
}
|
|
93
|
+
// ------------------------------------------------ FOL-145: the vendor door
|
|
94
|
+
/** Set to "1" for a step whose vendor browser is held through the door:
|
|
95
|
+
* the web tool sends the vendor's API calls and its remote-control
|
|
96
|
+
* WebSocket through the egress proxy's /e/ door (Playwright's
|
|
97
|
+
* connectOverCDP ignores HTTPS_PROXY, so a walled sandbox has no other way). */
|
|
98
|
+
export const VENDOR_DOOR_ENV = "FOLDRUN_VENDOR_DOOR";
|
|
99
|
+
/** The hosts a vendor's key is bound to in door mode: its API, and the
|
|
100
|
+
* remote-control hosts known so far. Browserbase's and Hyperbrowser's
|
|
101
|
+
* remote-control hosts come back in their session answers and are added as
|
|
102
|
+
* FOL-151 qualifies them; until then those vendors fail closed there. */
|
|
103
|
+
export const VENDOR_DOOR_HOSTS = {
|
|
104
|
+
browserbase: ["api.browserbase.com"],
|
|
105
|
+
steel: ["api.steel.dev", "connect.steel.dev"],
|
|
106
|
+
hyperbrowser: ["api.hyperbrowser.ai"],
|
|
107
|
+
browserless: ["production-sfo.browserless.io", "production-lon.browserless.io", "production-ams.browserless.io"],
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* The vendor door for a step's vendor, or null. On only when the install
|
|
111
|
+
* says so — FOLDRUN_VENDOR_EGRESS=1, FOLDRUN_VENDOR_EGRESS_URL (the door's
|
|
112
|
+
* public address) — and the vendor is in FOLDRUN_VENDOR_EGRESS_VENDORS (the
|
|
113
|
+
* vendors qualified, or on trial while FOL-151 qualifies them; empty by
|
|
114
|
+
* default, so nothing changes until a vendor is listed).
|
|
115
|
+
*/
|
|
116
|
+
export function vendorDoorFor(vendor, env = process.env) {
|
|
117
|
+
const name = (vendor ?? "").trim().toLowerCase();
|
|
118
|
+
if (!name || env.FOLDRUN_VENDOR_EGRESS !== "1")
|
|
119
|
+
return null;
|
|
120
|
+
const server = (env.FOLDRUN_VENDOR_EGRESS_URL ?? "").trim();
|
|
121
|
+
if (!/^https?:\/\/[^/\s]+$/.test(server.replace(/\/$/, "")))
|
|
122
|
+
return null;
|
|
123
|
+
const listed = (env.FOLDRUN_VENDOR_EGRESS_VENDORS ?? "").split(",").map((v) => v.trim().toLowerCase()).filter(Boolean);
|
|
124
|
+
if (!listed.includes(name) || !VENDOR_DOOR_HOSTS[name])
|
|
125
|
+
return null;
|
|
126
|
+
if (browseTier(name).tier !== "vendor")
|
|
127
|
+
return null;
|
|
128
|
+
return { vendor: name, server: server.replace(/\/$/, "") };
|
|
129
|
+
}
|
package/dist/src/egress.d.ts
CHANGED
|
@@ -72,6 +72,15 @@ export interface EgressGrant {
|
|
|
72
72
|
search?: {
|
|
73
73
|
max?: number;
|
|
74
74
|
};
|
|
75
|
+
/** FOL-145: a step whose vendor browser is held to its list. The proxy
|
|
76
|
+
* applies the vendor's session rules (foldrun-platform
|
|
77
|
+
* vendor-session-policy.ts) to that vendor's API calls on the /e/ door —
|
|
78
|
+
* the call that starts a browser gets `server`, foldrun's vendor egress
|
|
79
|
+
* door, as its only proxy. Absent: nothing changes. */
|
|
80
|
+
vendorDoor?: {
|
|
81
|
+
vendor: string;
|
|
82
|
+
server: string;
|
|
83
|
+
};
|
|
75
84
|
}
|
|
76
85
|
export interface EgressLease {
|
|
77
86
|
/** The base the pod sends through: `http://…/e/<token>`. */
|
|
@@ -1026,8 +1026,13 @@ FROM base AS browsers
|
|
|
1026
1026
|
# --with-deps packages, so a Playwright bump that dropped it would have
|
|
1027
1027
|
# broken every windowed browser without a word. No xauth: nothing here runs
|
|
1028
1028
|
# xvfb-run, and Xvfb started without -auth takes the local client as it is.
|
|
1029
|
+
# libnss3-tools for certutil: Firefox trusts a CA only from its own
|
|
1030
|
+
# profile's NSS database (not the system store, SSL_CERT_FILE, enterprise
|
|
1031
|
+
# roots or a distribution policy — each tried in this image, 8 Nov 2026), so
|
|
1032
|
+
# web browse puts the egress CA there for a step held to its network: list
|
|
1033
|
+
# (FOL-128). ~1 MB.
|
|
1029
1034
|
RUN apt-get update \\
|
|
1030
|
-
&& apt-get install -y --no-install-recommends xvfb \\
|
|
1035
|
+
&& apt-get install -y --no-install-recommends xvfb libnss3-tools \\
|
|
1031
1036
|
&& rm -rf /var/lib/apt/lists/*
|
|
1032
1037
|
# Google Chrome and Chrome beta come from Google's apt repository, which
|
|
1033
1038
|
# Playwright adds; each is tried ENGINE_DOWNLOAD_ATTEMPTS times. Only on
|
package/dist/src/runner.js
CHANGED
|
@@ -49,7 +49,7 @@ import { PromptLayers, promptCacheKey } from "./prompt-layers.js";
|
|
|
49
49
|
import { loadCatalog, checkModel, clampEffort, catalogCost, findModel, tokenPriceOf } from "./catalog.js";
|
|
50
50
|
import { resolveSecrets, getSecret, materializeSecrets, secretSites, isClientCertValue, clientCertOf, withoutHeldCerts, isIdentityValue, identityOf } from "./secrets.js";
|
|
51
51
|
import { resolveNetwork, networkLine, networkEnforceWanted, proxyEnv, siteCovers, EGRESS_CA_ENV } from "./network.js";
|
|
52
|
-
import { BROWSER_CONFINED_ENV, browseNetworkLine, browseVerdict } from "./browse-egress.js";
|
|
52
|
+
import { BROWSER_CONFINED_ENV, VENDOR_DOOR_ENV, VENDOR_DOOR_HOSTS, browseNetworkLine, browseVerdict, vendorDoorFor } from "./browse-egress.js";
|
|
53
53
|
import { SEARCH_DOOR_ENV, searchDoorWanted, searchProvided } from "./search-egress.js";
|
|
54
54
|
import { materializeFileSecrets, cleanupFileSecrets } from "./secret-files.js";
|
|
55
55
|
import { buildApiTools, secretsUsedByApi } from "./api-tools.js";
|
|
@@ -2773,6 +2773,20 @@ mayDefer) {
|
|
|
2773
2773
|
// Secrets bound to sites in the vault: filled by the proxy for those
|
|
2774
2774
|
// sites alone, never put in the sandbox (egress.ts).
|
|
2775
2775
|
const boundSites = secretSites(tenant, Object.keys(liveSecrets), workspaceName);
|
|
2776
|
+
// FOL-145: a vendor browser the install holds through its vendor door —
|
|
2777
|
+
// the vendor's key bound to the vendor's hosts (so it is a name in the
|
|
2778
|
+
// sandbox and the proxy fills it, under the vendor's session rules),
|
|
2779
|
+
// and the door on the grant. Only where the install lists the vendor.
|
|
2780
|
+
// Only for a step that may browse: a step whose web block only fetches
|
|
2781
|
+
// or searches keeps its vendor calls as they were (Codex review).
|
|
2782
|
+
const mayBrowse = scriptSpecs.some((sc) => sc.name === "web") && (!web.actions || web.actions.includes("browse"));
|
|
2783
|
+
const vendorDoor = mayBrowse ? vendorDoorFor(clockEnv.FOLDRUN_BROWSER_VENDOR) : null;
|
|
2784
|
+
if (vendorDoor) {
|
|
2785
|
+
const key = clockEnv.FOLDRUN_BROWSER_SECRET;
|
|
2786
|
+
if (key && key in liveSecrets)
|
|
2787
|
+
boundSites[key] = [...new Set([...(boundSites[key] ?? []), ...VENDOR_DOOR_HOSTS[vendorDoor.vendor]])];
|
|
2788
|
+
grant.vendorDoor = vendorDoor;
|
|
2789
|
+
}
|
|
2776
2790
|
const network = resolveNetwork({
|
|
2777
2791
|
account: readAgentsMd(accountDir(tenant))?.data?.network,
|
|
2778
2792
|
workspace: readAgentsMd(workspaceRootOf(agentDir))?.data?.network,
|
|
@@ -2840,6 +2854,7 @@ mayDefer) {
|
|
|
2840
2854
|
enforce: lease.enforce === true,
|
|
2841
2855
|
vendor: clockEnv.FOLDRUN_BROWSER_VENDOR,
|
|
2842
2856
|
confines: !!isolation && platform.confinesBrowsing?.(isolation) === true,
|
|
2857
|
+
door: !!grant.vendorDoor,
|
|
2843
2858
|
})
|
|
2844
2859
|
: null;
|
|
2845
2860
|
if (lease && browse?.kind === "refuse") {
|
|
@@ -2882,10 +2897,10 @@ mayDefer) {
|
|
|
2882
2897
|
// credential as launch options instead (FOLDRUN_BROWSER_CONFINED).
|
|
2883
2898
|
// Every other browsing step is open by default, and its bound secrets
|
|
2884
2899
|
// materialise as they did before the door.
|
|
2885
|
-
const forward = lease?.proxy && (!browses || browse?.kind === "hosted") ? lease : null;
|
|
2900
|
+
const forward = lease?.proxy && (!browses || browse?.kind === "hosted" || browse?.kind === "vendor") ? lease : null;
|
|
2886
2901
|
// A browsing step on an install with the door says whether it is held
|
|
2887
2902
|
// to its list, and which tier its browser falls in (browse-egress.ts).
|
|
2888
|
-
push("info", browse ? browseNetworkLine(network, clockEnv.FOLDRUN_BROWSER_VENDOR, { hosted: browse.kind === "hosted" }) : networkLine(network, forward ? forward.enforce === true : null));
|
|
2903
|
+
push("info", browse ? browseNetworkLine(network, clockEnv.FOLDRUN_BROWSER_VENDOR, { hosted: browse.kind === "hosted", vendorDoor: browse.kind === "vendor" }) : networkLine(network, forward ? forward.enforce === true : null));
|
|
2889
2904
|
// Web search under a held list (FOL-128, search-egress.ts): the
|
|
2890
2905
|
// account's engine through the proxy's search door, for the actions
|
|
2891
2906
|
// our engine answers — decided here, from this step's own config and
|
|
@@ -3137,6 +3152,9 @@ mayDefer) {
|
|
|
3137
3152
|
// cannot go through it, and the platform starts no account
|
|
3138
3153
|
// browser pod for it (browse-egress.ts, FOL-110 phase 3).
|
|
3139
3154
|
...(browse?.kind === "hosted" ? { [BROWSER_CONFINED_ENV]: "1" } : {}),
|
|
3155
|
+
// FOL-145: its vendor's calls and remote-control socket go through
|
|
3156
|
+
// the egress proxy's /e/ door, under the vendor's session rules.
|
|
3157
|
+
...(browse?.kind === "vendor" ? { [VENDOR_DOOR_ENV]: "1" } : {}),
|
|
3140
3158
|
// The search door's address, for the driver: a step it walls
|
|
3141
3159
|
// searches there, with the tool told it is held (search-egress.ts).
|
|
3142
3160
|
...(grant.search && lease?.search ? { [SEARCH_DOOR_ENV]: lease.search } : {}),
|
package/package.json
CHANGED
package/src/browse-egress.ts
CHANGED
|
@@ -68,6 +68,10 @@ export function browseTier(vendor: string | null | undefined): { tier: BrowseTie
|
|
|
68
68
|
export type BrowseVerdict =
|
|
69
69
|
| { kind: "legacy" }
|
|
70
70
|
| { kind: "hosted" }
|
|
71
|
+
/** FOL-145: a vendor's browser held to the list through foldrun's vendor
|
|
72
|
+
* door — the vendor's key bound to its API, the proxy's session rules on
|
|
73
|
+
* every call, the door its only proxy. */
|
|
74
|
+
| { kind: "vendor"; vendor: string }
|
|
71
75
|
| { kind: "refuse"; message: string };
|
|
72
76
|
|
|
73
77
|
export function browseVerdict(o: {
|
|
@@ -79,10 +83,13 @@ export function browseVerdict(o: {
|
|
|
79
83
|
vendor: string | null | undefined;
|
|
80
84
|
/** Can this executor wall the step's network (Platform.confinesBrowsing)? */
|
|
81
85
|
confines: boolean;
|
|
86
|
+
/** The step's grant carries a vendor door for this vendor (vendorDoorFor). */
|
|
87
|
+
door?: boolean;
|
|
82
88
|
}): BrowseVerdict {
|
|
83
89
|
if (o.level === "open" || !o.enforce || !o.confines) return { kind: "legacy" };
|
|
84
90
|
const { tier, title } = browseTier(o.vendor);
|
|
85
91
|
if (tier === "hosted") return { kind: "hosted" };
|
|
92
|
+
if (tier === "vendor" && o.door) return { kind: "vendor", vendor: (o.vendor ?? "").trim().toLowerCase() };
|
|
86
93
|
const why =
|
|
87
94
|
tier === "vendor"
|
|
88
95
|
? `${title} browses from its own network, and foldrun cannot hold it to network: until that vendor is qualified (FOL-110 phase 4)`
|
|
@@ -100,8 +107,12 @@ export function browseVerdict(o: {
|
|
|
100
107
|
* an egress proxy: the step's list, and whether it holds — `hosted` when
|
|
101
108
|
* browseVerdict put the step under the wall, else the plain fact that it
|
|
102
109
|
* does not hold yet, for the browser or anything else in the step. */
|
|
103
|
-
export function browseNetworkLine(policy: NetworkPolicy, vendor: string | null | undefined, opts: { hosted?: boolean } = {}): string {
|
|
110
|
+
export function browseNetworkLine(policy: NetworkPolicy, vendor: string | null | undefined, opts: { hosted?: boolean; vendorDoor?: boolean } = {}): string {
|
|
104
111
|
const what = networkLine(policy, true);
|
|
112
|
+
if (opts.vendorDoor) {
|
|
113
|
+
const { title } = browseTier(vendor);
|
|
114
|
+
return `${what} — enforced — through foldrun's vendor door: ${title}'s browser runs on the vendor's machines, and the session it starts has foldrun's door as its only proxy, so its pages are held to this list (no site a secret is bound to: a vendor's browser cannot trust foldrun's certificate, FOL-145).`;
|
|
115
|
+
}
|
|
105
116
|
if (opts.hosted) {
|
|
106
117
|
return `${what} — enforced — hosted: the browser runs inside this step's sandbox, whose network reaches only the egress proxy (which holds the list), so a page, a script or a changed proxy setting reaches no site off the list.`;
|
|
107
118
|
}
|
|
@@ -117,3 +128,40 @@ export function browseNetworkLine(policy: NetworkPolicy, vendor: string | null |
|
|
|
117
128
|
: `. Its browser (${title}) always browses through its own network and cannot be held to network: — a restricted, enforced network: will refuse it (FOL-110)`;
|
|
118
129
|
return `${what}${now}${later}.`;
|
|
119
130
|
}
|
|
131
|
+
|
|
132
|
+
// ------------------------------------------------ FOL-145: the vendor door
|
|
133
|
+
|
|
134
|
+
/** Set to "1" for a step whose vendor browser is held through the door:
|
|
135
|
+
* the web tool sends the vendor's API calls and its remote-control
|
|
136
|
+
* WebSocket through the egress proxy's /e/ door (Playwright's
|
|
137
|
+
* connectOverCDP ignores HTTPS_PROXY, so a walled sandbox has no other way). */
|
|
138
|
+
export const VENDOR_DOOR_ENV = "FOLDRUN_VENDOR_DOOR";
|
|
139
|
+
|
|
140
|
+
/** The hosts a vendor's key is bound to in door mode: its API, and the
|
|
141
|
+
* remote-control hosts known so far. Browserbase's and Hyperbrowser's
|
|
142
|
+
* remote-control hosts come back in their session answers and are added as
|
|
143
|
+
* FOL-151 qualifies them; until then those vendors fail closed there. */
|
|
144
|
+
export const VENDOR_DOOR_HOSTS: Readonly<Record<string, readonly string[]>> = {
|
|
145
|
+
browserbase: ["api.browserbase.com"],
|
|
146
|
+
steel: ["api.steel.dev", "connect.steel.dev"],
|
|
147
|
+
hyperbrowser: ["api.hyperbrowser.ai"],
|
|
148
|
+
browserless: ["production-sfo.browserless.io", "production-lon.browserless.io", "production-ams.browserless.io"],
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The vendor door for a step's vendor, or null. On only when the install
|
|
153
|
+
* says so — FOLDRUN_VENDOR_EGRESS=1, FOLDRUN_VENDOR_EGRESS_URL (the door's
|
|
154
|
+
* public address) — and the vendor is in FOLDRUN_VENDOR_EGRESS_VENDORS (the
|
|
155
|
+
* vendors qualified, or on trial while FOL-151 qualifies them; empty by
|
|
156
|
+
* default, so nothing changes until a vendor is listed).
|
|
157
|
+
*/
|
|
158
|
+
export function vendorDoorFor(vendor: string | null | undefined, env: Record<string, string | undefined> = process.env): { vendor: string; server: string } | null {
|
|
159
|
+
const name = (vendor ?? "").trim().toLowerCase();
|
|
160
|
+
if (!name || env.FOLDRUN_VENDOR_EGRESS !== "1") return null;
|
|
161
|
+
const server = (env.FOLDRUN_VENDOR_EGRESS_URL ?? "").trim();
|
|
162
|
+
if (!/^https?:\/\/[^/\s]+$/.test(server.replace(/\/$/, ""))) return null;
|
|
163
|
+
const listed = (env.FOLDRUN_VENDOR_EGRESS_VENDORS ?? "").split(",").map((v) => v.trim().toLowerCase()).filter(Boolean);
|
|
164
|
+
if (!listed.includes(name) || !VENDOR_DOOR_HOSTS[name]) return null;
|
|
165
|
+
if (browseTier(name).tier !== "vendor") return null;
|
|
166
|
+
return { vendor: name, server: server.replace(/\/$/, "") };
|
|
167
|
+
}
|
package/src/egress.ts
CHANGED
|
@@ -132,6 +132,12 @@ export interface EgressGrant {
|
|
|
132
132
|
* searchDoorWanted): a held step's way to the account's search engine.
|
|
133
133
|
* `max` caps how many searches go through it. Absent: the door refuses. */
|
|
134
134
|
search?: { max?: number };
|
|
135
|
+
/** FOL-145: a step whose vendor browser is held to its list. The proxy
|
|
136
|
+
* applies the vendor's session rules (foldrun-platform
|
|
137
|
+
* vendor-session-policy.ts) to that vendor's API calls on the /e/ door —
|
|
138
|
+
* the call that starts a browser gets `server`, foldrun's vendor egress
|
|
139
|
+
* door, as its only proxy. Absent: nothing changes. */
|
|
140
|
+
vendorDoor?: { vendor: string; server: string };
|
|
135
141
|
}
|
|
136
142
|
|
|
137
143
|
export interface EgressLease {
|
package/src/run-container.ts
CHANGED
|
@@ -1223,8 +1223,13 @@ FROM base AS browsers
|
|
|
1223
1223
|
# --with-deps packages, so a Playwright bump that dropped it would have
|
|
1224
1224
|
# broken every windowed browser without a word. No xauth: nothing here runs
|
|
1225
1225
|
# xvfb-run, and Xvfb started without -auth takes the local client as it is.
|
|
1226
|
+
# libnss3-tools for certutil: Firefox trusts a CA only from its own
|
|
1227
|
+
# profile's NSS database (not the system store, SSL_CERT_FILE, enterprise
|
|
1228
|
+
# roots or a distribution policy — each tried in this image, 8 Nov 2026), so
|
|
1229
|
+
# web browse puts the egress CA there for a step held to its network: list
|
|
1230
|
+
# (FOL-128). ~1 MB.
|
|
1226
1231
|
RUN apt-get update \\
|
|
1227
|
-
&& apt-get install -y --no-install-recommends xvfb \\
|
|
1232
|
+
&& apt-get install -y --no-install-recommends xvfb libnss3-tools \\
|
|
1228
1233
|
&& rm -rf /var/lib/apt/lists/*
|
|
1229
1234
|
# Google Chrome and Chrome beta come from Google's apt repository, which
|
|
1230
1235
|
# Playwright adds; each is tried ENGINE_DOWNLOAD_ATTEMPTS times. Only on
|
package/src/runner.ts
CHANGED
|
@@ -102,7 +102,7 @@ import { PromptLayers, promptCacheKey } from "./prompt-layers.ts";
|
|
|
102
102
|
import { loadCatalog, checkModel, clampEffort, catalogCost, findModel, tokenPriceOf, type Catalog, type TokenPrice } from "./catalog.ts";
|
|
103
103
|
import { resolveSecrets, getSecret, materializeSecrets, secretSites, isClientCertValue, clientCertOf, withoutHeldCerts, isIdentityValue, identityOf } from "./secrets.ts";
|
|
104
104
|
import { resolveNetwork, networkLine, networkEnforceWanted, proxyEnv, siteCovers, EGRESS_CA_ENV } from "./network.ts";
|
|
105
|
-
import { BROWSER_CONFINED_ENV, browseNetworkLine, browseVerdict } from "./browse-egress.ts";
|
|
105
|
+
import { BROWSER_CONFINED_ENV, VENDOR_DOOR_ENV, VENDOR_DOOR_HOSTS, browseNetworkLine, browseVerdict, vendorDoorFor } from "./browse-egress.ts";
|
|
106
106
|
import { SEARCH_DOOR_ENV, searchDoorWanted, searchProvided } from "./search-egress.ts";
|
|
107
107
|
import { materializeFileSecrets, cleanupFileSecrets } from "./secret-files.ts";
|
|
108
108
|
import { buildApiTools, secretsUsedByApi } from "./api-tools.ts";
|
|
@@ -2977,6 +2977,19 @@ async function runStep(
|
|
|
2977
2977
|
// Secrets bound to sites in the vault: filled by the proxy for those
|
|
2978
2978
|
// sites alone, never put in the sandbox (egress.ts).
|
|
2979
2979
|
const boundSites = secretSites(tenant, Object.keys(liveSecrets), workspaceName);
|
|
2980
|
+
// FOL-145: a vendor browser the install holds through its vendor door —
|
|
2981
|
+
// the vendor's key bound to the vendor's hosts (so it is a name in the
|
|
2982
|
+
// sandbox and the proxy fills it, under the vendor's session rules),
|
|
2983
|
+
// and the door on the grant. Only where the install lists the vendor.
|
|
2984
|
+
// Only for a step that may browse: a step whose web block only fetches
|
|
2985
|
+
// or searches keeps its vendor calls as they were (Codex review).
|
|
2986
|
+
const mayBrowse = scriptSpecs.some((sc) => sc.name === "web") && (!web.actions || web.actions.includes("browse"));
|
|
2987
|
+
const vendorDoor = mayBrowse ? vendorDoorFor(clockEnv.FOLDRUN_BROWSER_VENDOR) : null;
|
|
2988
|
+
if (vendorDoor) {
|
|
2989
|
+
const key = clockEnv.FOLDRUN_BROWSER_SECRET;
|
|
2990
|
+
if (key && key in liveSecrets) boundSites[key] = [...new Set([...(boundSites[key] ?? []), ...VENDOR_DOOR_HOSTS[vendorDoor.vendor]!])];
|
|
2991
|
+
grant.vendorDoor = vendorDoor;
|
|
2992
|
+
}
|
|
2980
2993
|
const network = resolveNetwork({
|
|
2981
2994
|
account: readAgentsMd(accountDir(tenant))?.data?.network,
|
|
2982
2995
|
workspace: readAgentsMd(workspaceRootOf(agentDir))?.data?.network,
|
|
@@ -3048,6 +3061,7 @@ async function runStep(
|
|
|
3048
3061
|
enforce: lease.enforce === true,
|
|
3049
3062
|
vendor: clockEnv.FOLDRUN_BROWSER_VENDOR,
|
|
3050
3063
|
confines: !!isolation && platform.confinesBrowsing?.(isolation) === true,
|
|
3064
|
+
door: !!grant.vendorDoor,
|
|
3051
3065
|
})
|
|
3052
3066
|
: null;
|
|
3053
3067
|
if (lease && browse?.kind === "refuse") {
|
|
@@ -3091,10 +3105,10 @@ async function runStep(
|
|
|
3091
3105
|
// credential as launch options instead (FOLDRUN_BROWSER_CONFINED).
|
|
3092
3106
|
// Every other browsing step is open by default, and its bound secrets
|
|
3093
3107
|
// materialise as they did before the door.
|
|
3094
|
-
const forward = lease?.proxy && (!browses || browse?.kind === "hosted") ? lease : null;
|
|
3108
|
+
const forward = lease?.proxy && (!browses || browse?.kind === "hosted" || browse?.kind === "vendor") ? lease : null;
|
|
3095
3109
|
// A browsing step on an install with the door says whether it is held
|
|
3096
3110
|
// to its list, and which tier its browser falls in (browse-egress.ts).
|
|
3097
|
-
push("info", browse ? browseNetworkLine(network, clockEnv.FOLDRUN_BROWSER_VENDOR, { hosted: browse.kind === "hosted" }) : networkLine(network, forward ? forward.enforce === true : null));
|
|
3111
|
+
push("info", browse ? browseNetworkLine(network, clockEnv.FOLDRUN_BROWSER_VENDOR, { hosted: browse.kind === "hosted", vendorDoor: browse.kind === "vendor" }) : networkLine(network, forward ? forward.enforce === true : null));
|
|
3098
3112
|
// Web search under a held list (FOL-128, search-egress.ts): the
|
|
3099
3113
|
// account's engine through the proxy's search door, for the actions
|
|
3100
3114
|
// our engine answers — decided here, from this step's own config and
|
|
@@ -3347,6 +3361,9 @@ async function runStep(
|
|
|
3347
3361
|
// cannot go through it, and the platform starts no account
|
|
3348
3362
|
// browser pod for it (browse-egress.ts, FOL-110 phase 3).
|
|
3349
3363
|
...(browse?.kind === "hosted" ? { [BROWSER_CONFINED_ENV]: "1" } : {}),
|
|
3364
|
+
// FOL-145: its vendor's calls and remote-control socket go through
|
|
3365
|
+
// the egress proxy's /e/ door, under the vendor's session rules.
|
|
3366
|
+
...(browse?.kind === "vendor" ? { [VENDOR_DOOR_ENV]: "1" } : {}),
|
|
3350
3367
|
// The search door's address, for the driver: a step it walls
|
|
3351
3368
|
// searches there, with the tool told it is held (search-egress.ts).
|
|
3352
3369
|
...(grant.search && lease?.search ? { [SEARCH_DOOR_ENV]: lease.search } : {}),
|