Skip to content

PR 2: Add Alcatraz on Hoop - #1617

Open
matheusfrancisco wants to merge 5 commits into
mainfrom
add-alcatraz-gw
Open

PR 2: Add Alcatraz on Hoop#1617
matheusfrancisco wants to merge 5 commits into
mainfrom
add-alcatraz-gw

Conversation

@matheusfrancisco

@matheusfrancisco matheusfrancisco commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

📝 Description

Wires the new in-process Alcatraz DLP provider (libhoop redactor/alcatraz)
into the gateway and agent. Rollout is gated per organization by two feature
flags, both default-off: experimental.alcatraz_dlp switches an org to the
alcatraz provider without changing DLP_PROVIDER, and
experimental.alcatraz_ner lets the agent load the in-process ONNX NER model
so statistical entity types (PERSON, LOCATION, NRP) work. With the NER flag
off, sessions requesting those types fail closed with a remediation message —
no silent masking gaps.

🔗 Related Issue

Fixes #

🚀 Type of Change

  • ✨ New feature (non-breaking change which adds functionality)

📋 Changes Made

  • common/featureflag: register experimental.alcatraz_dlp (gateway) and
    experimental.alcatraz_ner (agent), both Default: false.
  • gateway/services/providers.go: new DLPProviderForOrg — the org flag
    takes precedence over DLP_PROVIDER; CheckRedactProviderForOrg accepts
    alcatraz (no credentials needed); updated ErrRedactProviderMissing text.
    All data-masking mutation paths (connections, datamasking, rulepacks, MCP
    tools) now validate through the org-scoped check.
  • gateway/appconfig: DLP_PROVIDER=alcatraz counts as a configured
    masking provider.
  • gateway/transport/client.go: sessions resolve the effective provider per
    org and forward data-masking entity types to alcatraz sessions.
  • agent/main.go: registers the NER provider at startup; the
    experimental.alcatraz_ner flag is checked lazily per session (flag state
    arrives via the existing FeatureFlagUpdate packet), so toggling it needs
    no agent restart. ALCATRAZ_NER_MODEL_PATH (optional env) points at a
    local model directory for air-gapped agents.
  • Deploy/docs: agent helm chart passes ALCATRAZ_NER_MODEL_PATH; gateway
    chart and .env.sample document the provider and flags.
  • go.mod/go.sum bumps in agent/client/gateway for the alcatraz modules.

🧪 Testing

Test Configuration:

  • Browser(s): N/A (backend change)
  • OS: macOS (darwin/arm64)

Tests performed:

  • Unit tests pass (common/featureflag,
    agent/controller/featureflagstate, libhoop redactor suites)
  • Integration tests pass
  • Manual testing completed

✅ Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

📄 Additional Notes

  • Depends on the libhoop PR "add: alcatraz on agent" — merge that first.https://github.com/hoophq/libhoop/pull/95
  • Both flags appear automatically in the admin UI; a fresh deployment has
    everything off, so default behavior is unchanged.
  • Memory caveat: once the NER model loads (~260MB resident), disabling the
    flag stops new NER sessions but does not unload the model until the agent
    restarts.
  • New env var ALCATRAZ_NER_MODEL_PATH is reflected in the agent helm chart
    (secret-config.yaml, values.yaml) and .env.sample per repo convention.

@matheusfrancisco matheusfrancisco added the minor Bumps the minor version on release (new features) label Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Migration Safety Analysis

No database migrations were changed in this PR. Safe to deploy to sandbox.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

📋 API Changelog

API Changelog unknown vs. unknown

API Changes

GET /serverinfo

  • ⚠️ added the new alcatraz enum value to the redact_provider response property for the response status 200

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Wire org-gated Alcatraz DLP provider into gateway and agent

✨ Enhancement ⚙️ Configuration changes 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Add org-scoped Alcatraz DLP provider selection via experimental.alcatraz_dlp.
• Gate agent ONNX NER loading with experimental.alcatraz_ner; fail closed when off.
• Document env/Helm settings and bump Go dependencies for Alcatraz modules.
Diagram

