Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor(mcp)!: retire the ignore-masking-exemptions policy field (#21527)
Vincent Huang108027736458
diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yamlindex fcc6787cbe..8fc9a1375d 100644--- a/backend/api/mcp/gen/openapi.yaml+++ b/backend/api/mcp/gen/openapi.yaml@@ -16856,20 +16856,6 @@ components:on the internal MCP chain decides, per request, which method classes areserved, and under READ_ONLY the SQL clamp decides, per statement, whetherit only reads.- ignoreMaskingExemptions:- type: boolean- title: ignore_masking_exemptions- description: |-- Whether a request that arrived over MCP stops applying the caller's own- unmasking provisioning. Two mechanisms let a user see a real value and this- suppresses both: the masking exemptions granted to them, and the unmask- carried by an access grant. The same user in the console is untouched.-- It cannot force masking where there is none. Masking substitutes values in- query results, so this does not reach data copied into a column carrying no- masking policy, and it does nothing on the engines Bytebase does not mask.- It narrows what an agent reads through the paths Bytebase masks; it is not- a confidentiality boundary.title: MCPSettingadditionalProperties: falsedescription: |-@@ -16885,8 +16871,8 @@ components:- READ_WRITEdescription: |-Capability is the ceiling: a session runs at this level or lower.- Writing CAPABILITY_UNSPECIFIED explicitly is rejected; omit the update mask- path to leave the current ceiling unchanged.+ Writing CAPABILITY_UNSPECIFIED, explicitly or by leaving+ value.mcp.capability out of the update mask, is rejected.bytebase.v1.MaskingExemptionPolicy:type: objectproperties:diff --git a/backend/api/v1/actuator_service_test.go b/backend/api/v1/actuator_service_test.goindex 6989954c51..fee9f94fbe 100644--- a/backend/api/v1/actuator_service_test.go+++ b/backend/api/v1/actuator_service_test.go@@ -21,11 +21,10 @@ func (r mcpSettingRead) GetMCPSettingsUncached(context.Context, string) (*storepreturn r.setting, r.err}-// TestActuatorMCPSetting pins the three decisions in what actuator info-// discloses about the MCP policy: the masking toggle travels with the ceiling,-// an unreadable row leaves the setting absent instead of failing the shared-// bootstrap response, and the resolution the gate already made for this-// request wins over a second read.+// TestActuatorMCPSetting pins the two decisions in what actuator info+// discloses about the MCP policy: an unreadable row leaves the setting absent+// instead of failing the shared bootstrap response, and the resolution the gate+// already made for this request wins over a second read.func TestActuatorMCPSetting(t *testing.T) {ctx := context.Background()for _, tc := range []struct {@@ -35,12 +34,10 @@ func TestActuatorMCPSetting(t *testing.T) {want *v1pb.MCPSetting}{{- // Every masking state is written in terms of this, so withholding it- // leaves the table unusable.- name: "the toggle reaches the response",- read: mcpSettingRead{setting: &storepb.MCPSetting{Capability: storepb.MCPSetting_READ_ONLY, IgnoreMaskingExemptions: true}},+ name: "the stored ceiling reaches the response",+ read: mcpSettingRead{setting: &storepb.MCPSetting{Capability: storepb.MCPSetting_READ_ONLY}},ctx: ctx,- want: &v1pb.MCPSetting{Capability: v1pb.MCPSetting_READ_ONLY, IgnoreMaskingExemptions: true},+ want: &v1pb.MCPSetting{Capability: v1pb.MCPSetting_READ_ONLY},},{// Actuator info is a shared bootstrap response, so it remains@@ -57,8 +54,8 @@ func TestActuatorMCPSetting(t *testing.T) {// the request was not admitted under.name: "the gate's resolution wins over a second read",read: mcpSettingRead{setting: &storepb.MCPSetting{Capability: storepb.MCPSetting_DISABLED}},- ctx: withMCPSettings(ctx, &storepb.MCPSetting{Capability: storepb.MCPSetting_READ_ONLY, IgnoreMaskingExemptions: true}),- want: &v1pb.MCPSetting{Capability: v1pb.MCPSetting_READ_ONLY, IgnoreMaskingExemptions: true},+ ctx: withMCPSettings(ctx, &storepb.MCPSetting{Capability: storepb.MCPSetting_READ_ONLY}),+ want: &v1pb.MCPSetting{Capability: v1pb.MCPSetting_READ_ONLY},},} {t.Run(tc.name, func(t *testing.T) {@@ -68,7 +65,6 @@ func TestActuatorMCPSetting(t *testing.T) {return}require.Equal(t, tc.want.Capability, got.GetCapability())- require.Equal(t, tc.want.IgnoreMaskingExemptions, got.GetIgnoreMaskingExemptions())})}}diff --git a/backend/api/v1/mcp_gate.go b/backend/api/v1/mcp_gate.goindex f7999dc107..b20be7337a 100644--- a/backend/api/v1/mcp_gate.go+++ b/backend/api/v1/mcp_gate.go@@ -308,9 +308,8 @@ func mcpSettingsForCurrentWorkspace(ctx context.Context, reader mcpSettingsReade// refuses regardless of what RBAC would have said, and the refusal is streamed.//// The ceiling is read live, per request, with no caching anywhere in the path-// (store.GetMCPSettingsUncached, which resolves the masking toggle off the same-// row). An admin tightening the ceiling binds the next request of a session-// already open; work already admitted finishes.+// (store.GetMCPSettingsUncached). An admin tightening the ceiling binds the next+// request of a session already open; work already admitted finishes.//// A policy denial is marked (setPermissionDenied), so the audit// interceptor streams it whatever the method's audit annotation says. That isdiff --git a/backend/api/v1/mcp_gate_test.go b/backend/api/v1/mcp_gate_test.goindex 88efe3d828..017e17a240 100644--- a/backend/api/v1/mcp_gate_test.go+++ b/backend/api/v1/mcp_gate_test.go@@ -804,16 +804,15 @@ func TestMCPClassificationInventory(t *testing.T) {// exercised without a database. The end-to-end path exists too, in// backend/tests, now that a READ_ONLY ceiling admits a connection.type mcpGateStore struct {- ceiling storepb.MCPSetting_Capability- ignoreMaskingExemptions bool- err error+ ceiling storepb.MCPSetting_Capability+ err error}func (s mcpGateStore) GetMCPSettingsUncached(context.Context, string) (*storepb.MCPSetting, error) {if s.err != nil {return nil, s.err}- return &storepb.MCPSetting{Capability: s.ceiling, IgnoreMaskingExemptions: s.ignoreMaskingExemptions}, nil+ return &storepb.MCPSetting{Capability: s.ceiling}, nil}func readWriteCeiling() mcpGateStore {diff --git a/backend/api/v1/mcp_masking.go b/backend/api/v1/mcp_masking.goindex 20735f61be..1b070beadc 100644--- a/backend/api/v1/mcp_masking.go+++ b/backend/api/v1/mcp_masking.go@@ -20,31 +20,13 @@ func mcpSession(ctx context.Context) bool {return ok && authCtx.DelegatedGrant != nil}-// mcpIgnoresMaskingExemptions reports whether this request stops applying the-// caller's own unmasking provisioning.-//-// No stamped settings means the gate never ran. Ignoring the exemptions is the-// safe default there, which is why this answers true where-// mcpReadOnlyClampApplies errors: guessing a ceiling has no safe default.-func mcpIgnoresMaskingExemptions(ctx context.Context) bool {- if !mcpSession(ctx) {- return false- }- settings, ok := mcpSettingsFromContext(ctx)- if !ok {- return true- }- return settings.IgnoreMaskingExemptions-}-// maskedWriteRefusal is the reason to refuse SQL carrying a mask sentinel, or// "" to allow: the agent writes back the placeholder it read, and the real data// is gone with nothing in the change looking wrong.//-// It applies to every MCP session, not only where the workspace ignores masking-// exemptions. Masking runs under ordinary policy for any user who holds no-// exemption, so the corruption is reachable in a workspace that never touched-// the toggle — which is most of them.+// It applies to every MCP session: masking runs under ordinary policy for any+// user who holds no exemption, so the corruption is reachable in any workspace+// that masks a column.//// Only masker.DefaultFullMaskSubstitution is fixed in code: a full mask emits// it for any value when no substitution is configured, and the range,diff --git a/backend/api/v1/mcp_masking_test.go b/backend/api/v1/mcp_masking_test.goindex 1e4844e38e..430e75f08c 100644--- a/backend/api/v1/mcp_masking_test.go+++ b/backend/api/v1/mcp_masking_test.go@@ -15,93 +15,18 @@ import ("github.com/bytebase/bytebase/backend/store")-func maskingSettings(ignore bool) *storepb.MCPSetting {- return &storepb.MCPSetting{- Capability: storepb.MCPSetting_READ_WRITE,- IgnoreMaskingExemptions: ignore,- }-}--// TestMCPIgnoresExemptionsKeysOnTheGrantAndTheToggle walks every request state-// the forcing can meet. The console is the one that has to stay untouched: the-// toggle is about what an agent may read, and the same user reading the same-// column signed in to Bytebase is not an agent.-func TestMCPIgnoresExemptionsKeysOnTheGrantAndTheToggle(t *testing.T) {- withGrant := &common.AuthContext{DelegatedGrant: &common.DelegatedGrant{}}-- for _, row := range []struct {- name string- ctx context.Context- ignores bool- }{- {- name: "a human request carries no auth context here",- ctx: context.Background(),- },- {- name: "a console request carries no delegated grant, whatever the toggle says",- ctx: withMCPSettings(contextWithAuth(&common.AuthContext{}), maskingSettings(true)),- },- {- name: "an MCP session with the toggle off follows the caller's provisioning",- ctx: withMCPSettings(contextWithAuth(withGrant), maskingSettings(false)),- },- {- name: "an MCP session with the toggle on ignores them",- ctx: withMCPSettings(contextWithAuth(withGrant), maskingSettings(true)),- ignores: true,- },- {- name: "an MCP session the gate never held is forced, because masking " +- "has a safe default where the ceiling has none",- ctx: contextWithAuth(withGrant),- ignores: true,- },- } {- t.Run(row.name, func(t *testing.T) {- require.Equal(t, row.ignores, mcpIgnoresMaskingExemptions(row.ctx))- })- }-}--// TestMCPMaskingReadsTheSettingsTheGateResolved is the freshness invariant. The-// gate reads the MCP setting straight from the database on every request-// — the setting cache has no TTL — and stamps what it read. So an admin-// flipping the toggle binds the next request of a session already open, with no-// restart and no reconnect, and the masking path is held against the same-// resolution the gate admitted the call under.-func TestMCPMaskingReadsTheSettingsTheGateResolved(t *testing.T) {- for _, row := range []struct {- name string- stores mcpGateStore- }{- {name: "toggle off", stores: mcpGateStore{ceiling: storepb.MCPSetting_READ_WRITE}},- {name: "toggle on", stores: mcpGateStore{ceiling: storepb.MCPSetting_READ_WRITE, ignoreMaskingExemptions: true}},- } {- t.Run(row.name, func(t *testing.T) {- got := invokeMCPGate(t, row.stores, &common.AuthContext{- MCPMethodClass: v1pb.MCPMethodClass_READ,- DelegatedGrant: &common.DelegatedGrant{},- }, "/bytebase.v1.SQLService/Query", connect.NewRequest(&v1pb.QueryRequest{}))-- require.NoError(t, got.err)- require.True(t, got.dispatched)-- settings, ok := mcpSettingsFromContext(got.dispatchedCtx)- require.True(t, ok, "the gate must hand the handler the settings it resolved")- require.Equal(t, row.stores.ignoreMaskingExemptions, settings.IgnoreMaskingExemptions)- require.Equal(t, row.stores.ignoreMaskingExemptions, mcpIgnoresMaskingExemptions(got.dispatchedCtx))- })- }+// mcpSessionContext is a request as the gate hands it to a handler: a+// delegated grant, and the settings the gate resolved.+func mcpSessionContext() context.Context {+ return withMCPSettings(+ contextWithAuth(&common.AuthContext{DelegatedGrant: &common.DelegatedGrant{}}),+ &storepb.MCPSetting{Capability: storepb.MCPSetting_READ_WRITE})}// TestMaskedWriteGuardRefusesTheSentinel covers every door an MCP session can// put raw SQL through — the three that reach the change pipeline, the two that// execute directly, and the two that park a statement for a person to run — and-// pins that each refuses on MCP origin alone. The-// toggle-off arm is the one that matters: masking runs under ordinary policy-// for a user holding no exemption, so a workspace that never touched the toggle-// is exactly where this corruption is reachable.+// pins that each refuses on MCP origin alone.func TestMaskedWriteGuardRefusesTheSentinel(t *testing.T) {const clean = "UPDATE employee SET name = 'Bytebase' WHERE id = 1"masked := "UPDATE employee SET name = '" + masker.DefaultFullMaskSubstitution + "' WHERE id = 1"@@ -148,24 +73,16 @@ func TestMaskedWriteGuardRefusesTheSentinel(t *testing.T) {{name: "UpdateSavedQuery", refuse: refuseMaskedWriteSavedQueryUpdate, request: savedQueryUpdateRequest},} {t.Run(door.name, func(t *testing.T) {- ignoring := withMCPSettings(- contextWithAuth(&common.AuthContext{DelegatedGrant: &common.DelegatedGrant{}}),- maskingSettings(true))+ session := mcpSessionContext()- reason := door.refuse(ignoring, door.request(masked))+ reason := door.refuse(session, door.request(masked))require.NotEmpty(t, reason, "writing the mask back replaces the real value with it")require.Contains(t, reason, masker.DefaultFullMaskSubstitution,"the message has to name the literal, or the agent cannot tell what to remove")- require.Empty(t, door.refuse(ignoring, door.request(clean)),+ require.Empty(t, door.refuse(session, door.request(clean)),"an ordinary change is served")- off := withMCPSettings(- contextWithAuth(&common.AuthContext{DelegatedGrant: &common.DelegatedGrant{}}),- maskingSettings(false))- require.NotEmpty(t, door.refuse(off, door.request(masked)),- "the guard is not the toggle's: masked reads happen without it")-unstamped := contextWithAuth(&common.AuthContext{DelegatedGrant: &common.DelegatedGrant{}})require.NotEmpty(t, door.refuse(unstamped, door.request(masked)),"and it does not depend on the gate having stamped anything")@@ -184,16 +101,14 @@ func TestMaskedWriteGuardRefusesTheSentinel(t *testing.T) {// meets a bug refuses.func TestMaskedWriteGuardFailsClosedOnAWiringBug(t *testing.T) {t.Parallel()- forced := withMCPSettings(- contextWithAuth(&common.AuthContext{DelegatedGrant: &common.DelegatedGrant{}}),- maskingSettings(true))+ session := mcpSessionContext()for _, refuse := range []func(context.Context, any) string{refuseMaskedWriteSheet, refuseMaskedWriteSheetBatch, refuseMaskedWriteRelease,refuseMaskedWriteQuery, refuseMaskedWriteExport,refuseMaskedWriteSavedQuery, refuseMaskedWriteSavedQueryUpdate,} {- require.NotEmpty(t, refuse(forced, &v1pb.GetUserRequest{}))+ require.NotEmpty(t, refuse(session, &v1pb.GetUserRequest{}))}}@@ -235,7 +150,7 @@ func TestMaskedWriteGuardIsWiredIntoTheGate(t *testing.T) {for _, door := range doors {t.Run(door.procedure, func(t *testing.T) {got := invokeMCPGate(t,- mcpGateStore{ceiling: storepb.MCPSetting_READ_WRITE, ignoreMaskingExemptions: true},+ readWriteCeiling(),&common.AuthContext{MCPMethodClass: v1pb.MCPMethodClass_WRITE,DelegatedGrant: &common.DelegatedGrant{},@@ -264,7 +179,7 @@ func TestMaskedWriteGuardCoversTheExecutionDoor(t *testing.T) {masked := "UPDATE employee SET secret = '" + masker.DefaultFullMaskSubstitution + "' WHERE id = 1"got := invokeMCPGate(t,- mcpGateStore{ceiling: storepb.MCPSetting_READ_WRITE, ignoreMaskingExemptions: true},+ readWriteCeiling(),&common.AuthContext{MCPMethodClass: v1pb.MCPMethodClass_READ,DelegatedGrant: &common.DelegatedGrant{},@@ -279,7 +194,7 @@ func TestMaskedWriteGuardCoversTheExecutionDoor(t *testing.T) {require.True(t, got.auditMarked)exported := invokeMCPGate(t,- mcpGateStore{ceiling: storepb.MCPSetting_READ_WRITE, ignoreMaskingExemptions: true},+ readWriteCeiling(),&common.AuthContext{MCPMethodClass: v1pb.MCPMethodClass_WRITE,DelegatedGrant: &common.DelegatedGrant{},@@ -302,7 +217,7 @@ func TestMaskedWriteGuardCoversTheExecutionDoor(t *testing.T) {// is the newest producer and the one whose refusal names a literal rather than a// policy.func TestMCPRefusalsNameThemselvesToTheQueryTool(t *testing.T) {- forced := mcpGateStore{ceiling: storepb.MCPSetting_READ_WRITE, ignoreMaskingExemptions: true}+ readWrite := readWriteCeiling()maskedWrite := "UPDATE employee SET secret = '" + masker.DefaultFullMaskSubstitution + "'"for _, row := range []struct {@@ -313,7 +228,7 @@ func TestMCPRefusalsNameThemselvesToTheQueryTool(t *testing.T) {}{{name: "the masked-write guard",- stores: forced,+ stores: readWrite,class: v1pb.MCPMethodClass_READ,request: connect.NewRequest(&v1pb.QueryRequest{Statement: maskedWrite}),},@@ -325,7 +240,7 @@ func TestMCPRefusalsNameThemselvesToTheQueryTool(t *testing.T) {},{name: "an unclassified method",- stores: forced,+ stores: readWrite,class: v1pb.MCPMethodClass_MCP_METHOD_CLASS_UNSPECIFIED,request: connect.NewRequest(&v1pb.QueryRequest{}),},diff --git a/backend/api/v1/query_result_masker.go b/backend/api/v1/query_result_masker.goindex a9f841c833..d0e3281df4 100644--- a/backend/api/v1/query_result_masker.go+++ b/backend/api/v1/query_result_masker.go@@ -444,14 +444,9 @@ func (s *QueryResultMasker) getMaskersForQuerySpan(ctx context.Context, m *maski// exemptionsForPrincipal is the one seam the caller's own masking provisioning// enters through: getMaskerForColumnResource and the MSSQL// getSensitiveColumnsForPredicate both reach evaluateSemanticTypeOfColumn with-// exactly this slice. An MCP session that ignores exemptions gets an empty one,-// which is what a user granted nothing already looks like. Filtering only the-// output path would mask the value and still answer whether a WHERE on it-// matched.+// exactly this slice. Filtering only the output path would mask the value and+// still answer whether a WHERE on it matched.func (s *QueryResultMasker) exemptionsForPrincipal(ctx context.Context, data *maskingDataProvider, projectID string, currentPrincipal *store.UserMessage) []*storepb.MaskingExemptionPolicy_Exemption {- if mcpIgnoresMaskingExemptions(ctx) {- return nil- }policy := data.getMaskingExemptionPolicy(projectID)if policy == nil {return nildiff --git a/backend/api/v1/setting_service.go b/backend/api/v1/setting_service.goindex 6916d5f989..6e8e58fd1d 100644--- a/backend/api/v1/setting_service.go+++ b/backend/api/v1/setting_service.go@@ -198,21 +198,14 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *connect.Reqreturn nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("mcp setting is required"))}- mcpSetting := &storepb.MCPSetting{Capability: storepb.MCPSetting_READ_WRITE}- if existedSetting != nil {- existing, ok := existedSetting.Value.(*storepb.MCPSetting)- if !ok {- return nil, connect.NewError(connect.CodeInternal, errors.Errorf("invalid setting value type for %s", storepb.SettingName_MCP))- }- mcpSetting = proto.CloneOf(existing)- }-+ // Built from the request alone because capability is the only field. A+ // second field needs a merge onto the stored row, or saving one erases+ // the other.+ mcpSetting := &storepb.MCPSetting{}for _, path := range request.Msg.UpdateMask.Paths {switch path {case "value.mcp.capability":mcpSetting.Capability = convertToStoreMCPCapability(payload.Capability)- case "value.mcp.ignore_masking_exemptions":- mcpSetting.IgnoreMaskingExemptions = payload.IgnoreMaskingExemptionsdefault:return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid update mask path %q", path))}diff --git a/backend/api/v1/setting_service_converter.go b/backend/api/v1/setting_service_converter.goindex 9e614e04b8..572184c9fd 100644--- a/backend/api/v1/setting_service_converter.go+++ b/backend/api/v1/setting_service_converter.go@@ -395,8 +395,7 @@ func convertToMCPSetting(s *storepb.MCPSetting) *v1pb.MCPSetting {return nil}return &v1pb.MCPSetting{- Capability: convertToV1MCPCapability(s.Capability),- IgnoreMaskingExemptions: s.IgnoreMaskingExemptions,+ Capability: convertToV1MCPCapability(s.Capability),}}diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.goindex 962daaeca8..727f79d939 100644--- a/backend/api/v1/sql_service.go+++ b/backend/api/v1/sql_service.go@@ -405,10 +405,7 @@ func (s *SQLService) Query(ctx context.Context, req *connect.Request[v1pb.QueryROption: request.QueryOption,Container: request.GetContainer(),MaximumSQLResultSize: queryRestriction.MaximumResultSize,- // SkipMasking turns the whole masking pass off (queryRetry's- // maskingEnabled), so exemptionsForPrincipal never runs when it is set.- // The toggle has to suppress it here as well as there.- SkipMasking: accessGrant != nil && accessGrant.Payload.Unmask && !mcpIgnoresMaskingExemptions(ctx),+ SkipMasking: accessGrant != nil && accessGrant.Payload.Unmask,}if request.Schema != nil {queryContext.Schema = *request.Schema@@ -1207,11 +1204,9 @@ func (s *SQLService) Export(ctx context.Context, req *connect.Request[v1pb.Expor// its target databases, so span-level ACL still runs and only the// granted targets are exempted from IAM. See PR #20487 review.optionalAccessCheck := s.accessCheckWithGrant(accessGrant)- // Export is a WRITE method, so a read-write MCP session reaches it with the- // same access-grant unmask Query carries.skipMasking := falseif accessGrant != nil {- skipMasking = accessGrant.Payload.Unmask && !mcpIgnoresMaskingExemptions(ctx)+ skipMasking = accessGrant.Payload.Unmask}bytes, duration, exportErr := doExport(ctx, s.store, s.dbFactory, s.licenseService, request, user, instance, database, optionalAccessCheck, s.schemaSyncer, dataSource, skipMasking)diff --git a/backend/generated-go/store/setting.pb.go b/backend/generated-go/store/setting.pb.goindex 2dee560f3c..685dd5dd24 100644--- a/backend/generated-go/store/setting.pb.go+++ b/backend/generated-go/store/setting.pb.go@@ -841,20 +841,9 @@ type MCPSetting struct {// on the internal MCP chain decides, per request, which method classes are// served, and under READ_ONLY the SQL clamp decides, per statement, whether// it only reads.- Capability MCPSetting_Capability `protobuf:"varint,1,opt,name=capability,proto3,enum=bytebase.store.MCPSetting_Capability" json:"capability,omitempty"`- // Whether a request that arrived over MCP stops applying the caller's own- // unmasking provisioning. Two mechanisms let a user see a real value and this- // suppresses both: the masking exemptions granted to them, and the unmask- // carried by an access grant. The same user in the console is untouched.- //- // It cannot force masking where there is none. Masking substitutes values in- // query results, so this does not reach data copied into a column carrying no- // masking policy, and it does nothing on the engines Bytebase does not mask.- // It narrows what an agent reads through the paths Bytebase masks; it is not- // a confidentiality boundary.- IgnoreMaskingExemptions bool `protobuf:"varint,2,opt,name=ignore_masking_exemptions,json=ignoreMaskingExemptions,proto3" json:"ignore_masking_exemptions,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache+ Capability MCPSetting_Capability `protobuf:"varint,1,opt,name=capability,proto3,enum=bytebase.store.MCPSetting_Capability" json:"capability,omitempty"`+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache}func (x *MCPSetting) Reset() {@@ -894,13 +883,6 @@ func (x *MCPSetting) GetCapability() MCPSetting_Capability {return MCPSetting_CAPABILITY_UNSPECIFIED}-func (x *MCPSetting) GetIgnoreMaskingExemptions() bool {- if x != nil {- return x.IgnoreMaskingExemptions- }- return false-}-type SQLEditorThemeSetting struct {state protoimpl.MessageState `protogen:"open.v1"`Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`@@ -2997,13 +2979,12 @@ const file_store_setting_proto_rawDesc = "" +" DATABASE_CHANGE_MODE_UNSPECIFIED\x10\x00\x12\f\n" +"\bPIPELINE\x10\x01\x12\n" +"\n" +- "\x06EDITOR\x10\x02J\x04\b\x0f\x10\x10J\x04\b\x1a\x10\x1bJ\x04\b\x10\x10\x11R\x0emcp_capability\"\xec\x01\n" ++ "\x06EDITOR\x10\x02J\x04\b\x0f\x10\x10J\x04\b\x1a\x10\x1bJ\x04\b\x10\x10\x11R\x0emcp_capability\"\xb0\x01\n" +"\n" +"MCPSetting\x12E\n" +"\n" +"capability\x18\x01 \x01(\x0e2%.bytebase.store.MCPSetting.CapabilityR\n" +- "capability\x12:\n" +- "\x19ignore_masking_exemptions\x18\x02 \x01(\bR\x17ignoreMaskingExemptions\"[\n" ++ "capability\"[\n" +"\n" +"Capability\x12\x1a\n" +"\x16CAPABILITY_UNSPECIFIED\x10\x00\x12\f\n" +diff --git a/backend/generated-go/store/setting_equal.pb.go b/backend/generated-go/store/setting_equal.pb.goindex 3dfbcdce12..c21664d13a 100644--- a/backend/generated-go/store/setting_equal.pb.go+++ b/backend/generated-go/store/setting_equal.pb.go@@ -189,9 +189,6 @@ func (x *MCPSetting) Equal(y *MCPSetting) bool {if x.Capability != y.Capability {return false}- if x.IgnoreMaskingExemptions != y.IgnoreMaskingExemptions {- return false- }return true}diff --git a/backend/generated-go/v1/setting_service.pb.go b/backend/generated-go/v1/setting_service.pb.goindex a53f87c2ee..f90666acb2 100644--- a/backend/generated-go/v1/setting_service.pb.go+++ b/backend/generated-go/v1/setting_service.pb.go@@ -149,8 +149,8 @@ func (Setting_SettingName) EnumDescriptor() ([]byte, []int) {}// Capability is the ceiling: a session runs at this level or lower.-// Writing CAPABILITY_UNSPECIFIED explicitly is rejected; omit the update mask-// path to leave the current ceiling unchanged.+// Writing CAPABILITY_UNSPECIFIED, explicitly or by leaving+// value.mcp.capability out of the update mask, is rejected.type MCPSetting_Capability int32const (@@ -1333,20 +1333,9 @@ type MCPSetting struct {// on the internal MCP chain decides, per request, which method classes are// served, and under READ_ONLY the SQL clamp decides, per statement, whether// it only reads.- Capability MCPSetting_Capability `protobuf:"varint,1,opt,name=capability,proto3,enum=bytebase.v1.MCPSetting_Capability" json:"capability,omitempty"`- // Whether a request that arrived over MCP stops applying the caller's own- // unmasking provisioning. Two mechanisms let a user see a real value and this- // suppresses both: the masking exemptions granted to them, and the unmask- // carried by an access grant. The same user in the console is untouched.- //- // It cannot force masking where there is none. Masking substitutes values in- // query results, so this does not reach data copied into a column carrying no- // masking policy, and it does nothing on the engines Bytebase does not mask.- // It narrows what an agent reads through the paths Bytebase masks; it is not- // a confidentiality boundary.- IgnoreMaskingExemptions bool `protobuf:"varint,2,opt,name=ignore_masking_exemptions,json=ignoreMaskingExemptions,proto3" json:"ignore_masking_exemptions,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache+ Capability MCPSetting_Capability `protobuf:"varint,1,opt,name=capability,proto3,enum=bytebase.v1.MCPSetting_Capability" json:"capability,omitempty"`+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache}func (x *MCPSetting) Reset() {@@ -1386,13 +1375,6 @@ func (x *MCPSetting) GetCapability() MCPSetting_Capability {return MCPSetting_CAPABILITY_UNSPECIFIED}-func (x *MCPSetting) GetIgnoreMaskingExemptions() bool {- if x != nil {- return x.IgnoreMaskingExemptions- }- return false-}-type SQLEditorThemeSetting struct {state protoimpl.MessageState `protogen:"open.v1"`Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`@@ -3645,13 +3627,12 @@ const file_v1_setting_service_proto_rawDesc = "" +"\x18require_uppercase_letter\x18\x04 \x01(\bR\x16requireUppercaseLetter\x12:\n" +"\x19require_special_character\x18\x05 \x01(\bR\x17requireSpecialCharacter\x12Q\n" +"&require_reset_password_for_first_login\x18\x06 \x01(\bR!requireResetPasswordForFirstLogin\x12F\n" +- "\x11password_rotation\x18\a \x01(\v2\x19.google.protobuf.DurationR\x10passwordRotationJ\x04\b\x0f\x10\x10J\x04\b\x1a\x10\x1bJ\x04\b\x10\x10\x11R\x0emcp_capability\"\xe9\x01\n" ++ "\x11password_rotation\x18\a \x01(\v2\x19.google.protobuf.DurationR\x10passwordRotationJ\x04\b\x0f\x10\x10J\x04\b\x1a\x10\x1bJ\x04\b\x10\x10\x11R\x0emcp_capability\"\xad\x01\n" +"\n" +"MCPSetting\x12B\n" +"\n" +"capability\x18\x01 \x01(\x0e2\".bytebase.v1.MCPSetting.CapabilityR\n" +- "capability\x12:\n" +- "\x19ignore_masking_exemptions\x18\x02 \x01(\bR\x17ignoreMaskingExemptions\"[\n" ++ "capability\"[\n" +"\n" +"Capability\x12\x1a\n" +"\x16CAPABILITY_UNSPECIFIED\x10\x00\x12\f\n" +diff --git a/backend/generated-go/v1/setting_service_equal.pb.go b/backend/generated-go/v1/setting_service_equal.pb.goindex d87de87740..885e1780f6 100644--- a/backend/generated-go/v1/setting_service_equal.pb.go+++ b/backend/generated-go/v1/setting_service_equal.pb.go@@ -422,9 +422,6 @@ func (x *MCPSetting) Equal(y *MCPSetting) bool {if x.Capability != y.Capability {return false}- if x.IgnoreMaskingExemptions != y.IgnoreMaskingExemptions {- return false- }return true}diff --git a/backend/store/setting.go b/backend/store/setting.goindex dc4794b468..a423806dca 100644--- a/backend/store/setting.go+++ b/backend/store/setting.go@@ -577,8 +577,6 @@ func (s *Store) DeleteSetting(ctx context.Context, workspace string, name storep// in-process writes refresh it, so a setting flipped out of band — direct SQL,// another replica — must still bite on the next request.//-// Both fields come off one row, so the gate cannot admit a call that a later-// enforcement point then judges under a different row.// Returns nil with any error; no caller may act on partially resolved settings.//// Existing workspaces without an MCP row retain the previous READ_WRITEdiff --git a/backend/tests/mcp_capability_setting_test.go b/backend/tests/mcp_capability_setting_test.goindex b03acfc3e5..c708688719 100644--- a/backend/tests/mcp_capability_setting_test.go+++ b/backend/tests/mcp_capability_setting_test.go@@ -3,6 +3,7 @@ package testsimport ("context""database/sql"+ "net/http""strings""testing"@@ -161,53 +162,6 @@ func TestMCPSettingExistsWithTheWorkspace(t *testing.T) {a.Equal(v1pb.MCPSetting_READ_ONLY, stored)}-// TestMCPUnrecognizedCeilingSurvivesAToggleOnlyUpdate is the write-path half of-// the fail-closed rule. The unmarshaler resolves an unknown enum name to-// UNSPECIFIED, and marshalling would omit that zero enum. The partial update-// therefore requires the request to set a recognized capability rather than-// silently erasing the stored value.-func TestMCPUnrecognizedCeilingSurvivesAToggleOnlyUpdate(t *testing.T) {- t.Parallel()- a := require.New(t)- ctx := context.Background()- ctl, ctx := startWorkspace(ctx, t)-- workspaceID := currentWorkspaceID(ctx, t, ctl)- db, err := sql.Open("pgx", ctl.profile.PgURL)- a.NoError(err)- defer db.Close()- result, err := db.ExecContext(ctx, `- UPDATE setting SET value = jsonb_set(value, '{capability}', '"READ_ONLYY"')- WHERE workspace = $1 AND name = 'MCP';- `, workspaceID)- a.NoError(err)- affected, err := result.RowsAffected()- a.NoError(err)- a.Equal(int64(1), affected, "the MCP setting row must exist for this test to mean anything")-- err = ctl.setIgnoreMaskingExemptions(ctx, true)- a.Error(err, "saving the toggle must not erase a ceiling this build cannot read")- a.Equal(connect.CodeInvalidArgument, connect.CodeOf(err))-- var stored string- a.NoError(db.QueryRowContext(ctx, `- SELECT value ->> 'capability' FROM setting- WHERE workspace = $1 AND name = 'MCP';- `, workspaceID).Scan(&stored))- a.Equal("READ_ONLYY", stored, "the unreadable ceiling is still there, so enforcement still fails closed")-- // A dry run can repair the parsed capability state without persisting it.- dryRun := ctl.updateMCPCapability(ctx, v1pb.MCPSetting_READ_ONLY, true)- a.NoError(dryRun, "a dry run that repairs the capability is fine")-- // The same request that sets a capability repairs the row.- a.NoError(ctl.setMCPCapability(ctx, v1pb.MCPSetting_READ_ONLY))- got, err := ctl.getMCPCapability(ctx)- a.NoError(err)- a.Equal(v1pb.MCPSetting_READ_ONLY, got)- a.NoError(ctl.setIgnoreMaskingExemptions(ctx, true), "and the toggle saves once the ceiling is readable")-}-func TestMCPMissingRowUsesGenericUpdateSemantics(t *testing.T) {t.Parallel()a := require.New(t)@@ -239,19 +193,31 @@ func TestMCPMissingRowUsesGenericUpdateSemantics(t *testing.T) {a.Error(err)a.Equal(connect.CodeNotFound, connect.CodeOf(err))- a.NoError(ctl.setIgnoreMaskingExemptions(ctx, true),- "allow_missing must create an MCP row from the READ_WRITE compatibility fallback")- setting, err := ctl.getMCPSetting(ctx)+ _, err = ctl.settingServiceClient.UpdateSetting(ctx, connect.NewRequest(&v1pb.UpdateSettingRequest{+ AllowMissing: true,+ Setting: &v1pb.Setting{+ Name: "settings/" + v1pb.Setting_MCP.String(),+ Value: &v1pb.SettingValue{Value: &v1pb.SettingValue_Mcp{Mcp: &v1pb.MCPSetting{}}},+ },+ UpdateMask: &fieldmaskpb.FieldMask{},+ }))+ a.Equal(connect.CodeInvalidArgument, connect.CodeOf(err),+ "an update that names no capability must not create a row")+ _, err = ctl.getMCPSetting(ctx)+ a.Equal(connect.CodeNotFound, connect.CodeOf(err), "the refused update left no row behind")++ a.NoError(ctl.setMCPCapability(ctx, v1pb.MCPSetting_READ_ONLY),+ "allow_missing must create the MCP row")+ stored, err := ctl.getMCPCapability(ctx)a.NoError(err)- a.Equal(v1pb.MCPSetting_READ_WRITE, setting.GetCapability())- a.True(setting.GetIgnoreMaskingExemptions())+ a.Equal(v1pb.MCPSetting_READ_ONLY, stored)}-// TestMCPRepairKeepsTheMaskingToggle pins that fixing the ceiling does not-// disarm the masking toggle. Repairing a policy must change the one field the-// request names; handing users' unmasking exemptions back to MCP sessions as a-// side effect of a ceiling fix would be a silent loosening.-func TestMCPRepairKeepsTheMaskingToggle(t *testing.T) {+// TestMCPRepairIgnoresARetiredKey pins why the retired ignoreMaskingExemptions+// key needs no migration. The store's unmarshaler discards a key this build+// does not define, and a save marshals what it read, so the key neither fails+// the read nor survives the next write.+func TestMCPRepairIgnoresARetiredKey(t *testing.T) {t.Parallel()a := require.New(t)ctx := context.Background()@@ -269,23 +235,26 @@ func TestMCPRepairKeepsTheMaskingToggle(t *testing.T) {`, workspaceID)a.NoError(err)- // Generic reads still expose the fields this build understands.- setting, err := ctl.getMCPSetting(ctx)- a.NoError(err)- a.True(setting.GetIgnoreMaskingExemptions(),- "the toggle is readable even though the ceiling is not")+ _, err = ctl.getMCPSetting(ctx)+ a.NoError(err, "the retired key must not fail the read")- // Repairing the ceiling must not disarm the toggle.- a.NoError(ctl.setMCPCapability(ctx, v1pb.MCPSetting_READ_ONLY))- repaired, err := ctl.getMCPSetting(ctx)+ a.NoError(ctl.setMCPCapability(ctx, v1pb.MCPSetting_READ_ONLY),+ "the retired key must not block repairing the ceiling")+ repaired, err := ctl.getMCPCapability(ctx)a.NoError(err)- a.Equal(v1pb.MCPSetting_READ_ONLY, repaired.GetCapability())- a.True(repaired.GetIgnoreMaskingExemptions(),- "repairing the ceiling must not return exemptions to MCP sessions")+ a.Equal(v1pb.MCPSetting_READ_ONLY, repaired)++ var retired bool+ a.NoError(db.QueryRowContext(ctx, `+ SELECT jsonb_exists(value, 'ignoreMaskingExemptions') FROM setting+ WHERE workspace = $1 AND name = 'MCP';+ `, workspaceID).Scan(&retired))+ a.False(retired, "the save rewrote the row without the key")}-// TestMCPMissingCapabilityRefusesPartialUpdate pins that a partial update cannot-// make an invalid row look permissive.+// TestMCPMissingCapabilityRefusesPartialUpdate pins that an update naming no+// capability is refused before it writes, so it cannot erase a ceiling this+// build cannot read, such as a tier a newer release wrote.func TestMCPMissingCapabilityRefusesPartialUpdate(t *testing.T) {t.Parallel()a := require.New(t)@@ -297,11 +266,136 @@ func TestMCPMissingCapabilityRefusesPartialUpdate(t *testing.T) {a.NoError(err)defer db.Close()_, err = db.ExecContext(ctx, `- UPDATE setting SET value = '{}' WHERE workspace = $1 AND name = 'MCP'+ UPDATE setting SET value = jsonb_set(value, '{capability}', '"READ_ONLYY"')+ WHERE workspace = $1 AND name = 'MCP';`, workspaceID)a.NoError(err)- err = ctl.setIgnoreMaskingExemptions(ctx, true)+ _, err = ctl.settingServiceClient.UpdateSetting(ctx, connect.NewRequest(&v1pb.UpdateSettingRequest{+ Setting: &v1pb.Setting{+ Name: "settings/" + v1pb.Setting_MCP.String(),+ Value: &v1pb.SettingValue{Value: &v1pb.SettingValue_Mcp{Mcp: &v1pb.MCPSetting{}}},+ },+ UpdateMask: &fieldmaskpb.FieldMask{},+ }))a.Error(err)a.Equal(connect.CodeInvalidArgument, connect.CodeOf(err))+ a.ErrorContains(err, "capability must be specified")++ var stored string+ a.NoError(db.QueryRowContext(ctx, `+ SELECT value ->> 'capability' FROM setting+ WHERE workspace = $1 AND name = 'MCP';+ `, workspaceID).Scan(&stored))+ a.Equal("READ_ONLYY", stored, "the unreadable ceiling is still there, so enforcement still fails closed")+}++// TestMCPCapabilityBitesTheNextRequest is the live-state pin for the ceiling+// gate. The gate reads the MCP setting straight from the database on every+// request, so a changed ceiling binds the next request of a session that is+// already open: no re-consent, no reconnect, no restart.+//+// The writes are direct SQL. An in-process UpdateSetting refreshes the setting+// cache, so a cached read would pass too; an out-of-band edit is the state only+// an uncached read answers correctly. READ_ONLY rather than DISABLED: the /mcp+// connection gate refuses DISABLED on a read of its own before the ceiling gate+// runs.+//+// The RED state: point the gate at the cached Store.GetSetting instead of+// GetMCPSettingsUncached and the out-of-band READ_ONLY stops biting.+func TestMCPCapabilityBitesTheNextRequest(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl, ctx := startWorkspace(ctx, t)++ workspaceID := currentWorkspaceID(ctx, t, ctl)+ db, err := sql.Open("pgx", ctl.profile.PgURL)+ a.NoError(err)+ defer db.Close()+ writeCeiling := func(capability v1pb.MCPSetting_Capability) {+ result, err := db.ExecContext(ctx, `+ UPDATE setting SET value = jsonb_set(value, '{capability}', to_jsonb($2::text))+ WHERE workspace = $1 AND name = 'MCP';+ `, workspaceID, capability.String())+ a.NoError(err)+ affected, err := result.RowsAffected()+ a.NoError(err)+ a.Equal(int64(1), affected, "the MCP setting row must exist for the out-of-band write to mean anything")+ }++ a.NoError(ctl.setMCPCapability(ctx, v1pb.MCPSetting_READ_WRITE))+ token, _ := mintMCPOAuthToken(t, ctl, ctl.authInterceptor.token)+ session := openMCPSession(ctx, t, ctl, token)+ defer session.Close()+ createSheet := func() mcpCallResult {+ return callAPIOnSession(ctx, t, session, "SheetService/CreateSheet",+ sheetBody(ctl.project.Name, "SELECT 1;"))+ }++ served := createSheet()+ a.Equal(http.StatusOK, served.Status, "READ_WRITE serves a WRITE method: %s", served.Error)++ writeCeiling(v1pb.MCPSetting_READ_ONLY)+ refused := createSheet()+ a.Equal(http.StatusForbidden, refused.Status,+ "the ceiling must bite the very next request of the session already open")+ a.Contains(refused.Error, "capability ceiling is READ_ONLY",+ "the refusal must be the ceiling gate's")++ writeCeiling(v1pb.MCPSetting_READ_WRITE)+ served = createSheet()+ a.Equal(http.StatusOK, served.Status,+ "live in both directions, on the unchanged session: %s", served.Error)+}++// TestMCPSessionCannotTurnMCPOff drives the ceiling write from an OAuth-minted+// session, the credential an agent holds; TestMCPCannotRewriteItsOwnCeiling+// makes the same refusal on a session opened with the console bearer.+// UpdateSetting is FORBIDDEN to MCP sessions, so the class gate refuses it+// ahead of the handler whatever the payload, and the principal is a workspace+// admin who could otherwise write this setting.+//+// The stored value is the half that matters: a guard that refused after the+// write would leave the setting changed while reporting a denial.+func TestMCPSessionCannotTurnMCPOff(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl, ctx := startWorkspace(ctx, t)++ workspace, err := ctl.workspaceServiceClient.GetWorkspace(ctx, connect.NewRequest(&v1pb.GetWorkspaceRequest{+ Name: "workspaces/-",+ }))+ a.NoError(err)++ a.NoError(ctl.setMCPCapability(ctx, v1pb.MCPSetting_READ_WRITE))++ token, _ := mintMCPOAuthToken(t, ctl, ctl.authInterceptor.token)+ session := openMCPSession(ctx, t, ctl, token)+ defer session.Close()++ out := callAPIOnSession(ctx, t, session, "SettingService/UpdateSetting", map[string]any{+ "allowMissing": true,+ "setting": map[string]any{+ "name": "settings/" + v1pb.Setting_MCP.String(),+ "value": map[string]any{+ "mcp": map[string]any{"capability": "DISABLED"},+ },+ },+ "updateMask": "value.mcp.capability",+ })+ t.Logf("MCP UpdateSetting{capability: DISABLED} → status=%d error=%q", out.Status, out.Error)++ a.Equal(http.StatusForbidden, out.Status,+ "an MCP session must not be able to rewrite the workspace settings")+ a.Contains(out.Error, "not available to MCP sessions",+ "the refusal must come from the FORBIDDEN gate, not from a permission check")++ stored, err := ctl.getMCPCapability(ctx)+ a.NoError(err)+ a.Equal(v1pb.MCPSetting_READ_WRITE, stored, "the refusal must land before the write")++ a.Empty(mcpAuditRows(ctx, t, ctl, workspace.Msg.Name, "/bytebase.v1.SettingService/UpdateSetting"),+ "a gate refusal is never stored")}diff --git a/backend/tests/mcp_masking_test.go b/backend/tests/mcp_masking_test.goindex 69f3f8e574..41e55eb1e5 100644--- a/backend/tests/mcp_masking_test.go+++ b/backend/tests/mcp_masking_test.go@@ -1,25 +1,13 @@package tests-// ignore_masking_exemptions is the workspace toggle these tests exercise: an-// MCP request stops applying the caller's own unmasking provisioning.-//-// Two separate mechanisms let a user see a real value, and the toggle has to-// suppress both, so each gets a test of its own here: the masking exemptions-// granted to them (TestMCPMaskingIgnoresTheUsersExemption) and the unmask-// carried by an access grant (TestMCPMaskingIgnoresTheAccessGrantUnmask).-// Suppressing only one would leave the other serving real values to the agent,-// and no unit test composes both — the exemption seam and SkipMasking sit on-// different sides of the masking pass.-//-// It is not a confidentiality boundary. Masking runs only where the engine-// supports it and only on classified columns, so this narrows what an agent-// reads through the paths Bytebase masks and nothing else.-//-// The other half of the claim is the console: the toggle keys on the delegated-// grant, so the same user reading the same column signed in to Bytebase is-// untouched. Every read test below asserts both paths on one fixture, because-// a mask that appeared on both would satisfy "the agent sees a mask" while-// destroying the feature.+// An MCP session applies the caller's own masking provisioning exactly as the+// console does. Two mechanisms let a user see a real value, and they reach+// masking through different doors: a masking exemption is filtered per caller+// inside the masking pass (QueryResultMasker.exemptionsForPrincipal), while an+// access grant's unmask turns the pass off at the query context+// (db.QueryContext.SkipMasking), which Query and Export each set on their own.+// Every read below asserts both transports on one fixture, so an agent that+// reads something other than what the console reads fails in either direction.import ("bytes"@@ -30,7 +18,6 @@ import ("fmt""io""net/http"- "strconv""strings""testing""time"@@ -64,37 +51,6 @@ const (secretQuery = "SELECT secret FROM employee")-// setIgnoreMaskingExemptions writes the workspace masking toggle through the-// settings API. There is no console control yet — the toggle card is 1b-6 — so-// this is the only way to set it today.-func (ctl *controller) setIgnoreMaskingExemptions(ctx context.Context, ignore bool) error {- _, err := ctl.settingServiceClient.UpdateSetting(ctx, connect.NewRequest(&v1pb.UpdateSettingRequest{- AllowMissing: true,- Setting: &v1pb.Setting{- Name: "settings/" + v1pb.Setting_MCP.String(),- Value: &v1pb.SettingValue{- Value: &v1pb.SettingValue_Mcp{- Mcp: &v1pb.MCPSetting{IgnoreMaskingExemptions: ignore},- },- },- },- UpdateMask: &fieldmaskpb.FieldMask{- Paths: []string{"value.mcp.ignore_masking_exemptions"},- },- }))- return err-}--func (ctl *controller) getIgnoreMaskingExemptions(ctx context.Context) (bool, error) {- resp, err := ctl.settingServiceClient.GetSetting(ctx, connect.NewRequest(&v1pb.GetSettingRequest{- Name: "settings/" + v1pb.Setting_MCP.String(),- }))- if err != nil {- return false, err- }- return resp.Msg.Value.GetMcp().GetIgnoreMaskingExemptions(), nil-}-// mcpMaskingFixture is one live server holding one Postgres row whose `secret`// column carries a full-mask semantic type, reachable two ways: an open MCP// session and the console clients on ctl. Both belong to the same principal,@@ -124,7 +80,7 @@ func setupMCPMaskingFixture(ctx context.Context, t *testing.T) *mcpMaskingFixtur// The substitution is spelled out rather than left to the default, because// the masked-write guard recognizes this one string: a workspace that// configured any other substitution is outside what the guard can detect,- // and pinning the recognizable one is what makes the write half testable.+ // and pinning the recognizable one is what makes the guard testable._, err = ctl.settingServiceClient.UpdateSetting(ctx, connect.NewRequest(&v1pb.UpdateSettingRequest{AllowMissing: true,Setting: &v1pb.Setting{@@ -207,9 +163,9 @@ func setupMCPMaskingFixture(ctx context.Context, t *testing.T) *mcpMaskingFixtur}))a.NoError(err)- // READ_WRITE rather than READ_ONLY: the toggle's write half — the- // masked-write guard — sits on methods a read-only ceiling already refuses- // for a different reason, and a read is served under either ceiling.+ // READ_WRITE rather than READ_ONLY: Export and the masked-write guard's+ // doors sit on methods a read-only ceiling already refuses for a different+ // reason, and a read is served under either ceiling.a.NoError(ctl.setMCPCapability(ctx, v1pb.MCPSetting_READ_WRITE))token, _ := mintMCPOAuthToken(t, ctl, ctl.authInterceptor.token)session := openMCPSession(ctx, t, ctl, token)@@ -225,9 +181,8 @@ func setupMCPMaskingFixture(ctx context.Context, t *testing.T) *mcpMaskingFixtur}// The precondition every later assertion rests on. With nothing granted to- // anybody the column is masked on both paths, so a test that expects a mask- // is testing the toggle rather than a fixture where the semantic type never- // attached.+ // anybody the column is masked on both paths, so a real value read later is+ // the provisioning at work rather than a semantic type that never attached.a.Equal(maskPlaceholder, f.consoleReadsSecret(t),"precondition: the semantic type must actually mask the column")a.Equal(maskPlaceholder, f.agentReadsSecret(t, session),@@ -236,8 +191,7 @@ func setupMCPMaskingFixture(ctx context.Context, t *testing.T) *mcpMaskingFixtur}// consoleReadsSecret is the human path: a person signed in to Bytebase running-// the same statement the agent runs. It carries no delegated grant, which is-// the only thing the toggle keys on.+// the same statement the agent runs.func (f *mcpMaskingFixture) consoleReadsSecret(t *testing.T) string {t.Helper()resp, err := f.ctl.sqlServiceClient.Query(f.ctx, connect.NewRequest(&v1pb.QueryRequest{@@ -265,13 +219,12 @@ func (f *mcpMaskingFixture) agentReadsSecret(t *testing.T, session *mcp.ClientSereturn value}-// exemptFromMasking grants member a masking exemption over the whole project.-// An empty condition means every database with no expiration, which keeps the-// exemption out of the way of what is under test: whether the toggle suppresses-// it, not whether its CEL matched.-func (f *mcpMaskingFixture) exemptFromMasking(t *testing.T, member string) {+// exemptFromMasking grants member a masking exemption over the whole project+// and returns the policy's name. An empty condition means every database with+// no expiration, which keeps the exemption's CEL out of what is under test.+func (f *mcpMaskingFixture) exemptFromMasking(t *testing.T, member string) string {t.Helper()- _, err := f.ctl.orgPolicyServiceClient.CreatePolicy(f.ctx, connect.NewRequest(&v1pb.CreatePolicyRequest{+ policy, err := f.ctl.orgPolicyServiceClient.CreatePolicy(f.ctx, connect.NewRequest(&v1pb.CreatePolicyRequest{Parent: f.ctl.project.Name,Policy: &v1pb.Policy{Type: v1pb.PolicyType_MASKING_EXEMPTION,@@ -285,15 +238,15 @@ func (f *mcpMaskingFixture) exemptFromMasking(t *testing.T, member string) {},}))require.NoError(t, err)+ return policy.Msg.Name}// grantUnmask creates and activates an access grant that unmasks exactly// secretQuery on the fixture's database.//-// This is the second mechanism the toggle suppresses, and it reaches masking-// through a different door from an exemption: it turns the whole masking pass-// off at the query context (db.QueryContext.SkipMasking) rather than filtering-// the caller's exemptions inside it.+// It reaches masking through a different door from an exemption: it turns the+// whole masking pass off at the query context (db.QueryContext.SkipMasking)+// rather than filtering the caller's exemptions inside it.//// preCheckAccess finds a grant only on an exact match of creator, trimmed query// text, ACTIVE status and a live expire_time, so all four are pinned here@@ -316,7 +269,7 @@ func (f *mcpMaskingFixture) grantUnmask(t *testing.T, export bool) {Creator: f.ctl.principalName,Targets: []string{f.database},Query: secretQuery,- Reason: "masking toggle end-to-end coverage",+ Reason: "MCP masking end-to-end coverage",Unmask: true,Export: export,Expiration: &v1pb.AccessGrant_ExpireTime{ExpireTime: timestamppb.New(time.Now().Add(time.Hour))},@@ -333,44 +286,24 @@ func (f *mcpMaskingFixture) grantUnmask(t *testing.T, export bool) {"the grant has to be live, or preCheckAccess filters it out and the test proves nothing")}-// storedMaskingToggleKey reports whether the workspace profile row carries a-// ignoreMaskingExemptions key at all.-//-// protojson omits a false bool, so "never set" and "set to false" are the same-// row. That is exactly why the resolver has to read the missing key as false-// rather than as unknown, and why the absent case is worth pinning separately-// from the explicit one.-func (f *mcpMaskingFixture) storedMaskingToggleKey(t *testing.T) bool {- t.Helper()- db, err := sql.Open("pgx", f.ctl.profile.PgURL)- require.NoError(t, err)- defer db.Close()- var present bool- require.NoError(t, db.QueryRowContext(f.ctx, `- SELECT jsonb_exists(value, 'ignoreMaskingExemptions') FROM setting- WHERE workspace = $1 AND name = 'MCP';- `, f.workspaceID).Scan(&present))- return present-}--// writeMaskingToggleOutOfBand flips the toggle behind the server's back. The-// setting cache has no TTL and only in-process writes refresh it, so this is-// the one state a cached read would miss — a direct SQL edit, or another-// replica's write.-func (f *mcpMaskingFixture) writeMaskingToggleOutOfBand(t *testing.T, ignore bool) {+// storeRetiredMaskingKey writes the retired ignoreMaskingExemptions key into+// the MCP setting row, set to true, as a workspace that turned the toggle on+// before 3.23.0 still holds it. Direct SQL is the only way to write it: the+// settings API no longer has the field.+func (f *mcpMaskingFixture) storeRetiredMaskingKey(t *testing.T) {t.Helper()a := require.New(t)db, err := sql.Open("pgx", f.ctl.profile.PgURL)a.NoError(err)defer db.Close()result, err := db.ExecContext(f.ctx, `- UPDATE setting SET value = jsonb_set(value, '{ignoreMaskingExemptions}', $2::jsonb)+ UPDATE setting SET value = value || '{"ignoreMaskingExemptions": true}'::jsonbWHERE workspace = $1 AND name = 'MCP';- `, f.workspaceID, strconv.FormatBool(ignore))+ `, f.workspaceID)a.NoError(err)affected, err := result.RowsAffected()a.NoError(err)- a.Equal(int64(1), affected, "the MCP setting row must exist for the out-of-band write to mean anything")+ a.Equal(int64(1), affected, "the MCP setting row must exist for the retired key to mean anything")}// agentExportsCSV runs SQLService/Export over an MCP session. No MCP tool wraps@@ -430,39 +363,6 @@ func readZipEntry(t *testing.T, file *zip.File) string {return string(body)}-// queryValueOnSession runs SQLService/Query through call_api and returns the-// single value the statement selects.-//-// call_api rather than query_database wherever the session belongs to a-// non-admin: query_database resolves the database by listing workspace-wide-// first, so a listing denial would refuse the read for a reason that is not the-// one under test.-func queryValueOnSession(ctx context.Context, t *testing.T, session *mcp.ClientSession, database, statement string) string {- t.Helper()- a := require.New(t)- out := callAPIOnSession(ctx, t, session, "SQLService/Query", map[string]any{- "name": database,- "statement": statement,- })- a.Equal(http.StatusOK, out.Status, "the read must be served: %s", out.Error)- var payload struct {- Results []struct {- Error string `json:"error"`- Rows []struct {- Values []struct {- StringValue string `json:"stringValue"`- } `json:"values"`- } `json:"rows"`- } `json:"results"`- }- a.NoError(json.Unmarshal([]byte(out.RawResponse), &payload))- a.Len(payload.Results, 1)- a.Empty(payload.Results[0].Error)- a.Len(payload.Results[0].Rows, 1)- a.Len(payload.Results[0].Rows[0].Values, 1)- return payload.Results[0].Rows[0].Values[0].StringValue-}-// changeToolResult is what an agent gets back from propose_database_change:// the text a model reads and whether the tool reported a failure.type changeToolResult struct {@@ -502,235 +402,45 @@ func sheetBody(project, statement string) map[string]any {}}-// TestMCPMaskingIgnoresTheUsersExemption is the headline: the toggle-// suppresses the caller's OWN masking provisioning, not merely the masking they-// were never granted an exemption from.-//-// One principal, one column, two transports. The exemption is live throughout —-// the control at the top proves it by serving the real value to both paths with-// the toggle off — so the only thing that changes between the two halves is-// which transport the request arrived on.+// TestMCPMaskingFollowsTheCallersProvisioning pins console parity on every+// path that serves a real value: a masking exemption, an access grant's unmask+// on Query, and the same unmask on Export, which sets SkipMasking on its own.//-// The RED state: drop the mcpIgnoresMaskingExemptions check from-// QueryResultMasker.exemptionsForPrincipal and the agent's read goes back to-// the real value, because the exemption is filtered to this caller and passes.-func TestMCPMaskingIgnoresTheUsersExemption(t *testing.T) {+// The row carries the retired ignoreMaskingExemptions key set to true. The+// store discards a key it does not define, so the key must change nothing.+func TestMCPMaskingFollowsTheCallersProvisioning(t *testing.T) {t.Parallel()a := require.New(t)f := setupMCPMaskingFixture(context.Background(), t)+ f.storeRetiredMaskingKey(t)- f.exemptFromMasking(t, "user:[email protected]")-- // With the toggle off the exemption reaches both paths, so it is the- // toggle and not the exemption that the second half turns on.- a.NoError(f.ctl.setIgnoreMaskingExemptions(f.ctx, false))- a.Equal(maskedSecret, f.consoleReadsSecret(t),- "the exemption must serve the real value in the console")- a.Equal(maskedSecret, f.agentReadsSecret(t, f.session),- "and with the toggle off the agent inherits the same exemption")-- a.NoError(f.ctl.setIgnoreMaskingExemptions(f.ctx, true))-+ exemption := f.exemptFromMasking(t, "user:[email protected]")a.Equal(maskedSecret, f.consoleReadsSecret(t),- "the toggle is about what an agent may read; the console keeps the exemption")- a.Equal(maskPlaceholder, f.agentReadsSecret(t, f.session),- "the toggle must stop applying the exemption the caller holds")-}--// TestMCPMaskingIgnoresTheAccessGrantUnmask is the other mechanism.-// An access grant with unmask=true never reaches the exemption filter at all:-// it sets db.QueryContext.SkipMasking, which turns the whole masking pass off-// one layer earlier. So suppressing exemptions alone would leave this path-// handing the agent real values.-//-// The RED state: drop `&& !mcpIgnoresMaskingExemptions(ctx)` from the SkipMasking term in-// SQLService.Query and the agent's read under the toggle goes back to the real-// value.-func TestMCPMaskingIgnoresTheAccessGrantUnmask(t *testing.T) {- t.Parallel()- a := require.New(t)- f := setupMCPMaskingFixture(context.Background(), t)-- f.grantUnmask(t, false /* export */)-- a.NoError(f.ctl.setIgnoreMaskingExemptions(f.ctx, false))- a.Equal(maskedSecret, f.consoleReadsSecret(t), "the grant unmasks in the console")+ "the exemption serves the real value in the console")a.Equal(maskedSecret, f.agentReadsSecret(t, f.session),- "and with the toggle off the same grant unmasks over MCP")-- a.NoError(f.ctl.setIgnoreMaskingExemptions(f.ctx, true))-- a.Equal(maskedSecret, f.consoleReadsSecret(t),- "the human's grant is untouched — the toggle did not revoke it")- a.Equal(maskPlaceholder, f.agentReadsSecret(t, f.session),- "the toggle must stop applying the unmask an access grant carries")-}--// TestMCPMaskingIgnoresExemptionsOnExport covers the second way data leaves the-// product. Export is a WRITE method, so a READ_WRITE MCP session reaches it,-// and it carries its own copy of the access-grant unmask rather than sharing-// Query's — one enforcement point per copy, which is why suppressing it in-// Query alone would leave the whole dataset exportable in the clear.-//-// The RED state: drop `&& !mcpIgnoresMaskingExemptions(ctx)` from the skipMasking term in-// SQLService.Export and the CSV under the toggle carries the real value.-func TestMCPMaskingIgnoresExemptionsOnExport(t *testing.T) {- t.Parallel()- a := require.New(t)- f := setupMCPMaskingFixture(context.Background(), t)-- f.grantUnmask(t, true /* export */)-- a.NoError(f.ctl.setIgnoreMaskingExemptions(f.ctx, false))- a.Contains(f.agentExportsCSV(t, f.session), maskedSecret,- "with the toggle off the grant unmasks the agent's export too")-- a.NoError(f.ctl.setIgnoreMaskingExemptions(f.ctx, true))-- exported := f.agentExportsCSV(t, f.session)- a.Contains(exported, maskPlaceholder, "an export under the toggle must carry the mask")- a.NotContains(exported, maskedSecret, "and must not carry the value behind it")-- a.Contains(f.consoleExportsCSV(t), maskedSecret,- "the same grant still exports in the clear for a person in the console")-}--// TestMCPMaskingToggleOffFollowsProvisioning pins the two states an existing workspace-// can be in. Absent is the one that matters on upgrade: nothing wrote the key,-// and a resolver that read the missing key as anything but false would start-// masking for every workspace that upgraded into this build.-//-// Explicit false is stored the same way — protojson omits a false bool — so the-// row is identical and the assertion is that the API round trip and the served-// behavior agree with it.-func TestMCPMaskingToggleOffFollowsProvisioning(t *testing.T) {- t.Parallel()- a := require.New(t)- f := setupMCPMaskingFixture(context.Background(), t)-- f.exemptFromMasking(t, "user:[email protected]")+ "and to the same caller's MCP session")- a.False(f.storedMaskingToggleKey(t),- "precondition: the fixture wrote a ceiling and nothing else, so the toggle was never set")- stored, err := f.ctl.getIgnoreMaskingExemptions(f.ctx)- a.NoError(err)- a.False(stored)- a.Equal(maskedSecret, f.consoleReadsSecret(t))- a.Equal(maskedSecret, f.agentReadsSecret(t, f.session),- "a workspace that never set the toggle follows each user's own provisioning")-- a.NoError(f.ctl.setIgnoreMaskingExemptions(f.ctx, false))-- a.False(f.storedMaskingToggleKey(t),- "a false bool is stored as absence, which is why both states must resolve the same way")- stored, err = f.ctl.getIgnoreMaskingExemptions(f.ctx)- a.NoError(err)- a.False(stored)- a.Equal(maskedSecret, f.consoleReadsSecret(t))- a.Equal(maskedSecret, f.agentReadsSecret(t, f.session),- "an explicit false must behave exactly as absent does")-}--// TestMCPMaskingToggleSparesHumanSessions is the half of the claim that-// keeps the toggle shippable. It keys on the delegated grant a session carries,-// never on the user or on a field value, so a person signed in to the console-// is untouched whatever the workspace tells agents to ignore.-//-// The principal here is a non-admin who holds the exemption, so the console-// half cannot pass by way of some admin bypass, and the MCP half runs on the-// SAME principal to show the toggle really is on while the console read serves-// the real value.-//-// The RED state: key mcpIgnoresMaskingExemptions on anything other than the grant's-// presence — the consented scope, say, which a legacy session leaves empty —-// and either the console read starts masking or the MCP read stops.-func TestMCPMaskingToggleSparesHumanSessions(t *testing.T) {- t.Parallel()- a := require.New(t)- f := setupMCPMaskingFixture(context.Background(), t)-- const readerEmail = "[email protected]"- const readerPassword = "1024bytebase"- reader, err := f.ctl.userServiceClient.CreateUser(f.ctx, connect.NewRequest(&v1pb.CreateUserRequest{- User: &v1pb.User{Title: "masking reader", Email: readerEmail, Password: readerPassword},- }))- a.NoError(err)- _, err = f.ctl.addMemberToWorkspaceIAM(f.ctx, reader.Msg.Workspace, "user:"+readerEmail, "roles/workspaceMember")- a.NoError(err)-- policy, err := f.ctl.projectServiceClient.GetIamPolicy(f.ctx, connect.NewRequest(&v1pb.GetIamPolicyRequest{- Resource: f.ctl.project.Name,- }))- a.NoError(err)- policy.Msg.Bindings = append(policy.Msg.Bindings, &v1pb.Binding{- Role: "roles/sqlEditorUser", Members: []string{"user:" + readerEmail},- })- _, err = f.ctl.projectServiceClient.SetIamPolicy(f.ctx, connect.NewRequest(&v1pb.SetIamPolicyRequest{- Resource: f.ctl.project.Name,- Policy: policy.Msg,- }))- a.NoError(err)-- f.exemptFromMasking(t, "user:"+readerEmail)- a.NoError(f.ctl.setIgnoreMaskingExemptions(f.ctx, true))-- login, err := f.ctl.authServiceClient.Login(f.ctx, connect.NewRequest(&v1pb.LoginRequest{- Email: readerEmail, Password: readerPassword,+ // While the exemption is live every read is real, so the grant is checked+ // with it gone.+ _, err := f.ctl.orgPolicyServiceClient.DeletePolicy(f.ctx, connect.NewRequest(&v1pb.DeletePolicyRequest{+ Name: exemption,}))a.NoError(err)-- admin := f.ctl.authInterceptor.token- f.ctl.authInterceptor.token = login.Msg.Token- console := f.consoleReadsSecret(t)- f.ctl.authInterceptor.token = admin- a.Equal(maskedSecret, console,- "a person signed in to Bytebase keeps their exemption while agents lose it")-- // The same principal one transport over, so the toggle is demonstrably on- // rather than merely written.- readerMCP, _ := mintMCPOAuthToken(t, f.ctl, login.Msg.Token)- session := openMCPSession(f.ctx, t, f.ctl, readerMCP)- defer session.Close()- a.Equal(maskPlaceholder, queryValueOnSession(f.ctx, t, session, f.database, secretQuery),- "the same user's agent session is held to the mask")-}--// TestMCPMaskingToggleBitesTheNextRequest is the live-state pin. The gate reads-// the MCP setting straight from the database on every request and stamps-// what it read, so an admin flipping the toggle binds the next request of a-// session that is already open: no re-consent, no reconnect, no restart.-//-// The out-of-band half is what makes the claim about the READ rather than about-// the write. An in-process UpdateSetting refreshes the setting cache, so a-// cached read would satisfy it too; a direct SQL edit is the state only an-// uncached read answers correctly.-//-// The RED state: point the gate at the cached Store.GetSetting instead of-// GetMCPSettingsUncached and the two out-of-band flips stop biting.-func TestMCPMaskingToggleBitesTheNextRequest(t *testing.T) {- t.Parallel()- a := require.New(t)- f := setupMCPMaskingFixture(context.Background(), t)-- f.exemptFromMasking(t, "user:[email protected]")- a.Equal(maskedSecret, f.agentReadsSecret(t, f.session),- "the session starts serving the caller's exemption")-- a.NoError(f.ctl.setIgnoreMaskingExemptions(f.ctx, true))a.Equal(maskPlaceholder, f.agentReadsSecret(t, f.session),- "the toggle must bite the very next request of the session already open")+ "precondition: without the exemption the column masks again")- f.writeMaskingToggleOutOfBand(t, false)+ f.grantUnmask(t, true /* export */)+ a.Equal(maskedSecret, f.consoleReadsSecret(t), "the grant unmasks in the console")a.Equal(maskedSecret, f.agentReadsSecret(t, f.session),- "the gate must read the row rather than the profile it cached")-- f.writeMaskingToggleOutOfBand(t, true)- a.Equal(maskPlaceholder, f.agentReadsSecret(t, f.session),- "live in both directions, on the unchanged session")+ "and the same grant unmasks the caller's MCP session")+ a.Contains(f.consoleExportsCSV(t), maskedSecret,+ "the grant exports in the clear from the console")+ a.Contains(f.agentExportsCSV(t, f.session), maskedSecret,+ "and Export over MCP honors the same grant")}-// TestMCPMaskedWriteIsRefused is the corruption the read half would otherwise-// invite: the agent reads a masked column, gets the placeholder, and writes the+// TestMCPMaskedWriteIsRefused is the corruption a masked read invites: the+// agent reads a masked column, gets the placeholder, and writes the// placeholder back as if it were the value. The real data is gone and nothing// in the change looks wrong.//@@ -742,10 +452,8 @@ func TestMCPMaskingToggleBitesTheNextRequest(t *testing.T) {// READ class, so every ceiling that opens a session serves it, and both// authorize a write under this fixture's READ_WRITE ceiling.//-// The control at the end is the JC1 pin: the guard is not the toggle's, so-// turning the toggle off still refuses. A clean statement through the same door-// is what proves the door is genuinely open — otherwise "refused" and "not-// reachable" look alike.+// A clean statement through the same door at the end is what proves the door+// is genuinely open — otherwise "refused" and "not reachable" look alike.//// The RED state: remove the masked-write entries from mcpRequestShapeRefusals// and no refusal here is the guard's any more — the sheet, release and query@@ -757,12 +465,9 @@ func TestMCPMaskedWriteIsRefused(t *testing.T) {a := require.New(t)f := setupMCPMaskingFixture(context.Background(), t)- a.NoError(f.ctl.setIgnoreMaskingExemptions(f.ctx, true))-// The console needs to see the real value, or "the write never ran" is// unprovable: a masked read shows the placeholder whether or not the UPDATE- // landed. The exemption is suppressed for the agent by the toggle, which is- // the other half of this fixture.+ // landed.f.exemptFromMasking(t, "user:[email protected]")a.Equal(maskedSecret, f.consoleReadsSecret(t))@@ -779,7 +484,7 @@ func TestMCPMaskedWriteIsRefused(t *testing.T) {served := callAPIOnSession(f.ctx, t, f.session, "SheetService/CreateSheet",sheetBody(f.ctl.project.Name, cleanWrite))a.Equal(http.StatusOK, served.Status,- "an ordinary change under the toggle is still served: %s", served.Error)+ "an ordinary change is still served: %s", served.Error)// The batch door refuses on one offending sheet, matching the clamp, which// denies a batch holding any statement it will not serve.@@ -857,20 +562,6 @@ func TestMCPMaskedWriteIsRefused(t *testing.T) {a.NoError(err, "the console path must be untouched by the mask guard")a.NotEmpty(created.Msg.Name)- // The control. Same session, same statement; only the toggle changed — and- // the refusal does not, because masked reads happen without the toggle.- a.NoError(f.ctl.setIgnoreMaskingExemptions(f.ctx, false))- stillRefused := callAPIOnSession(f.ctx, t, f.session, "SheetService/CreateSheet",- sheetBody(f.ctl.project.Name, maskedWrite))- a.Equal(http.StatusForbidden, stillRefused.Status,- "the guard is not the toggle's: %s", stillRefused.Error)- stillRefusedQuery := callAPIOnSession(f.ctx, t, f.session, "SQLService/Query", map[string]any{- "name": f.database,- "statement": maskedWrite,- })- a.Equal(http.StatusForbidden, stillRefusedQuery.Status,- "on the execution door too: %s", stillRefusedQuery.Error)-// And the door really is open, which "refused" alone cannot show. A clean// write through SQLService/Query is the only place in this PR an MCP session// runs DML end to end, so it is asserted on the stored value, not the status.@@ -880,61 +571,6 @@ func TestMCPMaskedWriteIsRefused(t *testing.T) {"statement": agentWrite,})a.Equal(http.StatusOK, agentRan.Status, "the execution door is open: %s", agentRan.Error)- f.exemptFromMasking(t, "user:[email protected]")a.Equal("rotated-by-agent", f.consoleReadsSecret(t),"the agent's write landed, so the refusals above were the guard and not a closed door")}--// TestMCPSessionCannotFlipTheMaskingToggle closes the obvious way around the-// toggle: the agent turns it off first. UpdateSetting is FORBIDDEN to MCP-// sessions, so the refusal comes from the class gate ahead of the handler-// rather than from the caller's RBAC — and the principal here is a workspace-// admin, who would otherwise be allowed to write exactly this setting.-//-// The stored value is the load-bearing half: a guard that refused after the-// write would leave the workspace unprotected while reporting a denial.-func TestMCPSessionCannotFlipTheMaskingToggle(t *testing.T) {- t.Parallel()- a := require.New(t)- ctx := context.Background()- ctl, ctx := startWorkspace(ctx, t)-- workspace, err := ctl.workspaceServiceClient.GetWorkspace(ctx, connect.NewRequest(&v1pb.GetWorkspaceRequest{- Name: "workspaces/-",- }))- a.NoError(err)-- a.NoError(ctl.setMCPCapability(ctx, v1pb.MCPSetting_READ_WRITE))- a.NoError(ctl.setIgnoreMaskingExemptions(ctx, true))-- token, _ := mintMCPOAuthToken(t, ctl, ctl.authInterceptor.token)- session := openMCPSession(ctx, t, ctl, token)- defer session.Close()-- out := callAPIOnSession(ctx, t, session, "SettingService/UpdateSetting", map[string]any{- "allowMissing": true,- "setting": map[string]any{- "name": "settings/" + v1pb.Setting_MCP.String(),- "value": map[string]any{- "mcp": map[string]any{"ignoreMaskingExemptions": false},- },- },- // A FieldMask crossing as JSON carries lowerCamel path segments; the- // snake_case spelling the Go clients use is rejected before any- // interceptor sees the request.- "updateMask": "value.mcp.ignoreMaskingExemptions",- })- t.Logf("MCP UpdateSetting{ignore_masking_exemptions} → status=%d error=%q", out.Status, out.Error)-- a.Equal(http.StatusForbidden, out.Status,- "an MCP session must not be able to rewrite the workspace settings")- a.Contains(out.Error, "not available to MCP sessions",- "the refusal must come from the FORBIDDEN gate, not from a permission check")-- stored, err := ctl.getIgnoreMaskingExemptions(ctx)- a.NoError(err)- a.True(stored, "the refusal must land before the write: the toggle is still on")-- a.Empty(mcpAuditRows(ctx, t, ctl, workspace.Msg.Name, "/bytebase.v1.SettingService/UpdateSetting"),- "a gate refusal is never stored")-}diff --git a/backend/tests/mcp_migration_matrix_test.go b/backend/tests/mcp_migration_matrix_test.goindex 8453f119e8..ebb111cf53 100644--- a/backend/tests/mcp_migration_matrix_test.go+++ b/backend/tests/mcp_migration_matrix_test.go@@ -59,8 +59,8 @@ package tests//// Row 7 — a tightened ceiling bites the NEXT request of a live MCP session,// with no re-auth. That the gate reads the stored setting fresh, past the-// setting cache, is pinned by TestMCPMaskingToggleBitesTheNextRequest in this-// package, which flips the same setting out of band. NEW:+// setting cache, is pinned by TestMCPCapabilityBitesTheNextRequest in this+// package, which flips the ceiling out of band. NEW:// TestMCPMigrationTightenedCeilingBitesLiveSession.import (diff --git a/docs/design/backend-test-execution-time.md b/docs/design/backend-test-execution-time.mdindex bcfb327291..6a6e0c64a8 100644--- a/docs/design/backend-test-execution-time.md+++ b/docs/design/backend-test-execution-time.md@@ -638,7 +638,7 @@ snapshot, a sample instance's lifecycle hooks. The seven packages outside`api/` are untouched.Server boots go the same way:-`mcp_capability_setting_test.go` spends 6 to read and write one settings row,+`mcp_capability_setting_test.go` spends 5 of its 7 to read and write one settings row,the saved-query list and filter tests 12, GitOps `CheckRelease` 11 of 17. Keepthe 27 `TestCollision*` and `TestClaim*` tests where they are —`backend/store/AGENTS.md` requires them for a bug class unit tests cannot catch.diff --git a/docs/design/mcp-capability-ladder.md b/docs/design/mcp-capability-ladder.mdindex 9e72daaf89..ddbe9630c4 100644--- a/docs/design/mcp-capability-ladder.md+++ b/docs/design/mcp-capability-ladder.md@@ -20,7 +20,7 @@ becomes that editor later without a redesign.The page today (`frontend/src/routes/workspace/mcp/MCPAccessPolicySection.tsx`) shows, in viewstate, an "In force" line with the mode chip, the mode's description, and two notes; in edit-state, three mode cards, the masking toggle, and a footer. The consent page+state, three mode cards and a footer. The consent page(`frontend/src/routes/auth/MCPConsentCeiling.tsx`) renders three prose lines for the same policy.None of these says what an agent can do.@@ -231,8 +231,8 @@ refused in every mode, so no summary may say "read everything". The line never rname, which the chip (view) or theselector (edit) already shows. Expanded, it becomes the list heading "Read-write allows", with a"Show details" control on the right. In view state it sits under the chip line; in edit state it-sits under the selector and its "Best for" line, above the masking toggle, so the cause and its-effect are adjacent. The open state carries across the view-to-edit transition within a page+sits under the selector and its "Best for" line, so the cause and its effect are adjacent. The open+state carries across the view-to-edit transition within a pagevisit, and starts collapsed on the next one. Remembering it per browser was cut in review as moremachinery than a settings page visited this rarely earns.@@ -247,8 +247,8 @@ description.**D3 — The mode chip is the subject; the "In force" line and the mode sentence go.** Thethree-stripe icon and the words "In force" are removed. View state reads: the mode chip (success-for Read-only, warning for Read-write, destructive for Disabled), the "Masking exemptions ignored"-chip when set, Edit policy on the right; then the disclosure line, which carries the description.+for Read-only, warning for Read-write, destructive for Disabled), Edit policy on the right; then+the disclosure line, which carries the description.The mode chip carries the mode's icon before its name — the same Lucide glyph as the card in editstate (`Unplug`, `Eye`, `PencilLine`) — so the identity an admin picked is the identity shown inforce. The chip is the only place the mode's color appears; the cards stay neutral, because a@@ -285,8 +285,8 @@ toggle. The caption costs nine words and gives back the at-a-glance comparison tprovided. Under the cards, one line: the "Best for" of the selected mode, shown once instead ofthree times. Under that, the disclosure for the picked mode, rendering exactly what the view wouldshow after saving. No "adds N over Read-only", no added or removed marks, no comparison against the-stored mode: the muted rows already show what a pick does not serve. The edit state is about 125-words collapsed and 175 expanded, down from about 215 and 375 in the first draft of this design.+stored mode: the muted rows already show what a pick does not serve. The edit state is about 90+words collapsed and 140 expanded, down from about 215 and 375 in the first draft of this design.**D6 — Marks: ✓ or —, plus a tier tag on served rows only.** A served row shows ✓, a `success`"read" badge or a `warning` "write" badge after its title, and full-contrast text. An unserved row@@ -300,70 +300,6 @@ disclosure slot holds a static line in the floor's soft error tone, "Nothing issession can connect.", so red means "no capability" everywhere on the card. It is not a button anddoes not repeat the mode name.-The rule extends past color: **a control that governs only a serving session is withheld while-Disabled is picked, and the save leaves its stored value alone.** The masking toggle is the one-such control today. `mcpIgnoresMaskingExemptions` (`backend/api/v1/mcp_masking.go`) answers on the-delegated grant an MCP request carries, and Disabled admits no MCP session, so the stored flag is-never read there — a live toggle under a red line saying no session can connect would be the card-asserting two things that cannot both hold. Withholding the control is not a reason to discard what the admin set with it, and two attempts to-make it one both lost an explicit choice. Gating the write dropped the edit on a save under Disabled;-resetting the draft on the pick dropped it earlier and even when the admin returned to a serving-mode. The draft is therefore kept and saved whatever the pick: clicking through the modes to read-their descriptions must not silently undo an unrelated edit, and under Disabled the stored flag is-inert rather than wrong, so writing it costs nothing now and honors the choice when MCP is turned-back on.--The "Masking exemptions ignored" chip belongs to the **view**. It reports the stored flag in the-present tense and says which of three things that flag is doing: in effect, stored but unlicensed,-or stored with MCP off. Withholding it was tried and is wrong in both inert cases — the flag is-storable under Disabled, which preserving the draft makes reachable by design, and hiding it leaves-a set flag with nowhere to see it. The reasons it might be inert live in the editor and in the-Disabled sentence, and the editor is a different branch behind `bb.settings.set`, so a reader of-this page may never reach them; the chip therefore carries the reason itself. Its inventory is-therefore Disabled, then licensed or not — three arms, because a Disabled policy is reported as off-whether or not the workspace holds a masking license. It renders only where a stored mode exists to-qualify it, and takes that mode as an argument so the branch that proved there is one passes the-proof in. A predicate would not: `!isServingMode(storedMode)` also catches the ceiling this build-cannot parse, and would label a policy nobody turned off as "MCP is off". That ceiling gets no chip-at all, which is the one place this decision accepts a set flag with nowhere to see it: the repair-card carries a single instruction — pick a mode — and a second chip beside it competes with the only-action that resolves the state.--The editor does not render it, and an attempt to do so failed three ways at once. A present-tense-chip under a pick that admits no session states a live restriction directly beneath the red line-saying nothing can connect — the contradiction this decision withholds the toggle to prevent,-restated as a chip. Its text came from the stored pair while Save writes the draft, so it could-assert the opposite of what Save was about to do, in both directions. And gating it on the stored-flag left the "turned it on, then picked Disabled" case showing nothing at all — the very gap it was-added to close. **A surface discloses the state it owns: the view reports what is stored, the editor-reports what Save will write.** Under a pick that withholds the toggle the editor says so in the-footer, in the future tense, naming the direction — and whenever the saved flag will be set, not-only when this edit changed it, because an admin who cannot see the control cannot see the value-either.--Two bounds on that line, both found by making it say too much. It is gated on the form being-saveable: an editor opened and not touched has no save to describe, and under no pick at all the card-would otherwise say "pick a mode to save this policy" and "this policy will be saved" at once. And it-says only what will be written, never when that takes effect — "takes effect when MCP is enabled" is-false on a workspace with no masking license, and the caveat that would fix it lives in the toggle-this pick withholds. **State what is written, never when it takes effect**: the write is a fact this-card owns, the effect depends on axes it cannot see.--The consent page still withholds its masking line without a license, because its reader sees neither-the setting nor any caveat and would read the line as "my data is covered".-(Mock E draws the toggle under Disabled; the implementation does not.)--**D8 — Copy that shrinks, but keeps the coverage limit.** The masking toggle's two paragraphs-become: "If enabled, masked data stays masked in MCP sessions even for users with exemptions or-unmask grants. Coverage depends on the engine: where Bytebase does not mask, this changes nothing.-The console is unaffected." The middle sentence stays in the product on purpose. Masking runs only-on the engines `common.EngineSupportMasking` lists; on the others the query masker falls back to a-no-op, so on Snowflake or ClickHouse the toggle keeps nothing masked, and the setting's own proto-comment says it "is not a confidentiality boundary". A toggle that promised more would mislead the-admin it exists to protect. The three "Best for" lines keep their current wording. The Read-only description sentence ("Sessions can explore schemas and run-read-only queries…") is retired everywhere; its content lives in the Read-only summary and in row-2's sub-item.-**D9 — The Authentication Required alert on the MCP page is removed.** Its two sentences alreadyexist on the page: "approve access in the browser" in the Connect a client description, and"appropriate permissions" in the section description. Connect a client gains the one clause that@@ -372,7 +308,7 @@ approve access in the browser."**D10 — The consent page uses the row titles, and bounds them once.** "This session may" lists the served rows with ✓,one ✕ line for the unserved tier under Read-only ( + NO_WRITE + ), then the-existing capped, masking and audit lines. Read-write keeps its caution. Its mode chip carries the+existing capped and audit lines. Read-write keeps its caution. Its mode chip carries thesame icon as the settings page's. One wording table serves both surfaces.Titles alone carry no caveats, and the caveats live in the row details this screen does not render —@@ -412,16 +348,28 @@ put where the annotation is typed, since that is where the reread has to happen.fact rather than a chore, and names no repo path, because proto comments ship into the published APIreference.+**D12 — MCP sessions follow the caller's own masking provisioning.** On 2026-09-23, Vincent Huang+and Peter Zhu decided to retire the "Ignore masking exemptions" toggle (`ignore_masking_exemptions`,+field 2 of `MCPSetting`) before the 3.23.0 tag. The toggle came from the MCP design work in+[#21216](https://github.com/bytebase/bytebase/pull/21216), and no customer stated a requirement for+it. The former D8 set the toggle's copy and is removed; its note on the Read-only description+sentence moved to Copy. An MCP session now applies the caller's own masking provisioning exactly as+the console does, including masking exemptions and the unmask carried by an access grant. There is+deliberately no setting that forces masking for MCP sessions. Field 2 is deleted without a+`reserved` entry, because no other field is expected to take the number. Stored rows need no+migration, because the store's unmarshaler discards the unknown key and the next save rewrites the+row without it. The masked-write guard stays, because it never depended on the toggle.+## States| State | What the section shows ||---|---|-| View · Read-only or Read-write | Chip line with Edit policy, plus the masking chip when the flag is stored (D7); the disclosure line as the description, collapsed on every visit (D1). |-| View · Disabled | Chip line, with the masking chip naming MCP as off when the flag is stored (D7); "No MCP session can connect to this workspace." No disclosure. |+| View · Read-only or Read-write | Chip line with Edit policy; the disclosure line as the description, collapsed on every visit (D1). |+| View · Disabled | Chip line; "No MCP session can connect to this workspace." No disclosure. || View · unreadable, unserved, read failed | The existing warning or error, unchanged. No disclosure. |-| Edit · Read-only or Read-write picked | Icon cards with the pick selected; the pick's "Best for" line; the disclosure for the pick, collapsed by default, rendering the post-save view, with "Show details" once expanded; masking toggle; separator; footer sentence (naming the change when dirty), Cancel, Save (enabled only when dirty). No masking chip: in edit the toggle is the flag's disclosure (D7). |-| Edit · Disabled picked | Icon cards with Disabled selected; its "Best for" line; the static soft-error line in the disclosure slot; NO masking toggle and NO masking chip (D7); separator; footer — the mode sentence, plus, once the form is saveable and the flag is set on either side of the edit, the line naming what Save writes for it — Cancel, Save. |-| Edit · nothing picked | Only reachable from an unreadable or unserved ceiling: icon cards with no selection; "Pick a mode to save this policy." in the disclosure slot; no masking toggle, no masking chip, and no pending line, because nothing can be saved yet; Cancel, Save disabled. |+| Edit · Read-only or Read-write picked | Icon cards with the pick selected; the pick's "Best for" line; the disclosure for the pick, collapsed by default, rendering the post-save view, with "Show details" once expanded; separator; footer sentence (naming the change when dirty), Cancel, Save (enabled only when dirty). |+| Edit · Disabled picked | Icon cards with Disabled selected; its "Best for" line; the static soft-error line in the disclosure slot (D7); separator; footer sentence (naming the change when dirty), Cancel, Save. |+| Edit · nothing picked | Only reachable from an unreadable or unserved ceiling: icon cards with no selection; "Pick a mode to save this policy." in the disclosure slot; Cancel, Save disabled. || Consent page | Served row titles with ✓, the ✕ line under Read-only, then the existing constants and caution. |## Copy@@ -443,6 +391,8 @@ under- "Best for" lines, unchanged: Disabled "keeping MCP off until you are ready to turn it on";Read-only "querying and exploring data, including by people who do not write SQL"; Read-write"making database changes through an AI agent, still capped by each user's own permissions".+- The Read-only description sentence ("Sessions can explore schemas and run read-only queries…")+ is retired everywhere; its content lives in the Read-only summary and in row 2's sub-item.- Row titles and sub-items: the table above, verbatim.- Dividers: "Read-only stops here", "Read-write stops here".- Floor: "Never, in any mode: approve issues, administer the workspace, handle credentials, open an Admin mode session, or read anyone else's query history."@@ -461,14 +411,6 @@ underconnection" and was false on the same axis for the opposite reason — it named the plumbing ratherthan the feature, and MCP does reach the admin data source. It names Admin mode now.- Tier badges: "read", "write".-- Masking toggle: the three sentences in D8, including the engine-coverage limit.-- Masking chip, by what the stored flag is doing: "Masking exemptions ignored",- "Masking exemptions ignored — masking not licensed",- "Masking exemptions ignored — MCP is off".-- Footer, once the form is saveable under a pick that withholds the toggle and the flag is set- before or after the edit, naming what Save writes and not when it takes effect:- "This policy will be saved with masking exemptions ignored."- and "This policy will be saved with masking exemptions applied.".- Footer, clean: "Applies to every running session's next request." Dirty: "{from} → {to} appliesto every running session's next request."- Connect a client: the sentence in D9.@@ -504,7 +446,7 @@ understrip the mode cards to icon, label and caption and add the "Best for" lineunder them;move the audit sentence to the section description; show the footer sentence only while editing- and interpolate both modes when dirty; replace the masking copy.+ and interpolate both modes when dirty.- `MCPPage.tsx`: remove the Authentication Required alert; extend the Connect a client description.- `MCPConsentCeiling.tsx`: replace the read, write and workflow lines with the row titles from thesame table.diff --git a/frontend/src/components/mcp/mcpCapabilityRows.test.ts b/frontend/src/components/mcp/mcpCapabilityRows.test.tsindex 16560f74f9..24646d60e6 100644--- a/frontend/src/components/mcp/mcpCapabilityRows.test.ts+++ b/frontend/src/components/mcp/mcpCapabilityRows.test.ts@@ -34,10 +34,10 @@ describe("mcpCapabilityRows", () => {);});- // isServingMode gates the ladder, the masking toggle and the consent routing,- // and is the one mode predicate the compiler does not force: a fourth serving- // mode breaks SERVES and MCP_MODE_PRESENTATION, but leaves this answering- // "false" and sending the session to the Disabled consent screen.+ // isServingMode gates the ladder and the consent routing, and is the one mode+ // predicate the compiler does not force: a fourth serving mode breaks SERVES+ // and MCP_MODE_PRESENTATION, but leaves this answering "false" and sending the+ // session to the Disabled consent screen.test("a mode serves a session exactly when it serves a row", () => {for (const mode of MCP_CAPABILITY_CHOICES) {expect(isServingMode(mode), String(mode)).toBe(diff --git a/frontend/src/components/mcp/mcpPolicy.test.ts b/frontend/src/components/mcp/mcpPolicy.test.tsindex e09921c1b5..e23eee6ade 100644--- a/frontend/src/components/mcp/mcpPolicy.test.ts+++ b/frontend/src/components/mcp/mcpPolicy.test.ts@@ -53,18 +53,12 @@ describe("readConsentCeiling", () => {expect(readConsentCeiling(undefined)).toEqual({ kind: "unknown" });});- test("a served ceiling carries the mode and the flag the disclosure reads", () => {+ test("a served ceiling carries the mode", () => {expect(- readConsentCeiling(- create(MCPSettingSchema, {- capability: MCPSetting_Capability.READ_WRITE,- ignoreMaskingExemptions: true,- })- )+ readConsentCeiling(settingWith(MCPSetting_Capability.READ_WRITE))).toEqual({kind: "mode",mode: MCPSetting_Capability.READ_WRITE,- ignoreMaskingExemptions: true,});});@@ -76,7 +70,6 @@ describe("readConsentCeiling", () => {).toEqual({kind: "mode",mode: MCPSetting_Capability.DISABLED,- ignoreMaskingExemptions: false,});});diff --git a/frontend/src/components/mcp/mcpPolicy.ts b/frontend/src/components/mcp/mcpPolicy.tsindex 5a00ded691..1cee9d0cb2 100644--- a/frontend/src/components/mcp/mcpPolicy.ts+++ b/frontend/src/components/mcp/mcpPolicy.ts@@ -12,9 +12,9 @@ export type MCPMode =/*** A mode that admits MCP sessions. Anything describing what a session may do —- * the capability ladder, the consent disclosure, the masking toggle — takes- * this rather than MCPMode, so "there is a session to describe" is checked by- * the compiler instead of by a comparison at each call site.+ * the capability ladder, the consent disclosure — takes this rather than+ * MCPMode, so "there is a session to describe" is checked by the compiler+ * instead of by a comparison at each call site.*/export type MCPServingMode =| MCPSetting_Capability.READ_ONLY@@ -97,11 +97,10 @@ export const mcpModeKey = (export type ConsentCeiling =/*** The disclosable policy: the mode already narrowed to one this bundle can- * name, plus the only other field the disclosure reads. The response itself- * does not travel, so no consumer can re-derive the mode from it and reach a- * different answer.+ * name. The response itself does not travel, so no consumer can re-derive the+ * mode from it and reach a different answer.*/- | { kind: "mode"; mode: MCPMode; ignoreMaskingExemptions: boolean }+ | { kind: "mode"; mode: MCPMode }/** Actuator info did not provide a policy. The policy is not known to be anything. */| { kind: "unknown" }/** A stored ceiling this build has no wording for, whatever wrote it. */@@ -124,9 +123,5 @@ export const readConsentCeiling = (if (!isMCPMode(setting.capability)) {return { kind: "undisclosable" };}- return {- kind: "mode",- mode: setting.capability,- ignoreMaskingExemptions: setting.ignoreMaskingExemptions,- };+ return { kind: "mode", mode: setting.capability };};diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 9184f552ec..3a18f974ad 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -2757,18 +2757,6 @@"description": "{{bound}} {{audit}}","edit": "Edit policy","loading": "Reading the access policy…",- "masking": {- "badge": "Masking exemptions ignored",- "badge-disabled": "Masking exemptions ignored — MCP is off",- "badge-unlicensed": "Masking exemptions ignored — masking not licensed",- "description": "If enabled, masked data stays masked in MCP sessions even for users with exemptions or unmask grants. Coverage depends on the engine: where Bytebase does not mask, this changes nothing. The console is unaffected.",- "title": "Ignore masking exemptions",- "unavailable": "Data masking is not licensed for this workspace, so nothing is masked whatever this is set to."- },- "masking-pending": {- "applied": "This policy will be saved with masking exemptions applied.",- "ignored": "This policy will be saved with masking exemptions ignored."- },"mode": {"disabled": {"best-for": "Best for: keeping MCP off until you are ready to turn it on.",diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex 6e9306a742..744246cbf4 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -2757,18 +2757,6 @@"description": "{{bound}} {{audit}}","edit": "Editar política","loading": "Leyendo la política de acceso…",- "masking": {- "badge": "Exenciones de enmascaramiento ignoradas",- "badge-disabled": "Exenciones de enmascaramiento ignoradas — MCP está desactivado",- "badge-unlicensed": "Exenciones de enmascaramiento ignoradas — enmascaramiento sin licencia",- "description": "Si se activa, los datos enmascarados siguen enmascarados en las sesiones MCP incluso para usuarios con exenciones o permisos de desenmascarado. La cobertura depende del motor: donde Bytebase no enmascara, esto no cambia nada. La consola no se ve afectada.",- "title": "Ignorar las exenciones de enmascaramiento",- "unavailable": "El enmascaramiento de datos no está licenciado para este espacio de trabajo, así que no se enmascara nada sea cual sea este ajuste."- },- "masking-pending": {- "applied": "Esta política se guardará con las exenciones de enmascaramiento aplicadas.",- "ignored": "Esta política se guardará con las exenciones de enmascaramiento ignoradas."- },"mode": {"disabled": {"best-for": "Ideal para: mantener MCP apagado hasta que esté listo para activarlo.",diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex 60073b33e5..a1ebd7fc36 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -2757,18 +2757,6 @@"description": "{{bound}}{{audit}}","edit": "ポリシーを編集","loading": "アクセスポリシーを読み込んでいます…",- "masking": {- "badge": "適用除外を無視中",- "badge-disabled": "マスキング適用除外を無視 — MCP は無効",- "badge-unlicensed": "マスキング適用除外を無視 — マスキングは未ライセンス",- "description": "有効にすると、適用除外やマスク解除の権限を持つユーザーであっても、MCP セッションではマスクされたデータがマスクされたままになります。範囲はエンジンによって異なり、Bytebase がマスクしないところでは何も変わりません。コンソールには影響しません。",- "title": "マスキングの適用除外を無視する",- "unavailable": "このワークスペースではデータマスキングのライセンスがないため、この設定にかかわらず何もマスクされません。"- },- "masking-pending": {- "applied": "このポリシーは、マスキング適用除外を有効にしたまま保存されます。",- "ignored": "このポリシーは、マスキング適用除外を無視した状態で保存されます。"- },"mode": {"disabled": {"best-for": "適する場面:有効にする準備が整うまで MCP をオフにしておきたいとき。",diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.jsonindex c389b9baba..7ee148685e 100644--- a/frontend/src/locales/vi-VN.json+++ b/frontend/src/locales/vi-VN.json@@ -2757,18 +2757,6 @@"description": "{{bound}} {{audit}}","edit": "Sửa chính sách","loading": "Đang đọc chính sách truy cập…",- "masking": {- "badge": "Đã bỏ qua miễn trừ che dữ liệu",- "badge-disabled": "Bỏ qua miễn trừ che dữ liệu — MCP đang tắt",- "badge-unlicensed": "Bỏ qua miễn trừ che dữ liệu — chưa có bản quyền che dữ liệu",- "description": "Nếu bật, dữ liệu đã che vẫn được che trong phiên MCP kể cả với người dùng có miễn trừ hoặc quyền bỏ che. Phạm vi phụ thuộc vào engine: ở nơi Bytebase không che, điều này không thay đổi gì. Console không bị ảnh hưởng.",- "title": "Bỏ qua miễn trừ che dữ liệu",- "unavailable": "Không gian làm việc này chưa có giấy phép che dữ liệu, nên sẽ không có gì bị che dù thiết lập này ra sao."- },- "masking-pending": {- "applied": "Chính sách này sẽ được lưu với các miễn trừ che dữ liệu được áp dụng.",- "ignored": "Chính sách này sẽ được lưu với các miễn trừ che dữ liệu bị bỏ qua."- },"mode": {"disabled": {"best-for": "Phù hợp khi: giữ MCP tắt cho tới khi bạn sẵn sàng bật.",diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 823110f44c..ef8d9aa14a 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -2757,18 +2757,6 @@"description": "{{bound}}{{audit}}","edit": "编辑策略","loading": "正在读取访问策略…",- "masking": {- "badge": "已忽略脱敏豁免",- "badge-disabled": "已忽略脱敏豁免 — MCP 已关闭",- "badge-unlicensed": "已忽略脱敏豁免 — 未授权脱敏功能",- "description": "启用后,即使用户拥有豁免或解除脱敏的授权,在 MCP 会话中被脱敏的数据仍保持脱敏。覆盖范围取决于引擎:Bytebase 本来就不脱敏的地方,这不会有任何改变。控制台不受影响。",- "title": "忽略脱敏豁免",- "unavailable": "本工作空间未授权数据脱敏功能,因此无论此项如何设置都不会脱敏。"- },- "masking-pending": {- "applied": "此策略将在保留脱敏豁免的状态下保存。",- "ignored": "此策略将在忽略脱敏豁免的状态下保存。"- },"mode": {"disabled": {"best-for": "适用于:在准备好开启之前先关闭 MCP。",diff --git a/frontend/src/routes/auth/MCPConsentCeiling.tsx b/frontend/src/routes/auth/MCPConsentCeiling.tsxindex 92e817219f..d525d381d0 100644--- a/frontend/src/routes/auth/MCPConsentCeiling.tsx+++ b/frontend/src/routes/auth/MCPConsentCeiling.tsx@@ -4,7 +4,6 @@ import { useTranslation } from "react-i18next";import { MCPCapabilityList } from "@/components/mcp/MCPCapabilityList";import type { MCPServingMode } from "@/components/mcp/mcpPolicy";import { Alert } from "@/components/ui/alert";-import { Badge } from "@/components/ui/badge";import { Button } from "@/components/ui/button";import { MCPSetting_Capability } from "@/types/proto-es/v1/setting_service_pb";import type { MCPConsentLine } from "./MCPConsentPolicyCard";@@ -13,8 +12,6 @@ import { MCPConsentPolicyCard } from "./MCPConsentPolicyCard";interface Props {/** The ceiling this session runs at, narrowed by the caller. */readonly mode: MCPServingMode;- readonly ignoreMaskingExemptions: boolean;- readonly dataMaskingAvailable: boolean;}/**@@ -27,11 +24,7 @@ interface Props {* richer render of a decision the backend makes either way — never the* decision itself.*/-export function MCPConsentCeiling({- mode,- ignoreMaskingExemptions,- dataMaskingAvailable,-}: Props) {+export function MCPConsentCeiling({ mode }: Props) {const { t } = useTranslation();const [details, setDetails] = useState(false);@@ -56,13 +49,6 @@ export function MCPConsentCeiling({<MCPConsentPolicyCardlabel={t("oauth2.consent.mcp.title")}mode={mode}- modeAddon={- ignoreMaskingExemptions && dataMaskingAvailable ? (- <Badge variant="secondary" className="whitespace-nowrap">- {t("settings.mcp.policy.masking.badge")}- </Badge>- ) : undefined- }headerAction={<Buttonappearance="link"diff --git a/frontend/src/routes/auth/MCPConsentPolicyCard.tsx b/frontend/src/routes/auth/MCPConsentPolicyCard.tsxindex 9b51273a6c..d987674dae 100644--- a/frontend/src/routes/auth/MCPConsentPolicyCard.tsx+++ b/frontend/src/routes/auth/MCPConsentPolicyCard.tsx@@ -13,7 +13,6 @@ interface Props {/** Omitted by the panel for a ceiling this build has no name for. */readonly mode?: MCPMode;readonly headerAction?: ReactNode;- readonly modeAddon?: ReactNode;readonly lines?: readonly MCPConsentLine[];readonly children?: ReactNode;}@@ -27,7 +26,6 @@ export function MCPConsentPolicyCard({label,mode,headerAction,- modeAddon,lines,children,}: Props) {@@ -43,7 +41,6 @@ export function MCPConsentPolicyCard({{mode !== undefined && (<div className="flex max-w-full flex-wrap items-center gap-2"><MCPModeBadge mode={mode} />- {modeAddon}</div>)}</div>diff --git a/frontend/src/routes/auth/OAuth2ConsentPage.test.tsx b/frontend/src/routes/auth/OAuth2ConsentPage.test.tsxindex 23b5f19e8d..bfa8331b84 100644--- a/frontend/src/routes/auth/OAuth2ConsentPage.test.tsx+++ b/frontend/src/routes/auth/OAuth2ConsentPage.test.tsx@@ -24,7 +24,6 @@ const mocks = vi.hoisted(() => ({workspaceList: { value: [] as { name: string; title: string }[] },loadWorkspace: vi.fn(async () => {}),loadWorkspaceList: vi.fn(async () => {}),- refreshSubscription: vi.fn(),loadServerInfo: vi.fn(),refreshServerInfo: vi.fn(),switchWorkspace: vi.fn(async () => {}),@@ -37,7 +36,6 @@ const mocks = vi.hoisted(() => ({},},fetchImpl: vi.fn(),- dataMaskingAvailable: { value: true },}));mocks.useAuthStore.mockImplementation(() => ({get isLoggedIn() {@@ -58,11 +56,9 @@ mocks.useAppStore.mockImplementation((selector: (state: unknown) => unknown) =>isLoggedIn: () => mocks.isLoggedIn.value,loadWorkspace: mocks.loadWorkspace,loadWorkspaceList: mocks.loadWorkspaceList,- refreshSubscription: mocks.refreshSubscription,loadServerInfo: mocks.loadServerInfo,refreshServerInfo: mocks.refreshServerInfo,switchWorkspace: mocks.switchWorkspace,- hasFeature: () => mocks.dataMaskingAvailable.value,}));vi.mock("@/hooks/useAppState", () => ({@@ -174,16 +170,12 @@ beforeEach(async () => {mocks.currentRoute.value.fullPath = "/oauth2/consent";globalThis.fetch = mocks.fetchImpl as typeof fetch;mocks.fetchImpl.mockReset();- mocks.dataMaskingAvailable.value = true;// Default: a served read-only ceiling, the page's ordinary case. Allow// renders only under one, so a failing default would leave every test that// is not about the ceiling asserting against the undisclosed card.- const serverInfo = {- mcpSetting: { capability: 3, ignoreMaskingExemptions: false },- };+ const serverInfo = { mcpSetting: { capability: 3 } };mocks.loadServerInfo.mockResolvedValue(serverInfo);mocks.refreshServerInfo.mockResolvedValue(serverInfo);- mocks.refreshSubscription.mockResolvedValue({});({ OAuth2ConsentPage } = await import("./OAuth2ConsentPage"));});@@ -234,7 +226,6 @@ describe("OAuth2ConsentPage", () => {render();await flushPromises();expect(mocks.fetchImpl).toHaveBeenCalledWith("/api/oauth2/clients/c1");- expect(mocks.refreshSubscription).toHaveBeenCalledOnce();expect(container.textContent).toContain("Acme");expect(container.querySelector('form[method="POST"]')).not.toBeNull();const hiddenClientId = container.querySelector<HTMLInputElement>(@@ -531,12 +522,8 @@ describe("OAuth2ConsentPage", () => {ok: true,json: async () => ({ client_name: "Acme" }),});- mocks.loadServerInfo.mockResolvedValue({- mcpSetting: { capability: 3, ignoreMaskingExemptions: false },- });- mocks.refreshServerInfo.mockResolvedValue({- mcpSetting: { capability: 4, ignoreMaskingExemptions: false },- });+ mocks.loadServerInfo.mockResolvedValue({ mcpSetting: { capability: 3 } });+ mocks.refreshServerInfo.mockResolvedValue({ mcpSetting: { capability: 4 } });const { container, render, unmount } = renderIntoContainer(<OAuth2ConsentPage />@@ -550,35 +537,6 @@ describe("OAuth2ConsentPage", () => {unmount();});- test("waits for a fresh subscription before presenting consent", async () => {- mocks.currentRoute.value.query = consentQuery();- mocks.fetchImpl.mockResolvedValue({- ok: true,- json: async () => ({ client_name: "Acme" }),- });- let resolveSubscription: (() => void) | undefined;- mocks.refreshSubscription.mockImplementation(- () =>- new Promise((resolve) => {- resolveSubscription = () => resolve({});- })- );-- const { container, render, unmount } = renderIntoContainer(- <OAuth2ConsentPage />- );- try {- render();- await flushPromises();-- expect(mocks.refreshSubscription).toHaveBeenCalledOnce();- expect(container.querySelector('form[method="POST"]')).toBeNull();- } finally {- resolveSubscription?.();- unmount();- }- });-// Codex, #21237: the !response.ok branch returned, its sibling catch did not.// The render checks loading before error, so a failed client lookup sat// behind the spinner until an optional policy request it no longer needed@@ -598,10 +556,7 @@ describe("OAuth2ConsentPage", () => {});test("a read-only ceiling starts compact and can reveal the complete MCP policy boundary", async () => {- const { container, unmount } = await renderWithCeiling({- capability: 3,- ignoreMaskingExemptions: false,- });+ const { container, unmount } = await renderWithCeiling({ capability: 3 });expect(container.textContent).toContain("settings.mcp.ladder.row.read-schemas.title");expect(container.textContent).not.toContain("settings.mcp.ladder.row.read-schemas.details"@@ -615,10 +570,6 @@ describe("OAuth2ConsentPage", () => {expect(container.textContent).toContain("settings.mcp.ladder.stops.read");expect(container.textContent).toContain("settings.mcp.ladder.floor.text");expect(container.textContent).not.toContain("oauth2.consent.mcp.line.no-write");- // The masking line is the toggle's, not the ceiling's.- expect(container.textContent).not.toContain(- "oauth2.consent.mcp.line.masking"- );expect(container.textContent).toContain("settings.mcp.ladder.show-details");expect(container.textContent).toContain("oauth2.consent.allow-access");@@ -659,10 +610,7 @@ describe("OAuth2ConsentPage", () => {});test("uses the broad responsive consent-card width", async () => {- const { container, unmount } = await renderWithCeiling({- capability: 3,- ignoreMaskingExemptions: false,- });+ const { container, unmount } = await renderWithCeiling({ capability: 3 });expect(container.firstElementChild).toHaveClass("w-full",@@ -676,10 +624,7 @@ describe("OAuth2ConsentPage", () => {});test("each ceiling states the shared policy bound", async () => {- const readOnly = await renderWithCeiling({- capability: 3,- ignoreMaskingExemptions: false,- });+ const readOnly = await renderWithCeiling({ capability: 3 });expect(readOnly.container.textContent).toContain("settings.mcp.policy.bound");@@ -688,10 +633,7 @@ describe("OAuth2ConsentPage", () => {);readOnly.unmount();- const readWrite = await renderWithCeiling({- capability: 4,- ignoreMaskingExemptions: false,- });+ const readWrite = await renderWithCeiling({ capability: 4 });expect(readWrite.container.textContent).toContain("settings.mcp.policy.bound");@@ -702,34 +644,9 @@ describe("OAuth2ConsentPage", () => {});test("a read-write ceiling adds the write line and the caution", async () => {- const { container, unmount } = await renderWithCeiling({- capability: 4,- ignoreMaskingExemptions: true,- });+ const { container, unmount } = await renderWithCeiling({ capability: 4 });expect(container.textContent).toContain("settings.mcp.ladder.row.run-statements.title");expect(container.textContent).toContain("oauth2.consent.mcp.write-caution");- expect(container.textContent).toContain("settings.mcp.policy.masking.badge");- expect(container.textContent).not.toContain(- "oauth2.consent.mcp.line.masking"- );- unmount();- });-- // The masking badge promises a restriction. The toggle withholds unmasking- // exemptions from MCP sessions, which restricts nothing on a workspace where- // masking does not run — and this card is read at the moment someone decides- // whether to hand over access.- test("the masking badge is not promised where masking does not run", async () => {- mocks.dataMaskingAvailable.value = false;- const { container, unmount } = await renderWithCeiling({- capability: 4,- ignoreMaskingExemptions: true,- });- // The rest of the card is unchanged, so this is the badge and not the card.- expect(container.textContent).toContain("settings.mcp.ladder.row.run-statements.title");- expect(container.textContent).not.toContain(- "settings.mcp.policy.masking.badge"- );unmount();});@@ -738,10 +655,7 @@ describe("OAuth2ConsentPage", () => {// access_denied to the registered redirect_uri, which is the answer it is// blocked on.test("dismissing a disabled ceiling denies the request instead of going back", async () => {- const { container, unmount } = await renderWithCeiling({- capability: 1,- ignoreMaskingExemptions: false,- });+ const { container, unmount } = await renderWithCeiling({ capability: 1 });const submitted: HTMLFormElement[] = [];const realSubmit = HTMLFormElement.prototype.submit;@@ -767,19 +681,13 @@ describe("OAuth2ConsentPage", () => {// Codex, #21237: a SaaS user whose current workspace has MCP off could not// switch to one that permits it without abandoning the OAuth flow.test("the disabled screen keeps the workspace switcher", async () => {- const { container, unmount } = await renderWithCeiling({- capability: 1,- ignoreMaskingExemptions: false,- });+ const { container, unmount } = await renderWithCeiling({ capability: 1 });expect(container.textContent).toContain("oauth2.consent.workspace-label");unmount();});test("a disabled ceiling offers nothing to approve", async () => {- const { container, unmount } = await renderWithCeiling({- capability: 1,- ignoreMaskingExemptions: false,- });+ const { container, unmount } = await renderWithCeiling({ capability: 1 });expect(container.textContent).toContain("oauth2.consent.mcp.disabled.title");expect(container.textContent).toContain("oauth2.consent.mcp.disabled.ask-admin"@@ -845,10 +753,7 @@ describe("OAuth2ConsentPage", () => {["a tier a newer release wrote", 5],["a value nothing could resolve", 0],])("%s offers no grant and no retry", async (_name, capability) => {- const { container, unmount } = await renderWithCeiling({- capability,- ignoreMaskingExemptions: false,- });+ const { container, unmount } = await renderWithCeiling({ capability });expect(container.textContent).not.toContain("oauth2.consent.allow-access");expect(container.querySelector('form[method="POST"]')).toBeNull();expect(container.textContent).toContain(@@ -867,10 +772,7 @@ describe("OAuth2ConsentPage", () => {// waiting on a callback that never comes, and these states are the ones where// the person has nothing else to do here.test("dismissing an undisclosed policy denies the request", async () => {- const { container, unmount } = await renderWithCeiling({- capability: 0,- ignoreMaskingExemptions: false,- });+ const { container, unmount } = await renderWithCeiling({ capability: 0 });const submitted: HTMLFormElement[] = [];const realSubmit = HTMLFormElement.prototype.submit;diff --git a/frontend/src/routes/auth/OAuth2ConsentPage.tsx b/frontend/src/routes/auth/OAuth2ConsentPage.tsxindex a5aed664d3..a9259dfa67 100644--- a/frontend/src/routes/auth/OAuth2ConsentPage.tsx+++ b/frontend/src/routes/auth/OAuth2ConsentPage.tsx@@ -17,7 +17,6 @@ import {import { useWorkspace } from "@/hooks/useAppState";import { useAppStore } from "@/stores/app";import type { MCPSetting } from "@/types/proto-es/v1/setting_service_pb";-import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";import { MCPConsentCeiling } from "./MCPConsentCeiling";import { MCPConsentDisabled } from "./MCPConsentDisabled";import type { UndisclosedReason } from "./MCPConsentUndisclosed";@@ -40,15 +39,12 @@ export function OAuth2ConsentPage() {const [mcpSetting, setMcpSetting] = useState<MCPSetting | undefined>(undefined);- const [dataMaskingAvailable, setDataMaskingAvailable] = useState(false);const [retrying, setRetrying] = useState(false);const loadWorkspace = useAppStore((state) => state.loadWorkspace);const loadWorkspaceList = useAppStore((state) => state.loadWorkspaceList);- const refreshSubscription = useAppStore((state) => state.refreshSubscription);const refreshServerInfo = useAppStore((state) => state.refreshServerInfo);const switchWorkspace = useAppStore((state) => state.switchWorkspace);- const hasFeature = useAppStore((state) => state.hasFeature);const isLoggedIn = useAppStore((s) => s.isLoggedIn());// Workspace context shown on the consent card. On SaaS, every Bytebase@@ -88,24 +84,9 @@ export function OAuth2ConsentPage() {}}, [refreshServerInfo]);- const readConsentDisclosure = useCallback(async () => {- const [mcpSetting, subscription] = await Promise.all([- readCeiling(),- refreshSubscription(),- ]);- return {- mcpSetting,- dataMaskingAvailable:- subscription !== undefined &&- hasFeature(PlanFeature.FEATURE_DATA_MASKING),- };- }, [hasFeature, readCeiling, refreshSubscription]);-const retryCeiling = async () => {setRetrying(true);- const disclosure = await readConsentDisclosure();- setMcpSetting(disclosure.mcpSetting);- setDataMaskingAvailable(disclosure.dataMaskingAvailable);+ setMcpSetting(await readCeiling());setRetrying(false);};@@ -152,12 +133,10 @@ export function OAuth2ConsentPage() {setLoading(false);return;}- const disclosure = await readConsentDisclosure();- setMcpSetting(disclosure.mcpSetting);- setDataMaskingAvailable(disclosure.dataMaskingAvailable);+ setMcpSetting(await readCeiling());setLoading(false);})();- }, [readConsentDisclosure]);+ }, [readCeiling]);// Prefetch workspace list on SaaS so the picker can render. This runs in// its own effect keyed on `isSaaSMode` because actuator's serverInfo may@@ -342,11 +321,7 @@ export function OAuth2ConsentPage() {</p></div>{workspaceCard}- <MCPConsentCeiling- mode={ceiling.mode}- ignoreMaskingExemptions={ceiling.ignoreMaskingExemptions}- dataMaskingAvailable={dataMaskingAvailable}- />+ <MCPConsentCeiling mode={ceiling.mode} /><form method="POST" action={AUTHORIZE_URL}><Input type="hidden" name="client_id" value={clientId} /><Input type="hidden" name="redirect_uri" value={redirectUri} />diff --git a/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.test.tsx b/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.test.tsxindex a4ac10ed2c..9331b3ca5e 100644--- a/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.test.tsx+++ b/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.test.tsx@@ -15,13 +15,9 @@ const mocks = vi.hoisted(() => ({refreshServerInfo: vi.fn(),serverInfo: {value: {- mcpSetting: {- capability: 3,- ignoreMaskingExemptions: false,- },- } as { mcpSetting?: { capability: MCPSetting_Capability; ignoreMaskingExemptions: boolean } } | undefined,+ mcpSetting: { capability: 3 },+ } as { mcpSetting?: { capability: MCPSetting_Capability } } | undefined,},- dataMaskingAvailable: { value: true },permissionDisabled: { value: false },permissionGuard: vi.fn(),pushNotification: vi.fn(),@@ -51,7 +47,6 @@ vi.mock("@/stores/app", () => {upsertSetting: mocks.upsertSetting,loadServerInfo: mocks.loadServerInfo,refreshServerInfo: mocks.refreshServerInfo,- hasFeature: () => mocks.dataMaskingAvailable.value,get serverInfo() {return mocks.serverInfo.value;},@@ -88,25 +83,12 @@ const flush = () =>await Promise.resolve();});-const storePolicy = (- capability: MCPSetting_Capability,- ignoreMaskingExemptions = false-) => {- mocks.serverInfo.value = { mcpSetting: { capability, ignoreMaskingExemptions } };+const storePolicy = (capability: MCPSetting_Capability) => {+ mocks.serverInfo.value = { mcpSetting: { capability } };mocks.loadServerInfo.mockResolvedValue(mocks.serverInfo.value);mocks.refreshServerInfo.mockResolvedValue(mocks.serverInfo.value);};-const maskingBadgeText = (container: HTMLElement) =>- [...container.querySelectorAll("span")].find((node) =>- node.textContent?.startsWith("settings.mcp.policy.masking.badge")- )?.textContent;--const maskingSwitch = (container: HTMLElement) =>- container.querySelector(- '[aria-label="settings.mcp.policy.masking.title"]'- ) as HTMLElement | null;-const clickText = (container: HTMLElement, text: string) => {const el = [...container.querySelectorAll("button, label")].find((n) =>n.textContent?.includes(text)@@ -134,7 +116,6 @@ const selectCapability = (container: HTMLElement, value: number) => {beforeEach(async () => {vi.clearAllMocks();mocks.permissionDisabled.value = false;- mocks.dataMaskingAvailable.value = true;storePolicy(MCPSetting_Capability.READ_ONLY);mocks.upsertSetting.mockResolvedValue(undefined);({ MCPAccessPolicySection } = await import("./MCPAccessPolicySection"));@@ -240,6 +221,7 @@ describe("MCPAccessPolicySection", () => {expect(container.textContent).toContain("settings.mcp.policy.unreadable.pick");+ expect(mocks.useUnsavedChangesGuard).toHaveBeenLastCalledWith(false);selectCapability(container, MCPSetting_Capability.READ_WRITE);await flush();@@ -279,23 +261,6 @@ describe("MCPAccessPolicySection", () => {unmount();});- test("says masking is unlicensed", async () => {- mocks.dataMaskingAvailable.value = false;-- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- clickText(container, "settings.mcp.policy.edit");- await flush();-- expect(container.textContent).toContain(- "settings.mcp.policy.masking.unavailable"- );- unmount();- });-test("the Best for line is shown once and follows the selection", async () => {const { container, render, unmount } = renderIntoContainer(<MCPAccessPolicySection />@@ -327,42 +292,6 @@ describe("MCPAccessPolicySection", () => {unmount();});- test("keeps the masking switch intrinsic", async () => {- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- clickText(container, "settings.mcp.policy.edit");- await flush();-- expect(maskingSwitch(container)?.classList.contains("shrink-0")).toBe(- true- );- unmount();- });-- test("keeps the masking switch aligned with its title", async () => {- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- clickText(container, "settings.mcp.policy.edit");- await flush();-- const title = [...container.querySelectorAll("div")].find(- (node) =>- node.classList.contains("text-base") &&- node.classList.contains("font-semibold") &&- node.classList.contains("text-main") &&- node.textContent === "settings.mcp.policy.masking.title"- );- expect(title).toBeDefined();- expect(maskingSwitch(container)?.parentElement).toBe(title?.parentElement);- unmount();- });-test("the policy inputs are locked while a save is in flight", async () => {const inFlight = Promise.withResolvers<undefined>();mocks.upsertSetting.mockReturnValue(inFlight.promise);@@ -375,22 +304,14 @@ describe("MCPAccessPolicySection", () => {clickText(container, "settings.mcp.policy.edit");await flush();- // A SERVING mode, so the masking switch is on screen and inside the set- // this asserts on. Picking Disabled here would withhold it (D7) and the- // test would silently stop covering `disabled={saving}` on the Switch.clickText(container, "settings.mcp.policy.mode.read-write.title");await flush();- // The Switch renders a span plus a hidden checkbox, and the checkbox is- // what carries `disabled`, so the masking control is in this set only while- // a serving mode is picked: three radios and that one checkbox.const controls = () =>[- ...container.querySelectorAll(- 'input[type="radio"], input[type="checkbox"]'- ),+ ...container.querySelectorAll('input[type="radio"]'),] as HTMLInputElement[];- expect(controls()).toHaveLength(4);+ expect(controls()).toHaveLength(3);expect(controls().every((c) => !c.disabled)).toBe(true);clickText(container, "settings.mcp.policy.save");@@ -502,64 +423,6 @@ describe("MCPAccessPolicySection", () => {unmount();});- // The toggle governs what an MCP session may unmask, and Disabled admits- // none, so offering it there would put a live control under a red line- // saying no session can connect.- test("the masking toggle is withheld while Disabled is picked", async () => {- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- clickText(container, "settings.mcp.policy.edit");- await flush();- expect(container.textContent).toContain("settings.mcp.policy.masking.title");-- clickText(container, "settings.mcp.policy.mode.disabled.title");- await flush();- expect(maskingSwitch(container)).toBeNull();-- // Picking a serving mode again brings the control back.- clickText(container, "settings.mcp.policy.mode.read-write.title");- await flush();- expect(maskingSwitch(container)).not.toBeNull();- unmount();- });-- // The flag is inert under Disabled but still stored, so an explicit choice is- // kept for when MCP is turned back on rather than quietly rolled back — and- // the footer says so, since the control that made it is off screen.- test("saving Disabled still carries a masking edit the admin made", async () => {- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- clickText(container, "settings.mcp.policy.edit");- await flush();-- act(() => maskingSwitch(container)?.click());- await flush();-- clickText(container, "settings.mcp.policy.mode.disabled.title");- await flush();- expect(container.textContent).toContain(- "settings.mcp.policy.masking-pending.ignored"- );-- clickText(container, "settings.mcp.policy.save");- await flush();-- const request = mocks.upsertSetting.mock.calls.at(-1)?.[0];- expect(request.updateMask.paths).toEqual([- "value.mcp.capability",- "value.mcp.ignore_masking_exemptions",- ]);- expect(request.value.value.value.ignoreMaskingExemptions).toBe(true);- unmount();- });-- // Picking back to the stored mode with no other edit leaves nothing to write.test("returning to the stored mode with no edit cannot save", async () => {storePolicy(MCPSetting_Capability.DISABLED);const { container, render, unmount } = renderIntoContainer(@@ -584,146 +447,6 @@ describe("MCPAccessPolicySection", () => {unmount();});- test("a masking change reaches the update mask", async () => {- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- clickText(container, "settings.mcp.policy.edit");- await flush();-- act(() => maskingSwitch(container)?.click());- await flush();- expect(mocks.useUnsavedChangesGuard).toHaveBeenLastCalledWith(true);-- clickText(container, "settings.mcp.policy.save");- await flush();-- const request = mocks.upsertSetting.mock.calls.at(-1)?.[0];- expect(request.updateMask.paths).toEqual([- "value.mcp.ignore_masking_exemptions",- ]);- expect(request.value.value.value.ignoreMaskingExemptions).toBe(true);- unmount();- });-- // Clicking through the modes to read their descriptions must not undo an- // unrelated edit. Withholding the control where it governs nothing is not a- // reason to discard what the admin set with it.- test("the masking draft survives a detour through Disabled", async () => {- storePolicy(MCPSetting_Capability.READ_WRITE, true);- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- clickText(container, "settings.mcp.policy.edit");- await flush();-- act(() => maskingSwitch(container)?.click());- await flush();- expect(mocks.useUnsavedChangesGuard).toHaveBeenLastCalledWith(true);-- clickText(container, "settings.mcp.policy.mode.disabled.title");- await flush();- // The control is withheld — it governs nothing under Disabled — but the- // draft behind it is still the admin's, and the footer names the value Save- // will write rather than the one that is stored.- expect(maskingSwitch(container)).toBeNull();- expect(container.textContent).toContain(- "settings.mcp.policy.masking-pending.applied"- );- expect(container.textContent).not.toContain(- "settings.mcp.policy.masking-pending.ignored"- );- expect(maskingBadgeText(container)).toBeUndefined();-- clickText(container, "settings.mcp.policy.mode.read-write.title");- await flush();- expect(maskingSwitch(container)?.getAttribute("aria-checked")).toBe("false");-- clickText(container, "settings.mcp.policy.save");- await flush();- const request = mocks.upsertSetting.mock.calls.at(-1)?.[0];- expect(request.updateMask.paths).toEqual([- "value.mcp.ignore_masking_exemptions",- ]);- expect(request.value.value.value.ignoreMaskingExemptions).toBe(false);- unmount();- });-- // An admin who cannot see the control cannot see the value either, so the- // disclosure follows the value being saved rather than the edit that set it.- test("a stored flag nobody touched is still named under a pick that hides it", async () => {- storePolicy(MCPSetting_Capability.READ_ONLY, true);- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- clickText(container, "settings.mcp.policy.edit");- await flush();-- clickText(container, "settings.mcp.policy.mode.disabled.title");- await flush();- expect(container.textContent).toContain(- "settings.mcp.policy.masking-pending.ignored"- );-- clickText(container, "settings.mcp.policy.save");- await flush();- const request = mocks.upsertSetting.mock.calls.at(-1)?.[0];- expect(request.value.value.value.ignoreMaskingExemptions).toBe(true);- unmount();- });-- // The chip is the stored flag's disclosure and the toggle is the draft's.- // Rendering the chip in the editor asserted a live restriction under a pick- // that admits no session, and read the stored pair while Save wrote the- // draft.- test("the masking chip belongs to the view, never to the editor", async () => {- storePolicy(MCPSetting_Capability.READ_ONLY, true);- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- expect(maskingBadgeText(container)).toBe("settings.mcp.policy.masking.badge");-- clickText(container, "settings.mcp.policy.edit");- await flush();- expect(maskingBadgeText(container)).toBeUndefined();-- clickText(container, "settings.mcp.policy.mode.disabled.title");- await flush();- expect(maskingBadgeText(container)).toBeUndefined();- unmount();- });-- // "MCP is off" is a claim about a mode somebody chose. A ceiling this build- // cannot parse is failing closed instead, which has a different remedy.- test("an unreadable ceiling is never reported as MCP being off", async () => {- storePolicy(MCPSetting_Capability.CAPABILITY_UNSPECIFIED, true);- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- expect(maskingBadgeText(container)).toBeUndefined();-- clickText(container, "settings.mcp.policy.edit");- await flush();- expect(maskingBadgeText(container)).toBeUndefined();- expect(container.textContent).toContain("settings.mcp.policy.unreadable.pick");- // "Pick a mode to save this policy" and "this policy will be saved" cannot- // both hold. Nothing is pending until a mode is picked.- expect(container.textContent).not.toContain(- "settings.mcp.policy.masking-pending"- );- unmount();- });-// The write landed but the card can no longer read it back. Closing the// editor would present the pre-save policy as current, so the editor stays// open with the pick intact and saving again is the same write.@@ -774,10 +497,8 @@ describe("MCPAccessPolicySection", () => {unmount();});- // Opening the editor is not an edit. A form that cannot be saved has no save- // to describe, and the view's chip is where the stored flag is reported.test("a pristine editor promises no save", async () => {- storePolicy(MCPSetting_Capability.DISABLED, true);+ storePolicy(MCPSetting_Capability.DISABLED);const { container, render, unmount } = renderIntoContainer(<MCPAccessPolicySection />);@@ -786,9 +507,6 @@ describe("MCPAccessPolicySection", () => {clickText(container, "settings.mcp.policy.edit");await flush();- expect(container.textContent).not.toContain(- "settings.mcp.policy.masking-pending"- );expect([...container.querySelectorAll("button")].find((button) =>button.textContent?.includes("settings.mcp.policy.save")@@ -797,101 +515,6 @@ describe("MCPAccessPolicySection", () => {unmount();});- // The footer says what will be written, never when it takes effect — so it- // does not vary with a masking license the way the view's chip does.- test("the pending line reads the same on an unlicensed workspace", async () => {- mocks.dataMaskingAvailable.value = false;- storePolicy(MCPSetting_Capability.READ_ONLY, true);- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- expect(maskingBadgeText(container)).toBe(- "settings.mcp.policy.masking.badge-unlicensed"- );-- clickText(container, "settings.mcp.policy.edit");- await flush();- clickText(container, "settings.mcp.policy.mode.disabled.title");- await flush();- expect(container.textContent).toContain(- "settings.mcp.policy.masking-pending.ignored"- );- unmount();- });-- // With no mode picked, nothing is known to serve, so the control that- // configures a session has nothing to configure.- test("the masking toggle is withheld when no mode is picked", async () => {- storePolicy(MCPSetting_Capability.CAPABILITY_UNSPECIFIED);- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- clickText(container, "settings.mcp.policy.edit");- await flush();-- expect(container.textContent).toContain(- "settings.mcp.policy.unreadable.pick"- );- expect(- maskingSwitch(container)- ).toBeNull();- expect(mocks.useUnsavedChangesGuard).toHaveBeenLastCalledWith(false);- unmount();- });-- test("the masking badge reports a stored restriction", async () => {- storePolicy(MCPSetting_Capability.READ_ONLY, true);- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- // Exact, not substring: the plain key is a prefix of both suffixed ones, so- // `toContain` would pass for every state including the two that report the- // flag as inert.- expect(maskingBadgeText(container)).toBe("settings.mcp.policy.masking.badge");- unmount();- });-- // Still shown without a license — hiding it would leave a stored flag with- // nowhere to see it — but it must not assert a restriction nothing applies.- // The editor's "not licensed" note is a different branch, behind- // bb.settings.set, which a reader of this page may never reach.- test("the masking badge says so when masking is unlicensed", async () => {- mocks.dataMaskingAvailable.value = false;- storePolicy(MCPSetting_Capability.READ_ONLY, true);- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();- expect(maskingBadgeText(container)).toBe(- "settings.mcp.policy.masking.badge-unlicensed"- );- unmount();- });-- // Storable under Disabled, so it needs a view there rather than a hole: the- // badge says the flag is set and that MCP is off, instead of asserting a- // restriction on sessions that cannot exist.- test("the masking badge says MCP is off on a disabled policy", async () => {- storePolicy(MCPSetting_Capability.DISABLED, true);- const { container, render, unmount } = renderIntoContainer(- <MCPAccessPolicySection />- );- render();- await flush();-- expect(maskingBadgeText(container)).toBe(- "settings.mcp.policy.masking.badge-disabled"- );- unmount();- });-// The tightening note is about a change being made, not about the current// state, so it belongs to the editor; the audit fact moved to the section// description and must not come back as a second line under the chip.diff --git a/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.tsx b/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.tsxindex 05bfcf93b0..786f083164 100644--- a/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.tsx+++ b/frontend/src/routes/workspace/mcp/MCPAccessPolicySection.tsx@@ -13,11 +13,9 @@ import {} from "@/components/mcp/mcpPolicy";import { PermissionGuard } from "@/components/PermissionGuard";import { Alert } from "@/components/ui/alert";-import { Badge } from "@/components/ui/badge";import { Button } from "@/components/ui/button";import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";import { Separator } from "@/components/ui/separator";-import { Switch } from "@/components/ui/switch";import { useUnsavedChangesGuard } from "@/hooks/useUnsavedChangesGuard";import { cn } from "@/lib/utils";import { pushNotification } from "@/stores";@@ -28,7 +26,6 @@ import {Setting_SettingName,SettingValueSchema,} from "@/types/proto-es/v1/setting_service_pb";-import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";import { MCPCapabilityLadder } from "./MCPCapabilityLadder";export function MCPAccessPolicySection() {@@ -37,7 +34,6 @@ export function MCPAccessPolicySection() {const [editing, setEditing] = useState(false);const [saving, setSaving] = useState(false);const [pick, setPick] = useState<MCPMode | undefined>(undefined);- const [ignoreMasking, setIgnoreMasking] = useState(false);const [readSettled, setReadSettled] = useState(false);// Held here rather than in the ladder so the open state carries from the view// into the editor, which renders the ladder in a different place.@@ -46,9 +42,6 @@ export function MCPAccessPolicySection() {const serverInfo = useAppStore((state) => state.serverInfo);const loadServerInfo = useAppStore((state) => state.loadServerInfo);const refreshServerInfo = useAppStore((state) => state.refreshServerInfo);- const dataMaskingAvailable = useAppStore((state) =>- state.hasFeature(PlanFeature.FEATURE_DATA_MASKING)- );useEffect(() => {void loadServerInfo().then(() => setReadSettled(true));@@ -61,28 +54,19 @@ export function MCPAccessPolicySection() {: undefined;const unreadable =storedCapability === MCPSetting_Capability.CAPABILITY_UNSPECIFIED;- const storedIgnoreMasking =- serverInfo?.mcpSetting?.ignoreMaskingExemptions ?? false;// The form is seeded when editing opens, not on every store change: the// stored value only moves under an open form when someone else saved, and// replacing an admin's unsaved pick is worse than showing it stale.const startEditing = () => {setPick(storedMode);- setIgnoreMasking(storedIgnoreMasking);setEditing(true);};- // Only a serving mode admits a session for the masking flag to govern, so the- // toggle is withheld elsewhere — but the draft behind it is kept and saved- // whatever the pick, because withholding a control is not a reason to discard- // what the admin set with it.- const maskingApplies = isServingMode(pick);- const maskingChanged = ignoreMasking !== storedIgnoreMasking;- const isDirty = editing && (pick !== storedMode || maskingChanged);+ const isDirty = editing && pick !== storedMode;useUnsavedChangesGuard(isDirty);- // A row nobody can read is repaired by naming a capability. Saving anything- // else would erase it, and the server refuses that write.+ // A row nobody can read is repaired only by naming a capability, so Save+ // waits for a pick.const canSave = isDirty && pick !== undefined;const modeLabel = (capability: MCPMode): string =>@@ -92,13 +76,6 @@ export function MCPAccessPolicySection() {if (pick === undefined) {return;}- const paths: string[] = [];- if (pick !== storedMode) {- paths.push("value.mcp.capability");- }- if (maskingChanged) {- paths.push("value.mcp.ignore_masking_exemptions");- }setSaving(true);try {await useAppStore.getState().upsertSetting({@@ -106,13 +83,12 @@ export function MCPAccessPolicySection() {value: create(SettingValueSchema, {value: {case: "mcp",- value: create(MCPSettingSchema, {- capability: pick,- ignoreMaskingExemptions: ignoreMasking,- }),+ value: create(MCPSettingSchema, { capability: pick }),},}),- updateMask: create(FieldMaskSchema, { paths }),+ updateMask: create(FieldMaskSchema, {+ paths: ["value.mcp.capability"],+ }),});// Re-read before leaving the editor. refreshServerInfo throws without// clearing what it holds, so closing first would present the pre-save@@ -168,36 +144,6 @@ export function MCPAccessPolicySection() {}): t("settings.mcp.policy.tightening");- // Where the pick withholds the toggle and the form can still be saved, the- // footer is the flag's only disclosure. It names the value Save writes- // whenever that value will be set, not only when this edit changed it — and- // says nothing about when the value takes effect, which depends on a masking- // license this line cannot see.- const maskingPending =- canSave && !maskingApplies && (ignoreMasking || storedIgnoreMasking)- ? ignoreMasking- ? t("settings.mcp.policy.masking-pending.ignored")- : t("settings.mcp.policy.masking-pending.applied")- : undefined;-- // What the stored flag is doing, for the view that reports it. Takes the mode- // rather than reading `storedMode`, so the branch that already proved there is- // a stored mode passes the proof in instead of re-testing for it.- const maskingBadgeFor = (mode: MCPMode) =>- mode === MCPSetting_Capability.DISABLED ? (- <Badge variant="default">- {t("settings.mcp.policy.masking.badge-disabled")}- </Badge>- ) : dataMaskingAvailable ? (- <Badge variant="secondary">- {t("settings.mcp.policy.masking.badge")}- </Badge>- ) : (- <Badge variant="default">- {t("settings.mcp.policy.masking.badge-unlicensed")}- </Badge>- );-// Three states share this slot and only the last renders a policy. Early// returns rather than a ternary chain, so each state is named where it is// decided and the card reads as the ordinary case it is.@@ -232,15 +178,12 @@ export function MCPAccessPolicySection() {)}</span>) : (- <div className="flex flex-wrap items-center gap-2">- <MCPModeBadge- mode={storedMode}- describedAs={t("settings.mcp.policy.current", {- mode: modeLabel(storedMode),- })}- />- {storedIgnoreMasking && maskingBadgeFor(storedMode)}- </div>+ <MCPModeBadge+ mode={storedMode}+ describedAs={t("settings.mcp.policy.current", {+ mode: modeLabel(storedMode),+ })}+ />)}<PermissionGuard permissions={["bb.settings.set"]}>{({ disabled }) => (@@ -348,43 +291,9 @@ export function MCPAccessPolicySection() {</>)}- {maskingApplies && (- <>- <Separator />-- <div className="flex flex-col gap-1">- <div className="flex items-center gap-x-2">- <Switch- checked={ignoreMasking}- onCheckedChange={setIgnoreMasking}- disabled={saving}- aria-label={t("settings.mcp.policy.masking.title")}- className="shrink-0"- />- <div className="text-base font-semibold text-main">- {t("settings.mcp.policy.masking.title")}- </div>- </div>- <div className="textinfolabel">- {t("settings.mcp.policy.masking.description")}- </div>- {!dataMaskingAvailable && (- <div className="text-sm text-warning">- {t("settings.mcp.policy.masking.unavailable")}- </div>- )}- </div>- </>- )}-<Separator /><div className="flex flex-wrap items-center justify-between gap-4">- <div className="flex flex-col gap-1">- <p className="textinfolabel">{footerSentence}</p>- {maskingPending && (- <p className="textinfolabel">{maskingPending}</p>- )}- </div>+ <p className="textinfolabel">{footerSentence}</p><div className="flex shrink-0 gap-x-2"><Buttonappearance="outline"diff --git a/frontend/src/types/proto-es/v1/setting_service_pb.d.ts b/frontend/src/types/proto-es/v1/setting_service_pb.d.tsindex dd756893e6..747068a32f 100644--- a/frontend/src/types/proto-es/v1/setting_service_pb.d.ts+++ b/frontend/src/types/proto-es/v1/setting_service_pb.d.ts@@ -763,22 +763,6 @@ export declare type MCPSetting = Message<"bytebase.v1.MCPSetting"> & {* @generated from field: bytebase.v1.MCPSetting.Capability capability = 1;*/capability: MCPSetting_Capability;-- /**- * Whether a request that arrived over MCP stops applying the caller's own- * unmasking provisioning. Two mechanisms let a user see a real value and this- * suppresses both: the masking exemptions granted to them, and the unmask- * carried by an access grant. The same user in the console is untouched.- *- * It cannot force masking where there is none. Masking substitutes values in- * query results, so this does not reach data copied into a column carrying no- * masking policy, and it does nothing on the engines Bytebase does not mask.- * It narrows what an agent reads through the paths Bytebase masks; it is not- * a confidentiality boundary.- *- * @generated from field: bool ignore_masking_exemptions = 2;- */- ignoreMaskingExemptions: boolean;};/**@@ -789,8 +773,8 @@ export declare const MCPSettingSchema: GenMessage<MCPSetting>;/*** Capability is the ceiling: a session runs at this level or lower.- * Writing CAPABILITY_UNSPECIFIED explicitly is rejected; omit the update mask- * path to leave the current ceiling unchanged.+ * Writing CAPABILITY_UNSPECIFIED, explicitly or by leaving+ * value.mcp.capability out of the update mask, is rejected.** @generated from enum bytebase.v1.MCPSetting.Capability*/diff --git a/frontend/src/types/proto-es/v1/setting_service_pb.js b/frontend/src/types/proto-es/v1/setting_service_pb.jsindex 99e6133967..edcbb8f29b 100644--- a/frontend/src/types/proto-es/v1/setting_service_pb.js+++ b/frontend/src/types/proto-es/v1/setting_service_pb.js@@ -18,7 +18,7 @@ import { file_v1_issue_service } from "./issue_service_pb";* Describes the file v1/setting_service.proto.*/export const file_v1_setting_service = /*@__PURE__*/- fileDesc("Chh2MS9zZXR0aW5nX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIhUKE0xpc3RTZXR0aW5nc1JlcXVlc3QiPgoUTGlzdFNldHRpbmdzUmVzcG9uc2USJgoIc2V0dGluZ3MYASADKAsyFC5ieXRlYmFzZS52MS5TZXR0aW5nIj8KEUdldFNldHRpbmdSZXF1ZXN0EioKBG5hbWUYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1NldHRpbmciOwoSR2V0U2V0dGluZ1Jlc3BvbnNlEiUKB3NldHRpbmcYASABKAsyFC5ieXRlYmFzZS52MS5TZXR0aW5nIqEBChRVcGRhdGVTZXR0aW5nUmVxdWVzdBIqCgdzZXR0aW5nGAEgASgLMhQuYnl0ZWJhc2UudjEuU2V0dGluZ0ID4EECEhUKDXZhbGlkYXRlX29ubHkYAiABKAgSFQoNYWxsb3dfbWlzc2luZxgDIAEoCBIvCgt1cGRhdGVfbWFzaxgEIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE1hc2sivQIKB1NldHRpbmcSEQoEbmFtZRgBIAEoCUID4EEIEi0KBXZhbHVlGAIgASgLMhkuYnl0ZWJhc2UudjEuU2V0dGluZ1ZhbHVlQgPgQQIiwAEKC1NldHRpbmdOYW1lEhwKGFNFVFRJTkdfTkFNRV9VTlNQRUNJRklFRBAAEhUKEVdPUktTUEFDRV9QUk9GSUxFEAESFgoSV09SS1NQQUNFX0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V0dGluZy5uYW1lPXNldHRpbmdzLyp9ErgBChBUZXN0RW1haWxTZXR0aW5nEiQuYnl0ZWJhc2UudjEuVGVzdEVtYWlsU2V0dGluZ1JlcXVlc3QaJS5ieXRlYmFzZS52MS5UZXN0RW1haWxTZXR0aW5nUmVzcG9uc2UiV4rqMA9iYi5zZXR0aW5ncy5zZXSQ6jABoOowA6jqMAaC0+STAjI6ASoiLS92MS97cGFyZW50PXdvcmtzcGFjZXMvKn0vc2V0dGluZ3MvRU1BSUw6dGVzdEKpAQoPY29tLmJ5dGViYXNlLnYxQhNTZXR0aW5nU2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vYnl0ZWJhc2UvYnl0ZWJhc2UvYmFja2VuZC9nZW5lcmF0ZWQtZ28vdjGiAgNCWFiqAgtCeXRlYmFzZS5WMcoCC0J5dGViYXNlXFYx4gIXQnl0ZWJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_duration, file_google_protobuf_field_mask, file_google_type_color, file_google_type_expr, file_v1_annotation, file_v1_common, file_v1_issue_service]);+ fileDesc("Chh2MS9zZXR0aW5nX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIhUKE0xpc3RTZXR0aW5nc1JlcXVlc3QiPgoUTGlzdFNldHRpbmdzUmVzcG9uc2USJgoIc2V0dGluZ3MYASADKAsyFC5ieXRlYmFzZS52MS5TZXR0aW5nIj8KEUdldFNldHRpbmdSZXF1ZXN0EioKBG5hbWUYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1NldHRpbmciOwoSR2V0U2V0dGluZ1Jlc3BvbnNlEiUKB3NldHRpbmcYASABKAsyFC5ieXRlYmFzZS52MS5TZXR0aW5nIqEBChRVcGRhdGVTZXR0aW5nUmVxdWVzdBIqCgdzZXR0aW5nGAEgASgLMhQuYnl0ZWJhc2UudjEuU2V0d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bmciQ9pBBG5hbWWK6jAPYmIuc2V0dGluZ3MuZ2V0kOowAqDqMASo6jAJgtPkkwIXEhUvdjEve25hbWU9c2V0dGluZ3MvKn0SmwEKDVVwZGF0ZVNldHRpbmcSIS5ieXRlYmFzZS52MS5VcGRhdGVTZXR0aW5nUmVxdWVzdBoULmJ5dGViYXNlLnYxLlNldHRpbmciUYrqMA9iYi5zZXR0aW5ncy5zZXSQ6jACmOowAaDqMAOo6jAHgtPkkwIoOgdzZXR0aW5nMh0vdjEve3NldHRpbmcubmFtZT1zZXR0aW5ncy8qfRK4AQoQVGVzdEVtYWlsU2V0dGluZxIkLmJ5dGViYXNlLnYxLlRlc3RFbWFpbFNldHRpbmdSZXF1ZXN0GiUuYnl0ZWJhc2UudjEuVGVzdEVtYWlsU2V0dGluZ1Jlc3BvbnNlIleK6jAPYmIuc2V0dGluZ3Muc2V0kOowAaDqMAOo6jAGgtPkkwIyOgEqIi0vdjEve3BhcmVudD13b3Jrc3BhY2VzLyp9L3NldHRpbmdzL0VNQUlMOnRlc3RCqQEKD2NvbS5ieXRlYmFzZS52MUITU2V0dGluZ1NlcnZpY2VQcm90b1ABWjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxogIDQlhYqgILQnl0ZWJhc2UuVjHKAgtCeXRlYmFzZVxWMeICF0J5dGViYXNlXFYxXEdQQk1ldGFkYXRh6gIMQnl0ZWJhc2U6OlYxYgZwcm90bzM", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_duration, file_google_protobuf_field_mask, file_google_type_color, file_google_type_expr, file_v1_annotation, file_v1_common, file_v1_issue_service]);/*** Describes the message bytebase.v1.ListSettingsRequest.@@ -166,8 +166,8 @@ export const MCPSetting_CapabilitySchema = /*@__PURE__*//*** Capability is the ceiling: a session runs at this level or lower.- * Writing CAPABILITY_UNSPECIFIED explicitly is rejected; omit the update mask- * path to leave the current ceiling unchanged.+ * Writing CAPABILITY_UNSPECIFIED, explicitly or by leaving+ * value.mcp.capability out of the update mask, is rejected.** @generated from enum bytebase.v1.MCPSetting.Capability*/diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex 4a0bf06c3c..caa21060f4 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -24503,20 +24503,6 @@ components:on the internal MCP chain decides, per request, which method classes areserved, and under READ_ONLY the SQL clamp decides, per statement, whetherit only reads.- ignoreMaskingExemptions:- type: boolean- title: ignore_masking_exemptions- description: |-- Whether a request that arrived over MCP stops applying the caller's own- unmasking provisioning. Two mechanisms let a user see a real value and this- suppresses both: the masking exemptions granted to them, and the unmask- carried by an access grant. The same user in the console is untouched.-- It cannot force masking where there is none. Masking substitutes values in- query results, so this does not reach data copied into a column carrying no- masking policy, and it does nothing on the engines Bytebase does not mask.- It narrows what an agent reads through the paths Bytebase masks; it is not- a confidentiality boundary.title: MCPSettingadditionalProperties: falsedescription: |-@@ -24532,8 +24518,8 @@ components:- READ_WRITEdescription: |-Capability is the ceiling: a session runs at this level or lower.- Writing CAPABILITY_UNSPECIFIED explicitly is rejected; omit the update mask- path to leave the current ceiling unchanged.+ Writing CAPABILITY_UNSPECIFIED, explicitly or by leaving+ value.mcp.capability out of the update mask, is rejected.bytebase.v1.MaskingExemptionPolicy:type: objectproperties:diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 30f08894f9..431719addd 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -4054,9 +4054,6 @@ sign-in configuration.| Field | Type | Label | Description || ----- | ---- | ----- | ----------- || capability | [MCPSetting.Capability](#bytebase-store-MCPSetting-Capability) | | The maximum capability available to MCP sessions in this workspace, acting as an admin-set ceiling. Enforced server-side at three points: the /mcp endpoint decides whether a connection is admitted at all, the ceiling gate on the internal MCP chain decides, per request, which method classes are served, and under READ_ONLY the SQL clamp decides, per statement, whether it only reads. |-| ignore_masking_exemptions | [bool](#bool) | | Whether a request that arrived over MCP stops applying the caller's own unmasking provisioning. Two mechanisms let a user see a real value and this suppresses both: the masking exemptions granted to them, and the unmask carried by an access grant. The same user in the console is untouched.--It cannot force masking where there is none. Masking substitutes values in query results, so this does not reach data copied into a column carrying no masking policy, and it does nothing on the engines Bytebase does not mask. It narrows what an agent reads through the paths Bytebase masks; it is not a confidentiality boundary. |diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex 23d654beac..206340df1c 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -10561,22 +10561,6 @@ served, and under READ_ONLY the SQL clamp decides, per statement, whetherit only reads. </p></td></tr>- <tr>- <td>ignore_masking_exemptions</td>- <td><a href="#bool">bool</a></td>- <td></td>- <td><p>Whether a request that arrived over MCP stops applying the caller's own-unmasking provisioning. Two mechanisms let a user see a real value and this-suppresses both: the masking exemptions granted to them, and the unmask-carried by an access grant. The same user in the console is untouched.--It cannot force masking where there is none. Masking substitutes values in-query results, so this does not reach data copied into a column carrying no-masking policy, and it does nothing on the engines Bytebase does not mask.-It narrows what an agent reads through the paths Bytebase masks; it is not-a confidentiality boundary. </p></td>- </tr>-</tbody></table>diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 12978d1c8a..3ea89f7d70 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -4616,9 +4616,6 @@ workspace.| Field | Type | Label | Description || ----- | ---- | ----- | ----------- || capability | [MCPSetting.Capability](#bytebase-v1-MCPSetting-Capability) | | The maximum capability available to MCP sessions in this workspace, acting as an admin-set ceiling. Enforced server-side at three points: the /mcp endpoint decides whether a connection is admitted at all, the ceiling gate on the internal MCP chain decides, per request, which method classes are served, and under READ_ONLY the SQL clamp decides, per statement, whether it only reads. |-| ignore_masking_exemptions | [bool](#bool) | | Whether a request that arrived over MCP stops applying the caller's own unmasking provisioning. Two mechanisms let a user see a real value and this suppresses both: the masking exemptions granted to them, and the unmask carried by an access grant. The same user in the console is untouched.--It cannot force masking where there is none. Masking substitutes values in query results, so this does not reach data copied into a column carrying no masking policy, and it does nothing on the engines Bytebase does not mask. It narrows what an agent reads through the paths Bytebase masks; it is not a confidentiality boundary. |@@ -4970,8 +4967,8 @@ For examples: resource.environment_id == "prod" && statement.aff### MCPSetting.CapabilityCapability is the ceiling: a session runs at this level or lower.-Writing CAPABILITY_UNSPECIFIED explicitly is rejected; omit the update mask-path to leave the current ceiling unchanged.+Writing CAPABILITY_UNSPECIFIED, explicitly or by leaving+value.mcp.capability out of the update mask, is rejected.| Name | Number | Description || ---- | ------ | ----------- |diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex aa2ffeda04..28324f6912 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -13493,22 +13493,6 @@ served, and under READ_ONLY the SQL clamp decides, per statement, whetherit only reads. </p></td></tr>- <tr>- <td>ignore_masking_exemptions</td>- <td><a href="#bool">bool</a></td>- <td></td>- <td><p>Whether a request that arrived over MCP stops applying the caller's own-unmasking provisioning. Two mechanisms let a user see a real value and this-suppresses both: the masking exemptions granted to them, and the unmask-carried by an access grant. The same user in the console is untouched.--It cannot force masking where there is none. Masking substitutes values in-query results, so this does not reach data copied into a column carrying no-masking policy, and it does nothing on the engines Bytebase does not mask.-It narrows what an agent reads through the paths Bytebase masks; it is not-a confidentiality boundary. </p></td>- </tr>-</tbody></table>@@ -14446,7 +14430,7 @@ Default to this mode.</p></td></table><h3 id="bytebase.v1.MCPSetting.Capability">MCPSetting.Capability</h3>- <p>Capability is the ceiling: a session runs at this level or lower.</p><p>Writing CAPABILITY_UNSPECIFIED explicitly is rejected; omit the update mask</p><p>path to leave the current ceiling unchanged.</p>+ <p>Capability is the ceiling: a session runs at this level or lower.</p><p>Writing CAPABILITY_UNSPECIFIED, explicitly or by leaving</p><p>value.mcp.capability out of the update mask, is rejected.</p><table class="enum-table"><thead><tr><td>Name</td><td>Number</td><td>Description</td></tr>diff --git a/proto/store/store/setting.proto b/proto/store/store/setting.protoindex bab5570e45..32fe6d6a34 100644--- a/proto/store/store/setting.proto+++ b/proto/store/store/setting.proto@@ -196,18 +196,6 @@ message MCPSetting {// served, and under READ_ONLY the SQL clamp decides, per statement, whether// it only reads.Capability capability = 1;-- // Whether a request that arrived over MCP stops applying the caller's own- // unmasking provisioning. Two mechanisms let a user see a real value and this- // suppresses both: the masking exemptions granted to them, and the unmask- // carried by an access grant. The same user in the console is untouched.- //- // It cannot force masking where there is none. Masking substitutes values in- // query results, so this does not reach data copied into a column carrying no- // masking policy, and it does nothing on the engines Bytebase does not mask.- // It narrows what an agent reads through the paths Bytebase masks; it is not- // a confidentiality boundary.- bool ignore_masking_exemptions = 2;}message SQLEditorThemeSetting {diff --git a/proto/v1/v1/setting_service.proto b/proto/v1/v1/setting_service.protoindex fe30b818a0..4eb26fdee3 100644--- a/proto/v1/v1/setting_service.proto+++ b/proto/v1/v1/setting_service.proto@@ -320,8 +320,8 @@ message WorkspaceProfileSetting {// workspace.message MCPSetting {// Capability is the ceiling: a session runs at this level or lower.- // Writing CAPABILITY_UNSPECIFIED explicitly is rejected; omit the update mask- // path to leave the current ceiling unchanged.+ // Writing CAPABILITY_UNSPECIFIED, explicitly or by leaving+ // value.mcp.capability out of the update mask, is rejected.enum Capability {CAPABILITY_UNSPECIFIED = 0;// MCP connections are rejected.@@ -345,18 +345,6 @@ message MCPSetting {// served, and under READ_ONLY the SQL clamp decides, per statement, whether// it only reads.Capability capability = 1;-- // Whether a request that arrived over MCP stops applying the caller's own- // unmasking provisioning. Two mechanisms let a user see a real value and this- // suppresses both: the masking exemptions granted to them, and the unmask- // carried by an access grant. The same user in the console is untouched.- //- // It cannot force masking where there is none. Masking substitutes values in- // query results, so this does not reach data copied into a column carrying no- // masking policy, and it does nothing on the engines Bytebase does not mask.- // It narrows what an agent reads through the paths Bytebase masks; it is not- // a confidentiality boundary.- bool ignore_masking_exemptions = 2;}message SQLEditorThemeSetting {