Skip to content

Commit 438d6b0

Browse files
fix(guardrails): rename PRESIDIO_URL env var to PII_URL
Match the infra taskdef, which sets PII_URL on the app container for the combined Presidio sidecar.
1 parent e4935bf commit 438d6b0

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

apps/sim/lib/core/config/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ export const env = createEnv({
311311
PORT: z.number().optional(), // Main application port
312312
INTERNAL_API_BASE_URL: z.string().optional(), // Optional internal base URL for server-side self-calls; must include protocol if set (e.g., http://sim-app.namespace.svc.cluster.local:3000)
313313
ALLOWED_ORIGINS: z.string().optional(), // CORS allowed origins
314-
PRESIDIO_URL: z.string().optional(), // Presidio sidecar base URL serving /analyze + /anonymize (default http://localhost:5001)
314+
PII_URL: z.string().optional(), // Presidio PII sidecar base URL serving /analyze + /anonymize (default http://localhost:5001)
315315

316316
// OAuth Integration Credentials - All optional, enables third-party integrations
317317
GOOGLE_CLIENT_ID: z.string().optional(), // Google OAuth client ID for Google services

apps/sim/lib/guardrails/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ docker run -d -p 5001:5001 sim-pii
3535
Point the app at it (default shown):
3636

3737
```bash
38-
PRESIDIO_URL=http://localhost:5001
38+
PII_URL=http://localhost:5001
3939
```
4040

4141
The image bakes in the recognizers itself — a check-digit-validated **VIN** recognizer and

apps/sim/lib/guardrails/validate_pii.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const REQUEST_TIMEOUT_MS = 45_000
1212
const MASK_CONCURRENCY = 8
1313

1414
/** Single Presidio sidecar serving both /analyze and /anonymize (VIN is native there). */
15-
const PRESIDIO_URL = env.PRESIDIO_URL || 'http://localhost:5001'
15+
const PII_URL = env.PII_URL || 'http://localhost:5001'
1616

1717
export interface PIIValidationInput {
1818
text: string
@@ -56,7 +56,7 @@ async function analyze(
5656
const entities = entityTypes.length > 0 ? entityTypes : undefined
5757

5858
// boundary-raw-fetch: internal call to the Presidio analyzer sidecar over localhost
59-
const response = await fetch(`${PRESIDIO_URL}/analyze`, {
59+
const response = await fetch(`${PII_URL}/analyze`, {
6060
method: 'POST',
6161
headers: { 'content-type': 'application/json' },
6262
body: JSON.stringify({ text, language, ...(entities ? { entities } : {}) }),
@@ -77,7 +77,7 @@ async function anonymize(text: string, spans: AnalyzerSpan[]): Promise<string> {
7777
if (spans.length === 0) return text
7878

7979
// boundary-raw-fetch: internal call to the Presidio anonymizer sidecar over localhost
80-
const response = await fetch(`${PRESIDIO_URL}/anonymize`, {
80+
const response = await fetch(`${PII_URL}/anonymize`, {
8181
method: 'POST',
8282
headers: { 'content-type': 'application/json' },
8383
body: JSON.stringify({ text, analyzer_results: spans }),

0 commit comments

Comments
 (0)