graph TD
client([Client]) --> gw[Gateway] --> prov{"Provider for org"} --> ag[Agent] --> alc{{"Alcatraz DLP"}}
gw --> flags[("Org feature flags")] --> prov
ag --> ner{"NER enabled?"} --> model{{"ONNX NER model"}} --> alc
subgraph Legend
  direction LR
  _svc[Service] ~~~ _cfg[(Config/flags)] ~~~ _dec{Decision} ~~~ _ext{{External}}
end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Make provider selection purely config-based (DLP_PROVIDER only)
  • ➕ Simpler mental model and fewer moving parts
  • ➕ Avoids per-org divergence within the same deployment
  • ➖ Requires deployment-level changes for rollout/rollback
  • ➖ Harder to do safe incremental enablement across organizations
2. Persist per-org DLP provider in DB config instead of feature flags
  • ➕ First-class configuration with auditability and explicit ownership
  • ➕ Can support more nuanced provider choices over time
  • ➖ More schema/API/UI work than a flag gate
  • ➖ Still needs a rollout strategy and may complicate migrations
3. Always load the NER model on agent start when alcatraz is used
  • ➕ Avoids first-request latency and simplifies runtime branching
  • ➕ More predictable behavior per agent instance
  • ➖ Forces a large memory hit even for orgs that don’t need PERSON/LOCATION/NRP
  • ➖ Makes safe rollout/rollback harder and increases baseline resource usage

Recommendation: Keep the PR’s approach: org-scoped flags provide a controlled rollout path without deployment churn, and lazy NER loading avoids imposing a large memory cost on organizations that don’t need statistical entity detection. The explicit fail-closed behavior when experimental.alcatraz_ner is off is the right safety posture to prevent silent masking gaps.

Files changed (19) +530 / -36

Enhancement (9) +92 / -10
main.goRegister Alcatraz NER provider with per-org, lazy enablement +34/-0

Register Alcatraz NER provider with per-org, lazy enablement

• Registers an Alcatraz NLP provider at agent startup, with actual model loading gated per session by the experimental.alcatraz_ner feature flag. Supports optional ALCATRAZ_NER_MODEL_PATH for local model directories and ensures registration is performed once for both Run and RunV2.

agent/main.go

featureflag.goRegister experimental.alcatraz_dlp and experimental.alcatraz_ner flags +14/-0

Register experimental.alcatraz_dlp and experimental.alcatraz_ner flags

• Adds two default-off experimental flags to the global catalog: one to select Alcatraz as the org’s DLP provider, and another to permit agent-side NER model loading. Includes detailed safety and operational notes in descriptions (lazy load, memory cost, fail-closed behavior).

common/featureflag/featureflag.go

datamasking_rules.goEnforce data masking provider availability per organization +1/-1

Enforce data masking provider availability per organization

• Switches provider validation to CheckRedactProviderForOrg so rule association updates are allowed when Alcatraz is enabled for the org even if DLP_PROVIDER is unchanged.

gateway/api/connections/datamasking_rules.go

datamasking.goGate datamasking mutation endpoints with org-scoped provider check +1/-1

Gate datamasking mutation endpoints with org-scoped provider check

• Updates the shared requireRedactProvider guard to validate provider availability using org context, aligning behavior with per-org Alcatraz rollout.

gateway/api/datamasking/datamasking.go

tools_datamasking.goApply org-scoped provider validation to MCP datamasking tools +2/-2

Apply org-scoped provider validation to MCP datamasking tools

• Ensures MCP tool handlers for creating/updating data masking rules validate provider availability with the organization-scoped check.

gateway/api/mcpserver/tools_datamasking.go

rulepacks.goUse org-scoped provider check when attaching rulepacks +1/-1

Use org-scoped provider check when attaching rulepacks

• Updates rulepack attach-time provider enforcement to respect the org’s effective provider (including Alcatraz via flag) before allowing provider-gated masking rules.

gateway/api/rulepacks/rulepacks.go

appconfig.goTreat DLP_PROVIDER=alcatraz as configured masking support +6/-0

Treat DLP_PROVIDER=alcatraz as configured masking support

• Extends HasRedactCredentials/configured-provider logic so the alcatraz provider counts as enforceable without requiring credentials or external service URLs.

gateway/appconfig/appconfig.go

providers.goAdd DLPProviderForOrg and org-scoped provider enforcement +26/-2

Add DLPProviderForOrg and org-scoped provider enforcement

