File size: 11,724 Bytes
6111b2b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
335
336
337
338
339
340
341
export interface FeatureFlagDefinition {
  key: string;
  label: string;
  description: string;
  descriptionI18nKey: string;
  category: "security" | "network" | "policies" | "runtime" | "cli" | "health";
  defaultValue: string;
  type: "boolean" | "enum";
  enumValues?: string[];
  requiresRestart: boolean;
  warningLevel?: "info" | "caution" | "danger";
}

export const FEATURE_FLAG_DEFINITIONS: FeatureFlagDefinition[] = [
  // ──────────────── Security (6) ────────────────
  {
    key: "REQUIRE_API_KEY",
    label: "Require API Key",
    description: "Require an API key for all incoming requests",
    descriptionI18nKey: "featureFlagRequireApiKeyDescription",
    category: "security",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "caution",
  },
  {
    key: "INPUT_SANITIZER_ENABLED",
    label: "Input Sanitizer",
    description: "Enable input sanitization for all requests",
    descriptionI18nKey: "featureFlagInputSanitizerEnabledDescription",
    category: "security",
    defaultValue: "true",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "INJECTION_GUARD_MODE",
    label: "Injection Guard Mode",
    description: "Set the prompt injection guard mode",
    descriptionI18nKey: "featureFlagInjectionGuardModeDescription",
    category: "security",
    defaultValue: "off",
    type: "enum",
    enumValues: ["off", "warn", "block", "redact"],
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "PII_REDACTION_ENABLED",
    label: "PII Redaction",
    description: "Redact personally identifiable information from requests",
    descriptionI18nKey: "featureFlagPiiRedactionEnabledDescription",
    category: "security",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "PII_RESPONSE_SANITIZATION",
    label: "PII Response Sanitization",
    description: "Sanitize PII from provider responses",
    descriptionI18nKey: "featureFlagPiiResponseSanitizationDescription",
    category: "security",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "PII_RESPONSE_SANITIZATION_MODE",
    label: "PII Response Sanitization Mode",
    description:
      "Mode for PII response sanitization: redact (replace PII), warn (log only), block (reject), off (disable)",
    descriptionI18nKey: "featureFlagPiiResponseSanitizationModeDescription",
    category: "security",
    defaultValue: "redact",
    type: "enum",
    enumValues: ["redact", "warn", "block", "off"],
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "OUTBOUND_SSRF_GUARD_ENABLED",
    label: "SSRF Guard",
    description: "Block outbound requests to private/internal IP ranges",
    descriptionI18nKey: "featureFlagOutboundSsrfGuardEnabledDescription",
    category: "security",
    defaultValue: "true",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },

  // ──────────────── Network (5) ────────────────
  {
    key: "ENABLE_TLS_FINGERPRINT",
    label: "TLS Fingerprint",
    description: "Enable TLS fingerprint stealth mode",
    descriptionI18nKey: "featureFlagEnableTlsFingerprintDescription",
    category: "network",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: true,
    warningLevel: "info",
  },
  {
    key: "ONEPROXY_ENABLED",
    label: "OneProxy Enabled",
    description: "Enable 1proxy request proxying.",
    descriptionI18nKey: "settings.featureFlags.oneproxyEnabled",
    category: "network",
    defaultValue: "true",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "MITM_DISABLE_TLS_VERIFY",
    label: "Disable TLS Verify (MITM)",
    description: "Disable TLS certificate verification for MITM proxy",
    descriptionI18nKey: "featureFlagMitmDisableTlsVerifyDescription",
    category: "network",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: true,
    warningLevel: "danger",
  },
  {
    key: "OMNIROUTE_ALLOW_PRIVATE_PROVIDER_URLS",
    label: "Allow Private Provider URLs",
    description: "Allow provider URLs pointing to private/internal networks",
    descriptionI18nKey: "featureFlagOmnirouteAllowPrivateProviderUrlsDescription",
    category: "network",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "caution",
  },
  {
    key: "ENABLE_CC_COMPATIBLE_PROVIDER",
    label: "CC Compatible Provider",
    description: "Enable Claude Code compatible provider mode",
    descriptionI18nKey: "featureFlagEnableCcCompatibleProviderDescription",
    category: "network",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: true,
    warningLevel: "info",
  },

  // ──────────────── Policies (3) ────────────────
  {
    key: "TOOL_POLICY_MODE",
    label: "Tool Policy Mode",
    description: "Set the tool use policy enforcement mode",
    descriptionI18nKey: "featureFlagToolPolicyModeDescription",
    category: "policies",
    defaultValue: "disabled",
    type: "enum",
    enumValues: ["disabled", "warn", "block"],
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "RATE_LIMIT_AUTO_ENABLE",
    label: "Rate Limit Auto-Enable",
    description: "Automatically enable rate limiting based on usage patterns",
    descriptionI18nKey: "featureFlagRateLimitAutoEnableDescription",
    category: "policies",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "ALLOW_MULTI_CONNECTIONS_PER_COMPAT_NODE",
    label: "Multi Connections per Compat Node",
    description: "Allow multiple connections per compatibility node",
    descriptionI18nKey: "featureFlagAllowMultiConnectionsPerCompatNodeDescription",
    category: "policies",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: true,
    warningLevel: "info",
  },

  // ──────────────── Runtime (7) ────────────────
  {
    key: "OMNIROUTE_MCP_ENFORCE_SCOPES",
    label: "MCP Enforce Scopes",
    description: "Enforce scope restrictions on MCP tool access",
    descriptionI18nKey: "featureFlagOmnirouteMcpEnforceScopesDescription",
    category: "runtime",
    defaultValue: "true",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "caution",
  },
  {
    key: "OMNIROUTE_MCP_COMPRESS_DESCRIPTIONS",
    label: "MCP Compress Descriptions",
    description: "Compress MCP tool descriptions to reduce token usage",
    descriptionI18nKey: "featureFlagOmnirouteMcpCompressDescriptionsDescription",
    category: "runtime",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "OMNIROUTE_ENABLE_RUNTIME_BACKGROUND_TASKS",
    label: "Runtime Background Tasks",
    description: "Enable background task processing at runtime",
    descriptionI18nKey: "featureFlagOmnirouteEnableRuntimeBackgroundTasksDescription",
    category: "runtime",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "OMNIROUTE_DISABLE_BACKGROUND_SERVICES",
    label: "Disable Background Services",
    description: "Disable all background services (quota refresh, sync, etc)",
    descriptionI18nKey: "featureFlagOmnirouteDisableBackgroundServicesDescription",
    category: "runtime",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: true,
    warningLevel: "caution",
  },
  {
    key: "OMNIROUTE_RTK_TRUST_PROJECT_FILTERS",
    label: "RTK Trust Project Filters",
    description: "Trust project-level filters from RTK without validation",
    descriptionI18nKey: "featureFlagOmnirouteRtkTrustProjectFiltersDescription",
    category: "runtime",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "caution",
  },
  {
    key: "OMNIROUTE_ENABLE_LIVE_WS",
    label: "Live Dashboard WebSocket",
    description:
      "Start the real-time dashboard WebSocket server on import (port 20129 by default).",
    descriptionI18nKey: "featureFlagOmnirouteEnableLiveWsDescription",
    category: "runtime",
    defaultValue: "true",
    type: "boolean",
    requiresRestart: true,
    warningLevel: "info",
  },
  {
    key: "OMNIROUTE_CODEX_WS_ENABLED",
    label: "Codex Responses WebSocket",
    description:
      "Allow Codex to use the Responses-over-WebSocket transport (the codex CLI WS endpoint and codexTransport=websocket). When off, Codex falls back to HTTP Responses.",
    descriptionI18nKey: "featureFlagOmnirouteCodexWsEnabledDescription",
    category: "runtime",
    defaultValue: "true",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },

  // ──────────────── CLI (3) ────────────────
  {
    key: "CLI_COMPAT_ALL",
    label: "CLI Compat All",
    description: "Enable compatibility mode for all CLI clients",
    descriptionI18nKey: "featureFlagCliCompatAllDescription",
    category: "cli",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: true,
    warningLevel: "info",
  },
  {
    key: "MODEL_ALIAS_COMPAT_ENABLED",
    label: "Model Alias Compat",
    description: "Enable model alias compatibility layer",
    descriptionI18nKey: "featureFlagModelAliasCompatEnabledDescription",
    category: "cli",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "PRICING_SYNC_ENABLED",
    label: "Pricing Sync",
    description: "Enable automatic pricing data synchronization",
    descriptionI18nKey: "featureFlagPricingSyncEnabledDescription",
    category: "cli",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },

  // ──────────────── Health (3) ────────────────
  {
    key: "OMNIROUTE_DISABLE_LOCAL_HEALTHCHECK",
    label: "Disable Local Health Check",
    description: "Disable the local instance health check endpoint",
    descriptionI18nKey: "featureFlagOmnirouteDisableLocalHealthcheckDescription",
    category: "health",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "OMNIROUTE_DISABLE_TOKEN_HEALTHCHECK",
    label: "Disable Token Health Check",
    description: "Disable the token validation health check",
    descriptionI18nKey: "featureFlagOmnirouteDisableTokenHealthcheckDescription",
    category: "health",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "info",
  },
  {
    key: "SKILLS_SANDBOX_NETWORK_ENABLED",
    label: "Skills Sandbox Network",
    description: "Enable network access in the skills sandbox environment",
    descriptionI18nKey: "featureFlagSkillsSandboxNetworkEnabledDescription",
    category: "health",
    defaultValue: "false",
    type: "boolean",
    requiresRestart: false,
    warningLevel: "caution",
  },
];