• Introduces DLPProviderForOrg to let experimental.alcatraz_dlp override deployment DLP_PROVIDER per organization. Adds CheckRedactProviderForOrg, expands provider-missing error messaging to include alcatraz, and retains legacy CheckRedactProvider for callers without org context.

gateway/services/providers.go

client.goResolve per-org DLP provider for sessions and forward entity types to alcatraz +7/-3

Resolve per-org DLP provider for sessions and forward entity types to alcatraz

• Resolves the effective DLP provider per org on SessionOpen and forwards it to the agent. Extends rule-to-entity-type forwarding to include alcatraz (in addition to mspresidio) so entity selections/custom entities are available in alcatraz sessions.

gateway/transport/client.go

Documentation (3) +33 / -1
.env.sampleDocument alcatraz provider and NER model path env var +15/-1

Document alcatraz provider and NER model path env var

• Expands DLP_PROVIDER documentation to include the in-process alcatraz provider and clarifies that statistical entity types require the agent NER module. Adds ALCATRAZ_NER_MODEL_PATH documentation for air-gapped/lazy-download model loading.

.env.sample

values.yamlDocument agent NER module operational guidance in Helm values +11/-0

Document agent NER module operational guidance in Helm values

• Documents how the Alcatraz NER module works (lazy load, approximate memory footprint, air-gapped model path) and clarifies that enablement is controlled by the experimental.alcatraz_ner flag rather than an env var.

deploy/helm-chart/chart/agent/values.yaml

values.yamlDocument alcatraz as a supported gateway DLP_PROVIDER option +7/-0

Document alcatraz as a supported gateway DLP_PROVIDER option

• Updates gateway chart documentation to describe alcatraz as an in-process agent pattern engine requiring no credentials, and notes the additional NER flag requirement for statistical entity types.

deploy/helm-chart/chart/gateway/values.yaml

Other (7) +405 / -25
go.modAdd Alcatraz NER and ONNX/NLP dependency set +22/-2

Add Alcatraz NER and ONNX/NLP dependency set

• Introduces indirect dependencies required for the alcatraz NER backend (tokenizers/onnx runtime/gomlx-related libs) and adjusts a few standard library module versions. Enables agent build to include the in-process NER capability.

agent/go.mod

go.sumLock new agent dependency graph for Alcatraz NER +90/-2

Lock new agent dependency graph for Alcatraz NER

• Adds checksum entries for the new Alcatraz and ONNX/NLP-related dependencies pulled into the agent module.

agent/go.sum

go.modUpdate client dependencies for Alcatraz-related modules +28/-4

Update client dependencies for Alcatraz-related modules

• Updates and adds indirect dependencies (including Alcatraz modules and supporting libraries) to keep the client module compatible with the new provider wiring.

client/go.mod

go.sumLock updated client dependency checksums +87/-12

Lock updated client dependency checksums

• Adds/updates go.sum entries corresponding to the client module dependency updates required by Alcatraz integration.

client/go.sum

secret-config.yamlExpose ALCATRAZ_NER_MODEL_PATH to agent via Helm secret config +1/-0

Expose ALCATRAZ_NER_MODEL_PATH to agent via Helm secret config

• Adds ALCATRAZ_NER_MODEL_PATH to the agent chart’s secret-config template so deployments can provide a local model directory when needed.

deploy/helm-chart/chart/agent/templates/secret-config.yaml

go.modBump gateway module dependencies for Alcatraz integration +45/-1

Bump gateway module dependencies for Alcatraz integration

• Adds/updates dependencies including the agent module version and other indirect libraries needed for the revised provider/session wiring. Introduces testcontainers dependency (likely pulled indirectly by dependency updates).

gateway/go.mod

go.sumLock updated gateway dependency checksums +132/-4

Lock updated gateway dependency checksums

• Adds/updates go.sum entries for the gateway dependency graph changes introduced by Alcatraz/provider wiring and related module bumps.

gateway/go.sum

@qodo-code-review

qodo-code-review Bot commented Jul 20, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Unnecessary GCP creds forwarded 🐞 Bug ⛨ Security
Description
When an org is switched to the Alcatraz provider via feature flag, the session-open path still
forwards GOOGLE_APPLICATION_CREDENTIALS_JSON to the agent even though Alcatraz requires no
credentials, increasing secret exposure surface. This happens because the effective provider is now
org-scoped, but credential propagation remains unconditional.
Code

gateway/transport/client.go[R449-453]

	case pbagent.SessionOpen:
+		dlpProvider := services.DLPProviderForOrg(pctx.OrgID)
		spec := map[string][]byte{
			pb.SpecGatewaySessionID: []byte(pctx.SID),
			pb.SpecConnectionType:   pb.ToConnectionType(pctx.ConnectionType, pctx.ConnectionSubType).Bytes(),
Relevance

●●● Strong

They already strip/avoid forwarding superseded GCP creds on session-open to reduce exposure (PR
#1480).

PR-#1480

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The gateway now sets the effective provider to "alcatraz" for an org via feature flag, but still
forwards GCP credentials from app config on session open. On the agent side, those credentials are
threaded into downstream options, so sending them when Alcatraz is selected unnecessarily expands
where the secret exists in memory and configs.

gateway/services/providers.go[31-39]
gateway/transport/client.go[447-465]
gateway/transport/client.go[587-605]
agent/controller/ssh.go[209-223]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`gateway/transport/client.go` resolves the effective DLP provider per-org (`services.DLPProviderForOrg`) but still forwards GCP DLP credentials to the agent regardless of that effective provider. When the org flag selects `alcatraz`, the gateway should not send `DlpGcpRawCredentialsJSON`/`SpecAgentGCPRawCredentialsKey` because Alcatraz needs no credentials.

## Issue Context
This PR introduces per-org provider override (Alcatraz) without changing how credentials are forwarded. As a result, enabling Alcatraz for one org can still distribute GCP service-account JSON to that org’s agent sessions.

## Fix Focus Areas
- gateway/transport/client.go[447-605]
- gateway/services/providers.go[31-39]

### Concrete fix
1. In `processClientPacket` (SessionOpen):
  - Only set `spec[pb.SpecAgentGCPRawCredentialsKey]` when `dlpProvider == "gcp"`.
  - Only set `AgentConnectionParams.DlpGcpRawCredentialsJSON` when `dlpProvider == "gcp"`.
  - Similarly, only populate Presidio URLs when `dlpProvider == "mspresidio"`.
2. Add/extend a unit/integration test that asserts:
  - With `dlpProvider == "alcatraz"`, the session-open payload/spec does **not** contain GCP credential fields.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. NER flag startup race 🐞 Bug ☼ Reliability
Description
The new Alcatraz NER backend fails closed when experimental.alcatraz_ner is not yet present in
featureflagstate, but that state is only populated after a FeatureFlagUpdate packet arrives.
Because the gateway publishes the agent stream as online before sending the initial flag snapshot,
the first session(s) that require NER (PERSON/LOCATION/NRP) can be incorrectly refused immediately
after agent connect/reconnect even when the flag is enabled.
Code

agent/main.go[R53-61]

+func configureAlcatrazNer() {
+	configureAlcatrazNerOnce.Do(func() {
+		nerProvider := alcatraznlp.Provider(os.Getenv("ALCATRAZ_NER_MODEL_PATH"))
+		redactoralcatraz.SetNlpProvider(func() (redactoralcatraz.NlpBackend, error) {
+			if !featureflagstate.IsEnabled(alcatrazNerFlagName) {
+				return nil, fmt.Errorf("the NER module is disabled (enable the %s feature flag)", alcatrazNerFlagName)
+			}
+			return nerProvider()
+		})
Relevance

●●● Strong

Team fixed similar “unknown state causes false reject” races before (capability/flag handshakes) in
PR #1552.

PR-#1552
PR-#1406
PR-#1590

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
NER enablement is evaluated from an initially-empty agent-side flag map and only updated after the
FeatureFlagUpdate packet is processed. The gateway makes the agent stream discoverable (online)
before sending the initial flag seed, and sessions send via that stream without a readiness barrier,
so a first NER-using session can arrive before the seed is applied and be rejected.

agent/main.go[30-61]
agent/controller/featureflagstate/featureflagstate.go[11-39]
agent/controller/agent.go[210-219]
gateway/transport/streamclient/agent.go[109-118]
gateway/transport/agent.go[29-53]
gateway/transport/streamclient/proxy.go[165-172]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new Alcatraz NER provider is gated by `featureflagstate.IsEnabled("experimental.alcatraz_ner")`. `featureflagstate` starts empty and is only updated when the agent receives a `FeatureFlagUpdate` packet. There is a startup window where the gateway can route `SessionOpen` traffic to the agent before the initial feature-flag seed has been delivered/processed, so the first NER-using session may fail closed incorrectly.

## Issue Context
- `featureflagstate` defaults unknown flags to `false`.
- The gateway stores the agent stream in `agentStore` before sending the initial `FeatureFlagUpdate` seed.
- SessionOpen sends use the stored stream immediately.

## Fix Focus Areas
- agent/main.go[44-63]
- agent/controller/featureflagstate/featureflagstate.go[11-39]
- gateway/transport/agent.go[29-54]
- gateway/transport/streamclient/agent.go[109-126]

### Concrete fix options (pick one)
**Option A (preferred): publish-after-seed**
1. Refactor agent connection subscribe flow so the stream is not inserted into `agentStore` (and not considered online) until after the initial `FeatureFlagUpdate` seed has been successfully sent.
2. Alternatively, keep it in the store but mark it “not ready”; gate `ProxyStream.IsAgentOnline()` / `SendToAgent` on readiness.

**Option B: seed-on-session-open**
Include the feature-flag snapshot (or just `experimental.alcatraz_ner`) in `AgentConnectionParams` / SessionOpen and update `featureflagstate` before any provider checks.

Add a test/repro harness that opens a session immediately after agent connect with NER types enabled and asserts it does not fail due to missing flag seed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
✅ Compliance rules (platform): 26 rules

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

@@ -447,6 +447,7 @@ func getAISessionAnalyzerParams(pctx *plugintypes.Context) (*pb.AISessionAnalyze
func (s *Server) processClientPacket(stream *streamclient.ProxyStream, pkt *pb.Packet, pctx plugintypes.Context) error {
switch pb.PacketType(pkt.Type) {
case pbagent.SessionOpen:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Unnecessary gcp creds forwarded 🐞 Bug ⛨ Security

When an org is switched to the Alcatraz provider via feature flag, the session-open path still
forwards GOOGLE_APPLICATION_CREDENTIALS_JSON to the agent even though Alcatraz requires no
credentials, increasing secret exposure surface. This happens because the effective provider is now
org-scoped, but credential propagation remains unconditional.
Agent Prompt
## Issue description
`gateway/transport/client.go` resolves the effective DLP provider per-org (`services.DLPProviderForOrg`) but still forwards GCP DLP credentials to the agent regardless of that effective provider. When the org flag selects `alcatraz`, the gateway should not send `DlpGcpRawCredentialsJSON`/`SpecAgentGCPRawCredentialsKey` because Alcatraz needs no credentials.

## Issue Context
This PR introduces per-org provider override (Alcatraz) without changing how credentials are forwarded. As a result, enabling Alcatraz for one org can still distribute GCP service-account JSON to that org’s agent sessions.

## Fix Focus Areas
- gateway/transport/client.go[447-605]
- gateway/services/providers.go[31-39]

### Concrete fix
1. In `processClientPacket` (SessionOpen):
   - Only set `spec[pb.SpecAgentGCPRawCredentialsKey]` when `dlpProvider == "gcp"`.
   - Only set `AgentConnectionParams.DlpGcpRawCredentialsJSON` when `dlpProvider == "gcp"`.
   - Similarly, only populate Presidio URLs when `dlpProvider == "mspresidio"`.
2. Add/extend a unit/integration test that asserts:
   - With `dlpProvider == "alcatraz"`, the session-open payload/spec does **not** contain GCP credential fields.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread agent/main.go
// the flag off, such sessions fail closed. ALCATRAZ_NER_MODEL_PATH points at
// a local model directory for air-gapped agents; when unset the default
// model is downloaded on first use.
func configureAlcatrazNer() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

2. Ner flag startup race 🐞 Bug ☼ Reliability

The new Alcatraz NER backend fails closed when experimental.alcatraz_ner is not yet present in
featureflagstate, but that state is only populated after a FeatureFlagUpdate packet arrives.
Because the gateway publishes the agent stream as online before sending the initial flag snapshot,
the first session(s) that require NER (PERSON/LOCATION/NRP) can be incorrectly refused immediately
after agent connect/reconnect even when the flag is enabled.
Agent Prompt
## Issue description
The new Alcatraz NER provider is gated by `featureflagstate.IsEnabled("experimental.alcatraz_ner")`. `featureflagstate` starts empty and is only updated when the agent receives a `FeatureFlagUpdate` packet. There is a startup window where the gateway can route `SessionOpen` traffic to the agent before the initial feature-flag seed has been delivered/processed, so the first NER-using session may fail closed incorrectly.

## Issue Context
- `featureflagstate` defaults unknown flags to `false`.
- The gateway stores the agent stream in `agentStore` before sending the initial `FeatureFlagUpdate` seed.
- SessionOpen sends use the stored stream immediately.

## Fix Focus Areas
- agent/main.go[44-63]
- agent/controller/featureflagstate/featureflagstate.go[11-39]
- gateway/transport/agent.go[29-54]
- gateway/transport/streamclient/agent.go[109-126]

### Concrete fix options (pick one)
**Option A (preferred): publish-after-seed**
1. Refactor agent connection subscribe flow so the stream is not inserted into `agentStore` (and not considered online) until after the initial `FeatureFlagUpdate` seed has been successfully sent.
2. Alternatively, keep it in the store but mark it “not ready”; gate `ProxyStream.IsAgentOnline()` / `SendToAgent` on readiness.

**Option B: seed-on-session-open**
Include the feature-flag snapshot (or just `experimental.alcatraz_ner`) in `AgentConnectionParams` / SessionOpen and update `featureflagstate` before any provider checks.

Add a test/repro harness that opens a session immediately after agent connect with NER types enabled and asserts it does not fail due to missing flag seed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@racerxdl racerxdl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the default model is set to empty. Does that spawn a default internal model or just doesnt load anything?

Just thinking that maybe we should ship a default model with alcatraz.

/serverinfo reported the raw DLP_PROVIDER env while the rest of the
backend already resolves the provider per organization
(services.DLPProviderForOrg, used by the transport and every
data-masking handler). An org running alcatraz — whether by env or by
the experimental.alcatraz_dlp flag — was therefore told it had no
usable provider, and the Live Data Masking page blocked the configure
path with a Google Cloud DLP deprecation notice that did not apply.

has_redact_credentials had the same problem: it was computed once at
startup from env only, so a flag-enabled org saw false while masking
was active. It now reuses services.CheckRedactProviderForOrg.

serverInfoData was a package-level struct that Get mutated per request,
so org-scoped fields (feature flags, and now the provider) could leak
between concurrent requests from different orgs. Get now mutates a
local copy; the package-level value keeps only env-derived fields.

On the UI, the promotion page treats alcatraz like mspresidio (both
drive masking from data-masking rules) and shows the GCP deprecation
text only when the provider really is gcp — an unset provider gets the
docs link with no misleading message.
Conflicts were confined to dependency bookkeeping and generated output:

- agent/client/gateway go.mod + go.sum: main had bumped alcatraz to
  v0.7.0 while this branch is on v0.14.1. Resolved by taking main's
  files wholesale (they carry the 16 commits' new requirements) and
  recomputing each module with go mod tidy, rather than hand-merging
  the requirement lists.

- gateway/api/openapi/openapiv3.json: minified single-line JSON, not
  mergeable by hand. Regenerated with swag + openapi-gen; the
  redact_provider enum keeps gcp/mspresidio/alcatraz.

go.work moves to go 1.26.5. This is not toolchain drift: alcatraz/ner
v0.14.1 declares go 1.26.5, so libhoop (which imports it) and every
module above it must match. CI asks for go-version >=1.26.0 and so
needs no change.

The MCP gateway from main (#1661) imports libhoop/agent/mcpadapter,
which landed on libhoop after this branch was cut; libhoop's
add-alcatraz-agent branch was merged with its own main to match.
Comment thread agent/main.go
Comment on lines +57 to +58
if !featureflagstate.IsEnabled(alcatrazNerFlagName) {
return nil, fmt.Errorf("the NER module is disabled (enable the %s feature flag)", alcatrazNerFlagName)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't make sense to add feature flag if you have other things to enable the feature (e.g.: env ALCATRAZ_NER_MODEL_PATH, DLP_PROVIDER). This just adds unecessary friction to users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Bumps the minor version on release (new features)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants