From 1600639a38c25fae481612ab09dc3d3d5a133d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:36:43 +0200 Subject: [PATCH 01/52] docs(kiro): plan scoped native install trust with three review rounds --- docs/plans/2026-11-21-kiro-owned-trust-e2e.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docs/plans/2026-11-21-kiro-owned-trust-e2e.md diff --git a/docs/plans/2026-11-21-kiro-owned-trust-e2e.md b/docs/plans/2026-11-21-kiro-owned-trust-e2e.md new file mode 100644 index 0000000000..a17eb6c936 --- /dev/null +++ b/docs/plans/2026-11-21-kiro-owned-trust-e2e.md @@ -0,0 +1,24 @@ +# Kiro — selected installation and native trust (21 Nov 2026) + +## Baseline and goal +Main already contains the Kiro user-scope native Skills/MCP transaction and ACP observer. PR #927 merged and proved a **Prepared**, no-auth Kiro lifecycle. Current Project delivery deliberately remains Prepared because workspace trust, custom-agent selection and native discovery are separate authorities. Open #931 and #1016 are E2E/research, not an automatic-trust implementation. + +One `agentplugins add ... --target kiro` should install selected Kiro components without manual JSON editing, and the confirmed installation plan should supply only the selected package's MCP tool consent where Kiro provides a documented, ownership-safe config. No vendor login, credential acquisition, broad agent shell trust, unrelated client changes, or native trust database hacks. + +## Plan R1: architecture criticism and resolution +**Risk:** a new installer, generic `ClientID == Kiro` branch or second JSON engine violates SOLID/DRY. **Resolution:** keep changes in `clients/kiro`, reuse the existing `shared.ProjectMCPServers`, Kiro exact JSONC mutation, plan ownership digests, native receipts and rollback. A scoped projected-server transform may be required; no new state store or adapter interface. + +## Plan R2: trust/security criticism and resolution +**Risk:** `autoApprove: ["*"]` silently grants every future tool of one server, and writing a workspace trust hash is undocumented. Kiro's official security guidance recommends only individually audited safe MCP tools. **Resolution:** do not add broad wildcard approval, global trust-all, permissions.yaml changes or undocumented workspace trust file writes. Reuse explicitly authored per-server allowlists only when the confirmed plan authorizes them; validate and preserve the selected servers and existing foreign/deny settings. Kiro's documented `--trust-workspace` lasts only one V3 CLI launch (2.34+); it does not persist IDE or later workspace trust. Project delivery must stay Prepared until native trust and discovery can be proven. + +## Plan R3: acceptance criticism and resolution +**Risk:** a green compilation, mocked ACP response, skipped native job or a copied config is not user-ready Kiro. **Resolution:** cover owned User/Project Skills/MCP initial add, exact repeat, safe replacement, repair, remove, idempotency, foreign entries and changed-file rejection; inspect the real native no-auth boundary without presenting a login refusal as callable tool success. Keep working across Linux, macOS and Windows. Require final-HEAD CI, review threads resolved and postmerge evidence before reporting complete. + +## Implementation work +1. Inspect the actual existing Kiro schema and tests, and whether a trustworthy native list of tool names is available. Prefer no production change if configuration already satisfies an approved exact-list case. +2. Add a Kiro-only, least-privilege, confirmed-install path for selected MCP tool approvals if and only if there is a stable native authorization representation. If not available, keep an honest explicit limitation rather than synthesizing trust. +3. Add focused regressions and exact-source E2E evidence; review twice for boundaries and security, then once for lifecycle/results. +4. Draft PR first; publish each commit immediately. Mark ready and merge only when the actual native and mandatory CI gates pass; no unrelated PRs, release or generated changes. + +## Estimates (before implementation) +Production: 60–180 LoC. Tests: 150–350 LoC. Complexity 5/10; reliability target 9/10; confidence 7/10 before real native acceptance. Scope excludes changes to vendor Kiro binaries, user's credentials, and implicit trust of entire workspaces. From bb5e1b52a61a2c85406270231322aedd72facb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:42:37 +0200 Subject: [PATCH 02/52] feat(kiro): qualify exact publisher-declared MCP auto-approval extension --- .../clients/kiro/mcp_approvals.go | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go diff --git a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go new file mode 100644 index 0000000000..46206bc72e --- /dev/null +++ b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go @@ -0,0 +1,172 @@ +package kiro + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "os" + "path/filepath" + "slices" + "strings" + "unicode" + + "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/clients" + "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/clients/shared" + "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/domain" +) + +// MCPApprovalNamespace is an opt-in, publisher-authored Kiro extension of +// plugin.json. Its exact tool names, not package-selected wildcards, are shown +// during review and projected into Kiro's documented autoApprove setting. +const MCPApprovalNamespace = "com.universal-agent-plugins.kiro-mcp-approval" + +type mcpApprovals struct { + Version int `json:"version"` + Servers map[string][]string `json:"mcp_auto_approve"` +} + +var _ clients.ExtensionInterpreter = (*Adapter)(nil) + +func (*Adapter) InterpretExtension(namespace string, raw json.RawMessage) (domain.SupportLevel, string) { + if namespace != MCPApprovalNamespace { + return domain.SupportUnsupported, "extension_semantics_not_established" + } + if _, err := decodeMCPApprovals(raw); err != nil { + return domain.SupportUnsupported, "kiro_mcp_approval_invalid" + } + return domain.SupportNative, "" +} + +func decodeMCPApprovals(raw json.RawMessage) (mcpApprovals, error) { + var value mcpApprovals + if len(raw) == 0 || len(raw) > 16<<10 { + return value, fmt.Errorf("Kiro MCP approval extension exceeds its limit") + } + if _, err := shared.DecodeStrictJSONObject(raw); err != nil { + return value, fmt.Errorf("invalid Kiro MCP approval object: %w", err) + } + decoder := json.NewDecoder(bytes.NewReader(raw)) + decoder.DisallowUnknownFields() + if err := decoder.Decode(&value); err != nil { + return value, fmt.Errorf("invalid Kiro MCP approval fields: %w", err) + } + if err := decoder.Decode(new(any)); err != io.EOF { + return value, fmt.Errorf("Kiro MCP approval extension must contain one object") + } + if value.Version != 1 || len(value.Servers) == 0 || len(value.Servers) > 32 { + return value, fmt.Errorf("unsupported Kiro MCP approval version or server count") + } + for server, tools := range value.Servers { + if !validKiroApprovalName(server) || len(tools) == 0 || len(tools) > 64 { + return value, fmt.Errorf("invalid Kiro MCP approval server or tool count") + } + seen := map[string]bool{} + for _, tool := range tools { + if !validKiroApprovalName(tool) || seen[tool] { + return value, fmt.Errorf("invalid or duplicate Kiro MCP auto-approved tool for %q", server) + } + seen[tool] = true + } + } + return value, nil +} + +// Kiro's wildcard is intentionally excluded: a package update may expose new +// tools, and a reviewed source cannot authorize their future unknown behavior. +func validKiroApprovalName(value string) bool { + if value == "" || len(value) > 128 || strings.TrimSpace(value) != value { + return false + } + for _, r := range value { + if unicode.IsControl(r) || r == '*' || r == '?' || r == '[' || r == ']' || r == '/' || r == '\\' { + return false + } + } + return true +} + +func kiroNativeComponents(components []domain.ComponentDecision) bool { + found := false + for _, component := range components { + if component.Support == domain.SupportUnsupported { + continue + } + switch component.Kind { + case domain.ComponentSkill, domain.ComponentMCPServer: + found = true + case domain.ComponentExtension: + if component.Name != MCPApprovalNamespace { + return false + } + default: + return false + } + } + return found +} + +func selectedKiroApprovals(envelope domain.PackageEnvelope, plan domain.DeliveryPlan) (mcpApprovals, error) { + raw, exists := envelope.Manifest.Extensions[MCPApprovalNamespace] + if !exists { + return mcpApprovals{}, nil + } + approved, err := decodeMCPApprovals(raw) + if err != nil { + return approved, err + } + selected := shared.SupportedMCPNames(plan) + for server := range approved.Servers { + if !slices.Contains(selected, server) { + return approved, fmt.Errorf("Kiro approval references an unselected MCP server %q", server) + } + } + return approved, nil +} + +// Only Kiro's generated native projection is changed. Source MCP documents +// stay portable and exact, and the resulting native entry is receipt-owned. +func applyKiroApprovals(root string, approval mcpApprovals) error { + if len(approval.Servers) == 0 { + return nil + } + path := filepath.Join(root, "mcp.json") + body, err := os.ReadFile(path) + if err != nil { + return err + } + document, err := shared.DecodeStrictJSONObject(body) + if err != nil { + return err + } + servers, ok := document["mcpServers"].(map[string]any) + if !ok { + return fmt.Errorf("Kiro MCP projection has no servers") + } + for name, tools := range approval.Servers { + server, ok := servers[name].(map[string]any) + if !ok { + return fmt.Errorf("Kiro MCP projection lacks approved server %q", name) + } + if _, existing := server["autoApprove"]; existing { + return fmt.Errorf("Kiro MCP projection has conflicting approval for %q", name) + } + server["autoApprove"] = tools + } + return shared.WriteJSON(path, document) +} + +func kiroApprovalDisclosure(approved mcpApprovals) string { + if len(approved.Servers) == 0 { + return "" + } + var entries []string + for name, tools := range approved.Servers { + for _, tool := range tools { + entries = append(entries, name+"/"+tool) + } + } + slices.Sort(entries) + return "Kiro will automatically approve these publisher-declared MCP tools only: " + + strings.Join(entries, ", ") + ". Review the selected source before confirming; workspace trust, higher-priority deny/ask rules and authentication remain separate." +} From 303aecdc8ae6391e3df89ca9cc1b9fbc31c2e976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:42:53 +0200 Subject: [PATCH 03/52] feat(kiro): scope native MCP tool approvals to selected owned servers --- install/integrationctl/agentplugins/domain/clients_catalog.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/integrationctl/agentplugins/domain/clients_catalog.go b/install/integrationctl/agentplugins/domain/clients_catalog.go index 5077952dd8..7c4b1dbfe3 100644 --- a/install/integrationctl/agentplugins/domain/clients_catalog.go +++ b/install/integrationctl/agentplugins/domain/clients_catalog.go @@ -130,7 +130,7 @@ var clientDefinitions = []ClientDefinition{ InstallIntents: []InstallIntent{InstallIntentAutomatic}, LifecycleKind: LifecycleCLIRegistry, })), LifecycleNativeConfig), - withProjectScope(clientDefinition(ClientKiro, "Kiro", "kiro", "managed", "native", true, PackageNative, SupportNative, SupportNative, SupportNative, SupportUnsupported, SupportUnsupported, ClientTraits{ + withProjectScope(clientDefinition(ClientKiro, "Kiro", "kiro", "managed", "native", true, PackageNative, SupportNative, SupportNative, SupportNative, SupportUnsupported, SupportNative, ClientTraits{ InstallIntents: []InstallIntent{InstallIntentAutomatic, InstallIntentPrepare}, LifecycleKind: LifecycleCLIRegistry, TracksNativeEffects: true, From 58de867ae6fc6de46b6f0e4816a9df95fc13e105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:42:56 +0200 Subject: [PATCH 04/52] feat(kiro): scope native MCP tool approvals to selected owned servers --- .../agentplugins/clients/kiro/plan.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/install/integrationctl/agentplugins/clients/kiro/plan.go b/install/integrationctl/agentplugins/clients/kiro/plan.go index abc0ddd8df..2223488f10 100644 --- a/install/integrationctl/agentplugins/clients/kiro/plan.go +++ b/install/integrationctl/agentplugins/clients/kiro/plan.go @@ -20,10 +20,20 @@ var ( ) func (*Adapter) RefinePlan(_ context.Context, in clients.PlanInput, plan *domain.DeliveryPlan) error { + approvals, err := selectedKiroApprovals(in.Envelope, *plan) + if err != nil { + return err + } if in.TargetContext.Scope == domain.ScopeProject { - return refineProjectPlan(in, plan) + if err := refineProjectPlan(in, plan); err != nil { + return err + } + if disclosure := kiroApprovalDisclosure(approvals); disclosure != "" { + plan.Warnings = shared.AppendUnique(plan.Warnings, disclosure) + } + return nil } - eligible := shared.OnlyNativeComponents(plan.Components) + eligible := kiroNativeComponents(plan.Components) needsCLI := shared.HasSupportedMCP(plan.Components) hasConfigRoot := strings.TrimSpace(in.Client.ConfigRoot) != "" canActivate := hasConfigRoot && eligible && (!needsCLI || isKiroCLI(in.Client.ExecutablePath)) @@ -35,6 +45,9 @@ func (*Adapter) RefinePlan(_ context.Context, in clients.PlanInput, plan *domain } else if canActivate { plan.UserActions = shared.AppendUnique(plan.UserActions, "agentplugins will install and verify the package's global Kiro skills and MCP servers automatically") } + if disclosure := kiroApprovalDisclosure(approvals); disclosure != "" { + plan.Warnings = shared.AppendUnique(plan.Warnings, disclosure) + } return nil } @@ -52,7 +65,7 @@ func (*Adapter) RefinePreparation(plan *domain.DeliveryPlan) error { if plan.Status == domain.PlanUnsupported { return nil } - if !shared.OnlyNativeComponents(plan.Components) { + if !kiroNativeComponents(plan.Components) { return fmt.Errorf("kiro project preparation requires supported native components") } plan.Status, plan.Activation, plan.Verification = domain.PlanReady, domain.ActivationPrepared, domain.VerificationPackageValid From fdb8e60e22912abdc8ab26eaa7b65f80b93a7bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:42:58 +0200 Subject: [PATCH 05/52] feat(kiro): scope native MCP tool approvals to selected owned servers --- install/integrationctl/agentplugins/clients/kiro/scope.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/integrationctl/agentplugins/clients/kiro/scope.go b/install/integrationctl/agentplugins/clients/kiro/scope.go index 6706bec9a5..97708fa2b9 100644 --- a/install/integrationctl/agentplugins/clients/kiro/scope.go +++ b/install/integrationctl/agentplugins/clients/kiro/scope.go @@ -83,7 +83,7 @@ func refineProjectPlan(in clients.PlanInput, plan *domain.DeliveryPlan) error { return err } plan.NativeRegistryRoot, plan.NativeRegistryExecutable = root, "" - if plan.Status == domain.PlanUnsupported || !shared.OnlyNativeComponents(plan.Components) { + if plan.Status == domain.PlanUnsupported || !kiroNativeComponents(plan.Components) { return nil } plan.Status, plan.Activation, plan.Verification = domain.PlanReady, domain.ActivationPrepared, domain.VerificationPackageValid From 656e22a2d206f6e103422c03e2c01ab6ac1601ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:43:00 +0200 Subject: [PATCH 06/52] feat(kiro): scope native MCP tool approvals to selected owned servers --- .../integrationctl/agentplugins/clients/kiro/activate.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/integrationctl/agentplugins/clients/kiro/activate.go b/install/integrationctl/agentplugins/clients/kiro/activate.go index 4dbde2466b..a816a9e532 100644 --- a/install/integrationctl/agentplugins/clients/kiro/activate.go +++ b/install/integrationctl/agentplugins/clients/kiro/activate.go @@ -23,12 +23,12 @@ func (*Adapter) AutomaticallyActivates(_ clients.Env, request domain.ActivationR func automaticallyActivates(request domain.ActivationRequest) bool { if request.Plan.Scope == domain.ScopeProject { - return request.Plan.InstallIntent == domain.InstallIntentAutomatic && shared.OnlyNativeComponents(request.Plan.Components) + return request.Plan.InstallIntent == domain.InstallIntentAutomatic && kiroNativeComponents(request.Plan.Components) } if request.Plan.InstallIntent != domain.InstallIntentAutomatic { return false } - if strings.TrimSpace(request.Client.ConfigRoot) == "" || !shared.OnlyNativeComponents(request.Plan.Components) { + if strings.TrimSpace(request.Client.ConfigRoot) == "" || !kiroNativeComponents(request.Plan.Components) { return false } return !shared.HasSupportedMCP(request.Plan.Components) || @@ -40,7 +40,7 @@ func automaticallyActivates(request domain.ActivationRequest) bool { // that does not look like Kiro cannot prove Kiro state. func (*Adapter) VerifierAvailable(_ domain.DetectedClient, plan domain.DeliveryPlan, backendExecutable string) bool { if plan.Scope == domain.ScopeProject { - return shared.OnlyNativeComponents(plan.Components) + return kiroNativeComponents(plan.Components) } if strings.TrimSpace(backendExecutable) == "" { return false @@ -66,7 +66,7 @@ func (*Adapter) PreflightActivation(env clients.Env, request domain.ActivationRe return preflightKiroProject(env, request) } if request.Plan.InstallIntent == domain.InstallIntentPrepare { - if request.Plan.Scope != domain.ScopeUser || strings.TrimSpace(request.Client.ConfigRoot) == "" || !shared.OnlyNativeComponents(request.Plan.Components) { + if request.Plan.Scope != domain.ScopeUser || strings.TrimSpace(request.Client.ConfigRoot) == "" || !kiroNativeComponents(request.Plan.Components) { return kiroErrorf("Kiro preparation requires native configuration and supported components") } return nil From 84492c2a11d95607412b5596fbd98c4d10d9de39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:43:03 +0200 Subject: [PATCH 07/52] feat(kiro): scope native MCP tool approvals to selected owned servers --- .../agentplugins/clients/kiro/project_lifecycle.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/integrationctl/agentplugins/clients/kiro/project_lifecycle.go b/install/integrationctl/agentplugins/clients/kiro/project_lifecycle.go index 7c9f257b00..b92ef713a3 100644 --- a/install/integrationctl/agentplugins/clients/kiro/project_lifecycle.go +++ b/install/integrationctl/agentplugins/clients/kiro/project_lifecycle.go @@ -31,7 +31,7 @@ func preflightKiroProject(env clients.Env, request domain.ActivationRequest) err if request.ActivationComplete { return fmt.Errorf("kiro project native discovery cannot be established by activation attestation") } - if !shared.OnlyNativeComponents(request.Plan.Components) { + if !kiroNativeComponents(request.Plan.Components) { return fmt.Errorf("kiro project delivery requires supported skills and MCP servers only") } if err := validateKiroProjectObjects(root, request.PreviousNativeObjects); err != nil { From f877212d275488f123057c22c135cc67112b8b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:43:05 +0200 Subject: [PATCH 08/52] feat(kiro): scope native MCP tool approvals to selected owned servers --- .../integrationctl/agentplugins/clients/kiro/project.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install/integrationctl/agentplugins/clients/kiro/project.go b/install/integrationctl/agentplugins/clients/kiro/project.go index 3f55efae7e..a7814adbf5 100644 --- a/install/integrationctl/agentplugins/clients/kiro/project.go +++ b/install/integrationctl/agentplugins/clients/kiro/project.go @@ -43,6 +43,13 @@ func (*Adapter) Project(_ context.Context, in clients.ProjectionInput) ([]domain }); err != nil { return nil, err } + approvals, err := selectedKiroApprovals(in.Envelope, in.Plan) + if err != nil { + return nil, err + } + if err := applyKiroApprovals(in.StagingPath, approvals); err != nil { + return nil, err + } if in.Plan.Scope == domain.ScopeProject { if err := projectKiroStdio(in); err != nil { return nil, err From 1454ce7b1515b691e66d45433ab6f2e187c14987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:44:00 +0200 Subject: [PATCH 09/52] test(kiro): exercise exact tool approvals across lifecycle and project trust boundary --- .../clients/kiro/mcp_approvals_test.go | 245 ++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go diff --git a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go new file mode 100644 index 0000000000..cc6be021f8 --- /dev/null +++ b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go @@ -0,0 +1,245 @@ +package kiro + +import ( + "context" + "encoding/json" + "os" + "path/filepath" + "reflect" + "strings" + "testing" + + "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/clients" + "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/clients/shared" + "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/domain" +) + +const kiroApprovalTestServer = "docs" + +func testKiroApprovedEnvelope(approvals string) domain.PackageEnvelope { + return domain.PackageEnvelope{ + Manifest: domain.PluginManifest{Extensions: map[string]json.RawMessage{ + MCPApprovalNamespace: json.RawMessage(approvals), + }}, + MCP: domain.MCPComponent{Present: true, Enabled: true, Servers: map[string]domain.MCPServer{ + kiroApprovalTestServer: { + Name: kiroApprovalTestServer, Type: "streamable-http", + Decoded: map[string]any{"type": "streamable-http", "url": "https://docs.example.test/mcp"}, + }, + }}, + } +} + +func testKiroApprovalPlan(root, active string, scope domain.InstallScope) domain.DeliveryPlan { + return domain.DeliveryPlan{ + ClientID: domain.ClientKiro, Scope: scope, + InstallIntent: domain.InstallIntentPrepare, Status: domain.PlanReady, + NativeRegistryRoot: root, ActivePath: active, + Components: []domain.ComponentDecision{ + {Kind: domain.ComponentMCPServer, Name: kiroApprovalTestServer, Support: domain.SupportNative}, + {Kind: domain.ComponentExtension, Name: MCPApprovalNamespace, Support: domain.SupportNative}, + }, + } +} + +func TestKiroNamedMCPApprovalSchemaFailClosed(t *testing.T) { + valid := `{"version":1,"mcp_auto_approve":{"docs":["read_docs","get-library.id"]}}` + for name, raw := range map[string]string{ + "empty": "", + "root": "[]", + "unsupported-version": `{"version":2,"mcp_auto_approve":{"docs":["read"]}}`, + "empty-list": `{"version":1,"mcp_auto_approve":{"docs":[]}}`, + "wildcard": `{"version":1,"mcp_auto_approve":{"docs":["*"]}}`, + "embedded-wildcard": `{"version":1,"mcp_auto_approve":{"docs":["read*"]}}`, + "path": `{"version":1,"mcp_auto_approve":{"docs":["../secret"]}}`, + "duplicate-tool": `{"version":1,"mcp_auto_approve":{"docs":["read","read"]}}`, + "duplicate-server": `{"version":1,"mcp_auto_approve":{"docs":["read"],"docs":["write"]}}`, + "unknown-field": `{"version":1,"mcp_auto_approve":{"docs":["read"]},"all_tools":true}`, + "wrong-shape": `{"version":1,"mcp_auto_approve":{"docs":"read"}}`, + "null": `{"version":1,"mcp_auto_approve":null}`, + "trailing-content": valid + " {}", + } { + t.Run(name, func(t *testing.T) { + if _, err := decodeMCPApprovals(json.RawMessage(raw)); err == nil { + t.Fatal("accepted an unsafe Kiro tool approval manifest") + } + }) + } + approved, err := decodeMCPApprovals(json.RawMessage(valid)) + if err != nil || !reflect.DeepEqual(approved.Servers[kiroApprovalTestServer], []string{"read_docs", "get-library.id"}) { + t.Fatalf("valid exact approval: %+v %v", approved, err) + } + if support, _ := New().InterpretExtension(MCPApprovalNamespace, json.RawMessage(valid)); support != domain.SupportNative { + t.Fatal("Kiro exact tool approvals not qualified as native") + } + if support, _ := New().InterpretExtension("foreign.extension", json.RawMessage(valid)); support != domain.SupportUnsupported { + t.Fatal("Kiro accepted a foreign extension") + } +} + +func TestKiroApprovalPreviewAndNoUnselectedPrivilege(t *testing.T) { + approved := testKiroApprovedEnvelope(`{"version":1,"mcp_auto_approve":{"docs":["read_docs"]}}`) + root := filepath.Join(t.TempDir(), ".kiro") + plan := testKiroApprovalPlan(root, filepath.Join(t.TempDir(), "active"), domain.ScopeUser) + client := domain.DetectedClient{ClientID: domain.ClientKiro, ConfigRoot: root, ExecutablePath: "/fixture/kiro-cli"} + if err := New().RefinePlan(context.Background(), clients.PlanInput{Envelope: approved, Client: client}, &plan); err != nil { + t.Fatal(err) + } + preview := strings.Join(plan.Warnings, " ") + if !strings.Contains(preview, "docs/read_docs") || !strings.Contains(preview, "workspace trust") { + t.Fatalf("missing exact Kiro trust disclosure: %+v", plan) + } + if !kiroNativeComponents(plan.Components) { + t.Fatal("known approval extension blocked otherwise-native Kiro delivery") + } + plan.Components[0].Name = "different-server" + if _, err := selectedKiroApprovals(approved, plan); err == nil { + t.Fatal("accepted publisher tool approval for an unselected server") + } + if kiroNativeComponents([]domain.ComponentDecision{{Kind: domain.ComponentExtension, Name: MCPApprovalNamespace, Support: domain.SupportNative}}) { + t.Fatal("accepted approvals without any native component") + } +} + +func TestKiroExactMCPApprovalDisposableLifecycle(t *testing.T) { + root := filepath.Join(t.TempDir(), ".kiro") + config := filepath.Join(root, "settings", "mcp.json") + writeTestFile(t, config, `{ + // foreign user preference must survive every operation + "unrelated": 9007199254740993, + "mcpServers": {"foreign": {"url": "https://foreign.test", "autoApprove": ["*"]}} +}`) + original, err := os.ReadFile(config) + if err != nil { + t.Fatal(err) + } + var previous []domain.NativeObjectOwnership + for _, trial := range []struct { + name string + list []string + }{ + {"install", []string{"read_docs"}}, + {"repeat", []string{"read_docs"}}, + {"update", []string{"read_docs", "get_library"}}, + {"repair", []string{"read_docs", "get_library"}}, + } { + t.Run(trial.name, func(t *testing.T) { + stage := filepath.Join(t.TempDir(), "stage") + if err := os.MkdirAll(stage, 0700); err != nil { + t.Fatal(err) + } + policy, err := json.Marshal(map[string]any{"version": 1, "mcp_auto_approve": map[string]any{"docs": trial.list}}) + if err != nil { + t.Fatal(err) + } + envelope := testKiroApprovedEnvelope(string(policy)) + plan := testKiroApprovalPlan(root, filepath.Join(t.TempDir(), "active"), domain.ScopeUser) + objects, err := New().Project(t.Context(), clients.ProjectionInput{StagingPath: stage, Plan: plan, Envelope: envelope}) + if err != nil || len(objects) != 1 { + t.Fatalf("projection: %v %+v", err, objects) + } + entry, err := projectedKiroMCPServer(stage, "docs") + if err != nil || !reflect.DeepEqual(entry["autoApprove"], stringsToAny(trial.list)) { + t.Fatalf("Kiro native approval missing: %v %+v", err, entry) + } + if err := applyKiroNativeMutation(root, stage, previous, objects); err != nil { + t.Fatal(err) + } + if err := VerifyNativeObjects(root, objects, false); err != nil { + t.Fatal(err) + } + before, err := os.ReadFile(config) + if err != nil || !strings.Contains(string(before), "// foreign user preference must survive") || + !strings.Contains(string(before), "9007199254740993") { + t.Fatalf("foreign config was changed: %s %v", before, err) + } + servers, _, _, _, err := ReadMCPConfig(config) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(servers["docs"].(map[string]any)["autoApprove"], stringsToAny(trial.list)) { + t.Fatalf("Kiro tool approvals not installed: %+v", servers["docs"]) + } + previous = objects + }) + } + if err := applyKiroNativeMutation(root, "", previous, nil); err != nil { + t.Fatal(err) + } + after, err := os.ReadFile(config) + if err != nil || !strings.Contains(string(after), "// foreign user preference must survive") { + t.Fatalf("foreign bytes/comments removed: %s %v", after, err) + } + servers, _, _, _, err := ReadMCPConfig(config) + if err != nil { + t.Fatal(err) + } + if _, exists := servers["docs"]; exists { + t.Fatal("owned MCP tool grant persisted after selected server removal") + } + if !reflect.DeepEqual(servers["foreign"].(map[string]any)["autoApprove"], []any{"*"}) { + t.Fatal("unrelated tool consent was changed") + } + if len(original) == 0 { + t.Fatal("invalid fixture") + } + if _, err := os.Stat(filepath.Join(root, "settings", "permissions.yaml")); !os.IsNotExist(err) { + t.Fatalf("Kiro global workspace/tool permissions were unexpectedly created: %v", err) + } +} + +func stringsToAny(values []string) []any { + items := make([]any, len(values)) + for i, value := range values { + items[i] = value + } + return items +} + +// Kiro project trust is separately mediated by the host. This test proves +// native consent is embedded in the selected project MCP config, not in the +// user's global registry or undocumented workspace-trust storage. +func TestKiroProjectApprovalDoesNotForgeWorkspaceTrust(t *testing.T) { + base := t.TempDir() + project, user := filepath.Join(base, "project"), filepath.Join(base, "user", ".kiro") + if err := os.MkdirAll(project, 0700); err != nil { + t.Fatal(err) + } + target, err := domain.NewTargetContext(domain.ScopeProject, project, user) + if err != nil { + t.Fatal(err) + } + artifact := "demo-0123456789ab" + active := filepath.Join(project, ".uap", "managed", "clients", "kiro", artifact) + root := filepath.Join(project, ".kiro") + plan := testKiroApprovalPlan(root, active, domain.ScopeProject) + plan.TargetContext, plan.PhysicalArtifactID = target, artifact + stage := filepath.Join(project, ".uap", "staged") + if err := os.MkdirAll(stage, 0700); err != nil { + t.Fatal(err) + } + envelope := testKiroApprovedEnvelope(`{"version":1,"mcp_auto_approve":{"docs":["read_docs"]}}`) + objects, err := New().Project(t.Context(), clients.ProjectionInput{StagingPath: stage, Plan: plan, Envelope: envelope}) + if err != nil || len(objects) != 1 { + t.Fatalf("project staging: %+v %v", objects, err) + } + entry, err := projectedKiroMCPServer(stage, "docs") + if err != nil || !reflect.DeepEqual(entry["autoApprove"], []any{"read_docs"}) { + t.Fatalf("project approval missing: %+v %v", entry, err) + } + if _, hasType := entry["type"]; hasType { + t.Fatal("Kiro project native MCP transport was not normalized") + } + if _, err := os.Stat(filepath.Join(user, "settings", "permissions.yaml")); !os.IsNotExist(err) { + t.Fatalf("Kiro global permission file unexpectedly written: %v", err) + } + if _, err := os.Stat(filepath.Join(user, "workspace-roots")); !os.IsNotExist(err) { + t.Fatalf("Kiro workspace trust unexpectedly fabricated: %v", err) + } + if got := kiroApprovalDisclosure(mcpApprovals{Servers: map[string][]string{"docs": {"read_docs"}}}); !strings.Contains(got, "workspace trust") { + t.Fatalf("Kiro trust limit hidden: %s", got) + } + if err := shared.WriteJSON(filepath.Join(stage, "mcp-original.json"), map[string]any{"untouched": true}); err != nil { + t.Fatal(err) + } +} From f77b90923975d1ffae06efe7a483b5698c7bf59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:44:24 +0200 Subject: [PATCH 10/52] fix(kiro): require selected approval authority and clean test contracts --- install/integrationctl/agentplugins/clients/kiro/plan.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/integrationctl/agentplugins/clients/kiro/plan.go b/install/integrationctl/agentplugins/clients/kiro/plan.go index 2223488f10..ad74b43bf8 100644 --- a/install/integrationctl/agentplugins/clients/kiro/plan.go +++ b/install/integrationctl/agentplugins/clients/kiro/plan.go @@ -73,7 +73,7 @@ func (*Adapter) RefinePreparation(plan *domain.DeliveryPlan) error { return nil } - if strings.TrimSpace(plan.NativeRegistryRoot) == "" || !shared.OnlyNativeComponents(plan.Components) { + if strings.TrimSpace(plan.NativeRegistryRoot) == "" || !kiroNativeComponents(plan.Components) { return fmt.Errorf("a Kiro preparation requires a native config root and supported skills or MCP servers") } plan.Status = domain.PlanReady From 748699d8254cbb59518d30ef771dc80c02be03f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:44:27 +0200 Subject: [PATCH 11/52] fix(kiro): require selected approval authority and clean test contracts --- .../agentplugins/clients/kiro/mcp_approvals.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go index 46206bc72e..a22bf4fc41 100644 --- a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go +++ b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go @@ -115,6 +115,17 @@ func selectedKiroApprovals(envelope domain.PackageEnvelope, plan domain.Delivery if err != nil { return approved, err } + extensionSelected := false + for _, component := range plan.Components { + if component.Kind == domain.ComponentExtension && component.Name == MCPApprovalNamespace && + component.Support == domain.SupportNative { + extensionSelected = true + break + } + } + if !extensionSelected { + return approved, fmt.Errorf("Kiro tool approvals were not selected by the plan") + } selected := shared.SupportedMCPNames(plan) for server := range approved.Servers { if !slices.Contains(selected, server) { From 67861df5bfe4dc6f3811c6112cb5835424943b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:44:29 +0200 Subject: [PATCH 12/52] fix(kiro): require selected approval authority and clean test contracts --- .../agentplugins/clients/kiro/mcp_approvals_test.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go index cc6be021f8..442b0c40f0 100644 --- a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go +++ b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go @@ -10,7 +10,6 @@ import ( "testing" "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/clients" - "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/clients/shared" "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/domain" ) @@ -109,11 +108,7 @@ func TestKiroExactMCPApprovalDisposableLifecycle(t *testing.T) { "unrelated": 9007199254740993, "mcpServers": {"foreign": {"url": "https://foreign.test", "autoApprove": ["*"]}} }`) - original, err := os.ReadFile(config) - if err != nil { - t.Fatal(err) - } - var previous []domain.NativeObjectOwnership + var previous []domain.NativeObjectOwnership for _, trial := range []struct { name string list []string @@ -180,9 +175,6 @@ func TestKiroExactMCPApprovalDisposableLifecycle(t *testing.T) { if !reflect.DeepEqual(servers["foreign"].(map[string]any)["autoApprove"], []any{"*"}) { t.Fatal("unrelated tool consent was changed") } - if len(original) == 0 { - t.Fatal("invalid fixture") - } if _, err := os.Stat(filepath.Join(root, "settings", "permissions.yaml")); !os.IsNotExist(err) { t.Fatalf("Kiro global workspace/tool permissions were unexpectedly created: %v", err) } @@ -239,7 +231,4 @@ func TestKiroProjectApprovalDoesNotForgeWorkspaceTrust(t *testing.T) { if got := kiroApprovalDisclosure(mcpApprovals{Servers: map[string][]string{"docs": {"read_docs"}}}); !strings.Contains(got, "workspace trust") { t.Fatalf("Kiro trust limit hidden: %s", got) } - if err := shared.WriteJSON(filepath.Join(stage, "mcp-original.json"), map[string]any{"untouched": true}); err != nil { - t.Fatal(err) - } } From a81984b0e54297280c3df848e9f48ab965e3f53b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:44:47 +0200 Subject: [PATCH 13/52] docs(kiro): document exact tool approval, trust boundary and acceptance --- docs/KIRO_MCP_TOOL_APPROVALS.md | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 docs/KIRO_MCP_TOOL_APPROVALS.md diff --git a/docs/KIRO_MCP_TOOL_APPROVALS.md b/docs/KIRO_MCP_TOOL_APPROVALS.md new file mode 100644 index 0000000000..9d48caec12 --- /dev/null +++ b/docs/KIRO_MCP_TOOL_APPROVALS.md @@ -0,0 +1,44 @@ +# Kiro: narrowly scoped automatic MCP tool approval + +Kiro already receives automatically installed, UAP-owned user Skills and MCP entries when its native setup is available. A project installation is **Prepared** until Kiro itself establishes workspace trust and discovery. The Kiro permissions system intentionally keeps workspace trust outside the cloned repository; UAP must not forge the `workspaceTrusted` record. + +## One-command approved tools for publisher-declared packages + +A package author who has reviewed the actual safe MCP tool set can add this optional Kiro-specific extension to the standard **plugin.json** (the portable **mcp.json** schema does not permit Kiro's `autoApprove` field): + +```json +{ + "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json", + "name": "example-docs", + "version": "1.0.0", + "extensions": { + "com.universal-agent-plugins.kiro-mcp-approval": { + "version": 1, + "mcp_auto_approve": { + "docs": ["read_docs", "find_docs"] + } + } + } +} +``` + +The same package's portable `mcp.json` must declare the **docs** server. The package's source digest includes the approved names. An ordinary `agentplugins add --target kiro` uses the confirmed package selection and projects the exact tool allowlist into **only the selected server's** Kiro-native `autoApprove` array in `~/.kiro/settings/mcp.json` (User) or `.kiro/settings/mcp.json` (Project). No Kiro-native JSON editing by the user is needed for these tools. The plan displays `docs/read_docs, docs/find_docs` before confirmation, with an explicit warning that it is granting per-tool consent. + +The extension is optional. If absent, UAP does not automatically approve any tools. A package cannot set `"*"`, a glob pattern, duplicate tool names, unexpected extension fields, an unselected server, or a foreign extension and receive auto-approval. Tool names are exact, not pattern-based; vendor-level `deny` and `ask` rules retain priority. Never use this to approve tools with privileged writes, sensitive data access, or unreviewed side effects. Safe publication requires the publisher to verify those tool contracts. + +On update/repair, the approval is regenerated from the exact selected and verified package source; a removed server loses its owned approval along with the owned MCP entry. UAP's exact native ownership digest protects user modifications and existing unrelated MCP servers, including their approvals. + +## What this does **not** automate + +**Workspace trust remains a separate Kiro-native decision.** Kiro CLI V3 does not load project Skills or MCP servers in an untrusted workspace, even with an `autoApprove` list. Kiro's documented `--trust-workspace` only skips the prompt for **one CLI invocation**, and does not persist a trust decision or grant IDE trust. There is no documented persistent, headless workspace-trust grant to use for later sessions. UAP does not synthesize the private workspace-roots hash or edit `workspaceTrusted`, grant global all-tools access, obtain credentials, or claim native tool execution without actual authenticated evidence. + +Security references: https://kiro.dev/docs/permissions/ and https://kiro.dev/docs/mcp/configuration/ and https://kiro.dev/docs/mcp/security/. + +## E2E acceptance + +- [ ] Real package schema accepts the new Kiro extension without changing the portable MCP schema. +- [ ] CLI/SDK selected User and Project files contain only exact approved tools; no wildcard. +- [ ] Fresh, unchanged repeat, update, repair, removal, and user-edited/foreign collision cases preserve native receipts and third-party bytes. +- [ ] Native no-auth Linux, macOS and Windows checks pass on one exact SHA; evidence must not equate *prepared* with *runtime verified*. +- [ ] No unrelated client changes, global trust file writes, or automatic elevation through other targets. +- [ ] All review findings addressed; merge only on successful final-HEAD checks. From 5279246260021866f73f64450bcf2da03119b69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:46:47 +0200 Subject: [PATCH 14/52] test(kiro): prove approved tool projection through public CLI and persisted lifecycle --- .../kiro_mcp_approvals_e2e_test.go | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 cli/internal/agentpluginscli/kiro_mcp_approvals_e2e_test.go diff --git a/cli/internal/agentpluginscli/kiro_mcp_approvals_e2e_test.go b/cli/internal/agentpluginscli/kiro_mcp_approvals_e2e_test.go new file mode 100644 index 0000000000..dfc2e861d8 --- /dev/null +++ b/cli/internal/agentpluginscli/kiro_mcp_approvals_e2e_test.go @@ -0,0 +1,94 @@ +package agentpluginscli + +import ( + "encoding/json" + "os" + "path/filepath" + "reflect" + "strings" + "testing" + + "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/domain" + "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/providers" + "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/providerstest" +) + +// This drives the public CLI command, official plugin.json extension, loader, +// planner, native staging, ownership receipts, and Kiro's real config mutation. +// The Kiro runtime and account are deliberately not mocked as "verified". +func TestKiroPublisherMCPApprovalsFullCLI(t *testing.T) { + client := fixtureClient(t, domain.ClientKiro) + client.ExecutablePath = "/fixture/kiro-cli" + fixture := newCLIFixture(t, []domain.DetectedClient{client}) + fixture.app.Lifecycle.Activator = providerstest.NewActivator(providers.Activator{}) + + source := writeCLIPlugin(t) + writeCLIMCP(t, source) + manifestPath := filepath.Join(source, "plugin.json") + body, err := os.ReadFile(manifestPath) + if err != nil { + t.Fatal(err) + } + var manifest map[string]any + if err := json.Unmarshal(body, &manifest); err != nil { + t.Fatal(err) + } + manifest["extensions"] = map[string]any{ + "com.universal-agent-plugins.kiro-mcp-approval": map[string]any{ + "version": 1, + "mcp_auto_approve": map[string]any{"demo": []string{"read_docs"}}, + }, + } + modified, err := json.Marshal(manifest) + if err != nil { + t.Fatal(err) + } + if err := os.WriteFile(manifestPath, modified, 0600); err != nil { + t.Fatal(err) + } + + nativePath := filepath.Join(client.ConfigRoot, "settings", "mcp.json") + assertNative := func() { + t.Helper() + body, err := os.ReadFile(nativePath) + if err != nil { + t.Fatal(err) + } + var config map[string]any + if err := json.Unmarshal(body, &config); err != nil { + t.Fatal(err) + } + servers, ok := config["mcpServers"].(map[string]any) + if !ok { + t.Fatalf("missing native Kiro MCP servers: %s", body) + } + owned, ok := servers["demo"].(map[string]any) + if !ok || !reflect.DeepEqual(owned["autoApprove"], []any{"read_docs"}) { + t.Fatalf("Kiro exact approved tool was not installed: %s", body) + } + if _, err := os.Stat(filepath.Join(client.ConfigRoot, "settings", "permissions.yaml")); !os.IsNotExist(err) { + t.Fatalf("unexpected global Kiro trust: %v", err) + } + } + for _, action := range []string{"add", "add", "repair"} { + args := []string{action, source, "--target", "kiro", "--format", "json"} + if action == "repair" { + args[1] = "demo" + } + out, stderr, err := fixture.execute(false, args...) + if err != nil { + t.Fatalf("%s failed: %s %s (%v)", action, out, stderr, err) + } + if !strings.Contains(out, "prepared") { + t.Fatalf("%s falsely claims native activation or lost preparation: %s", action, out) + } + assertNative() + } + state, err := fixture.store.Load() + if err != nil || len(state.Installations) != 1 || len(state.Installations[0].Clients) != 1 { + t.Fatalf("unexpected persisted installation: %+v, %v", state, err) + } + if state.Installations[0].Clients[0].InstallIntent != domain.InstallIntentPrepare { + t.Fatal("Kiro installation lost prepared runtime boundary") + } +} From 7192bdb80fd9889ac515e8e410d9c0057a9505f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:47:34 +0200 Subject: [PATCH 15/52] fix(kiro): fail closed on noncanonical approval metadata keys --- .../agentplugins/clients/kiro/mcp_approvals.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go index a22bf4fc41..5d70f9071e 100644 --- a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go +++ b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go @@ -43,9 +43,16 @@ func decodeMCPApprovals(raw json.RawMessage) (mcpApprovals, error) { if len(raw) == 0 || len(raw) > 16<<10 { return value, fmt.Errorf("Kiro MCP approval extension exceeds its limit") } - if _, err := shared.DecodeStrictJSONObject(raw); err != nil { + fields, err := shared.DecodeStrictJSONObject(raw) + if err != nil { return value, fmt.Errorf("invalid Kiro MCP approval object: %w", err) } + // encoding/json accepts field names case-insensitively by default. Kiro's + // trust declaration is an exact, versioned contract: refuse aliases. + _, hasServers := fields["mcp_auto_approve"] + if len(fields) != 2 || fields["version"] != json.Number("1") || !hasServers { + return value, fmt.Errorf("Kiro MCP approval fields must match the exact v1 schema") + } decoder := json.NewDecoder(bytes.NewReader(raw)) decoder.DisallowUnknownFields() if err := decoder.Decode(&value); err != nil { From 08b21c8906342147ced43cac235d91b76a0ddea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:47:41 +0200 Subject: [PATCH 16/52] test(kiro): reject case-insensitive and noncanonical tool trust declarations --- .../agentplugins/clients/kiro/mcp_approvals_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go index 442b0c40f0..55dd90381a 100644 --- a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go +++ b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go @@ -54,6 +54,9 @@ func TestKiroNamedMCPApprovalSchemaFailClosed(t *testing.T) { "duplicate-tool": `{"version":1,"mcp_auto_approve":{"docs":["read","read"]}}`, "duplicate-server": `{"version":1,"mcp_auto_approve":{"docs":["read"],"docs":["write"]}}`, "unknown-field": `{"version":1,"mcp_auto_approve":{"docs":["read"]},"all_tools":true}`, + "field-alias": `{"Version":1,"mcp_auto_approve":{"docs":["read"]}}`, + "field-alias-server": `{"version":1,"MCP_AUTO_APPROVE":{"docs":["read"]}}`, + "noncanonical-number": `{"version":1.0,"mcp_auto_approve":{"docs":["read"]}}`, "wrong-shape": `{"version":1,"mcp_auto_approve":{"docs":"read"}}`, "null": `{"version":1,"mcp_auto_approve":null}`, "trailing-content": valid + " {}", From 76842518995d0dfdacf1bdf07b4e694bf11a97fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:49:12 +0200 Subject: [PATCH 17/52] ci(kiro): require exact CLI and SDK trust lifecycle proofs on three OS --- .../workflows/kiro-no-auth-installation.yml | 375 +++++++++++++++++- 1 file changed, 374 insertions(+), 1 deletion(-) diff --git a/.github/workflows/kiro-no-auth-installation.yml b/.github/workflows/kiro-no-auth-installation.yml index da2699e565..0052057642 100644 --- a/.github/workflows/kiro-no-auth-installation.yml +++ b/.github/workflows/kiro-no-auth-installation.yml @@ -84,7 +84,380 @@ jobs: - name: Run SDK repair cold-restart retained-data removal lifecycle shell: bash working-directory: install/integrationctl/agentplugins - run: go test -json -count=1 -timeout=180s ./installer -run '^Test(ProjectKiroPublicSDKStdioDataRepairRestartAndRemove|FacadeHostedPreparation(PinsIntentAndSnapshot|PreservesAutomaticAndOtherFailures|RefusesAppearingRetainedInstallation|PreservesRecordedModesAndOwnership|EligibilityDoesNotBroadenScopeOrConsent|RejectsRetainedStateAtMutationLock))$' | tee "$RUNNER_TEMP/kiro-composed-sdk.log" + run: go test -json -count=1 -timeout=180s ./installer -run '^Test(ProjectKiroPublicSDKStdioDataRepairRestartAndRemove|FacadeHostedPreparation(PinsIntentAndSnapshot|PreservesAutomaticAndOtherFailures|RefusesAppearingRetainedInstallation|PreservesRecordedModesAndOwnership|EligibilityDoesNotBroadenScopeOrConsent|RejectsRetainedStateAtMutationLock)) - name: Admit actual named cases and unchanged source + if: ${{ always() }} + shell: bash + run: | + python3 - <<'PYTHON' + import hashlib, json, os, subprocess + from pathlib import Path + root = Path(os.environ['RUNNER_TEMP']) + before = json.loads((root / 'kiro-composed-source-before.json').read_text()) + def git(*args): + return subprocess.check_output(['git', *args], text=True).strip() + after = {'commit': git('rev-parse', 'HEAD'), 'tree': git('rev-parse', 'HEAD^{tree}'), + 'status': git('status', '--porcelain', '--untracked-files=normal')} + if before != after or after['status'] or after['commit'] != os.environ['EXPECTED_COMMIT']: + raise SystemExit('source changed during lifecycle') + cli = 'TestProjectKiroComposedSourceLifecycle' + continuity = 'TestKiroContinuityRejectsDetachedAuthority' + required = {'cli': [cli, cli + '/git', cli + '/git/user', cli + '/zip', cli + '/zip/user', + continuity, continuity + '/unchanged', continuity + '/appended-receipt', + continuity + '/source', continuity + '/installation', continuity + '/binding', + continuity + '/data', continuity + '/receipt-history', + 'TestKiroUserArchivePreservesAuthoredBytesWithAutocrlf', + 'TestKiroUserArchivePreservesAuthoredSkillWithAutocrlf'], + 'sdk': ['TestProjectKiroPublicSDKStdioDataRepairRestartAndRemove', + 'TestFacadeHostedPreparationPinsIntentAndSnapshot', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/available', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/wrapped-preflight', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/second-check-available', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/canceled', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/invalid-source', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/project', + 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation', + 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/retry', + 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/apply', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/recorded-automatic', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/retained-preference', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/owned-drift', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/supported', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/unsupported', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/project', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/personal-mapping', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/attested', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/update', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/recorded', + 'TestFacadeHostedPreparationRejectsRetainedStateAtMutationLock'], + 'cli-trust': ['TestKiroPublisherMCPApprovalsFullCLI'], + 'sdk-trust': ['TestKiroApprovalPreviewAndNoUnselectedPrivilege', + 'TestKiroExactMCPApprovalDisposableLifecycle', + 'TestKiroExactMCPApprovalDisposableLifecycle/install', + 'TestKiroExactMCPApprovalDisposableLifecycle/repeat', + 'TestKiroExactMCPApprovalDisposableLifecycle/update', + 'TestKiroExactMCPApprovalDisposableLifecycle/repair', + 'TestKiroProjectApprovalDoesNotForgeWorkspaceTrust']} + receipts = [] + for label, tests in required.items(): + path = root / ('kiro-composed-' + label + '.log') + if path.stat().st_size > 8 * 1024 * 1024: + raise SystemExit('unbounded Go JSON log') + body = path.read_bytes() + rows = [json.loads(line) for line in body.splitlines()] + if not rows or any(row.get('Action') in ('fail', 'skip') for row in rows): + raise SystemExit('failed, skipped or empty lifecycle') + packages = {row.get('Package') for row in rows} + if len(packages) != 1 or not all(packages) or sum(row.get('Action') == 'pass' and 'Test' not in row for row in rows) != 1: + raise SystemExit('exact passing package required') + observed = {row['Test'] for row in rows if row.get('Action') in ('run', 'pass') and 'Test' in row} + if observed != set(tests) or any([row['Action'] for row in rows if row.get('Test') == test and row.get('Action') in ('run', 'pass')] != ['run', 'pass'] for test in tests): + raise SystemExit('exact named RUN/PASS cases required') + receipts.append({'log': path.name, 'bytes': len(body), 'sha256': hashlib.sha256(body).hexdigest(), + 'package': next(iter(packages)), 'tests': tests}) + receipt = {'source_before': before, 'source_after': after, 'logs': receipts, + 'qualification': 'UAP composed installation only; inert discovery/security/helper seams; no native Kiro loading'} + (root / 'kiro-composed-admission.json').write_text(json.dumps(receipt, sort_keys=True, indent=2) + '\n') + print('PASS: exact CLI Git/ZIP, SDK and Kiro scoped approval RUN/PASS cases on the immutable source') + PYTHON + - name: Preserve actual lifecycle logs and source admission + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: kiro-no-auth-uap-${{ matrix.os }} + path: | + ${{ runner.temp }}/kiro-composed-*.log + ${{ runner.temp }}/kiro-composed-source-before.json + ${{ runner.temp }}/kiro-composed-admission.json + if-no-files-found: error + retention-days: 14 + native: + name: Pinned Kiro no-auth observations + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full')) }} + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Test finite no-auth routes and preservation contracts + run: python3 -m unittest discover -s scripts -p 'test_project_native_kiro_no_auth.py' -v + - name: Capture real pinned help validation and expected auth refusals + env: + AGENTPLUGINS_NATIVE_DISPOSABLE_HOSTED: '1' + run: python3 scripts/project_native_kiro_no_auth.py --output "$RUNNER_TEMP/kiro-no-auth-native" + - name: Preserve original bounded native evidence + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: kiro-no-auth-native-linux-amd64 + path: ${{ runner.temp }}/kiro-no-auth-native/upload/research.zip + if-no-files-found: error + retention-days: 14 + acceptance: + name: Kiro no-auth acceptance + needs: [lifecycle, native] + if: ${{ always() && (github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full'))) }} + runs-on: ubuntu-24.04 + steps: + - name: Require actual completed lifecycle and native contracts + env: + LIFECYCLE: ${{ needs.lifecycle.result }} + NATIVE: ${{ needs.native.result }} + run: | + test "$LIFECYCLE" = success + test "$NATIVE" = success + echo 'PASS: declared no-auth UAP installation and separately admitted native observations only; no authentication, model, native MCP or loaded-client lifecycle qualification.' + | tee "$RUNNER_TEMP/kiro-composed-sdk.log" + - name: Run public CLI manifest-to-native tool approvals lifecycle + shell: bash + working-directory: cli + run: go test -json -count=1 -timeout=180s ./internal/agentpluginscli -run '^TestKiroPublisherMCPApprovalsFullCLI - name: Admit actual named cases and unchanged source + if: ${{ always() }} + shell: bash + run: | + python3 - <<'PYTHON' + import hashlib, json, os, subprocess + from pathlib import Path + root = Path(os.environ['RUNNER_TEMP']) + before = json.loads((root / 'kiro-composed-source-before.json').read_text()) + def git(*args): + return subprocess.check_output(['git', *args], text=True).strip() + after = {'commit': git('rev-parse', 'HEAD'), 'tree': git('rev-parse', 'HEAD^{tree}'), + 'status': git('status', '--porcelain', '--untracked-files=normal')} + if before != after or after['status'] or after['commit'] != os.environ['EXPECTED_COMMIT']: + raise SystemExit('source changed during lifecycle') + cli = 'TestProjectKiroComposedSourceLifecycle' + continuity = 'TestKiroContinuityRejectsDetachedAuthority' + required = {'cli': [cli, cli + '/git', cli + '/git/user', cli + '/zip', cli + '/zip/user', + continuity, continuity + '/unchanged', continuity + '/appended-receipt', + continuity + '/source', continuity + '/installation', continuity + '/binding', + continuity + '/data', continuity + '/receipt-history', + 'TestKiroUserArchivePreservesAuthoredBytesWithAutocrlf', + 'TestKiroUserArchivePreservesAuthoredSkillWithAutocrlf'], + 'sdk': ['TestProjectKiroPublicSDKStdioDataRepairRestartAndRemove', + 'TestFacadeHostedPreparationPinsIntentAndSnapshot', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/available', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/wrapped-preflight', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/second-check-available', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/canceled', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/invalid-source', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/project', + 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation', + 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/retry', + 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/apply', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/recorded-automatic', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/retained-preference', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/owned-drift', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/supported', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/unsupported', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/project', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/personal-mapping', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/attested', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/update', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/recorded', + 'TestFacadeHostedPreparationRejectsRetainedStateAtMutationLock']} + receipts = [] + for label, tests in required.items(): + path = root / ('kiro-composed-' + label + '.log') + if path.stat().st_size > 8 * 1024 * 1024: + raise SystemExit('unbounded Go JSON log') + body = path.read_bytes() + rows = [json.loads(line) for line in body.splitlines()] + if not rows or any(row.get('Action') in ('fail', 'skip') for row in rows): + raise SystemExit('failed, skipped or empty lifecycle') + packages = {row.get('Package') for row in rows} + if len(packages) != 1 or not all(packages) or sum(row.get('Action') == 'pass' and 'Test' not in row for row in rows) != 1: + raise SystemExit('exact passing package required') + observed = {row['Test'] for row in rows if row.get('Action') in ('run', 'pass') and 'Test' in row} + if observed != set(tests) or any([row['Action'] for row in rows if row.get('Test') == test and row.get('Action') in ('run', 'pass')] != ['run', 'pass'] for test in tests): + raise SystemExit('exact named RUN/PASS cases required') + receipts.append({'log': path.name, 'bytes': len(body), 'sha256': hashlib.sha256(body).hexdigest(), + 'package': next(iter(packages)), 'tests': tests}) + receipt = {'source_before': before, 'source_after': after, 'logs': receipts, + 'qualification': 'UAP composed installation only; inert discovery/security/helper seams; no native Kiro loading'} + (root / 'kiro-composed-admission.json').write_text(json.dumps(receipt, sort_keys=True, indent=2) + '\n') + print('PASS: exact CLI Git/ZIP and SDK lifecycle RUN/PASS cases; clean source preserved') + PYTHON + - name: Preserve actual lifecycle logs and source admission + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: kiro-no-auth-uap-${{ matrix.os }} + path: | + ${{ runner.temp }}/kiro-composed-*.log + ${{ runner.temp }}/kiro-composed-source-before.json + ${{ runner.temp }}/kiro-composed-admission.json + if-no-files-found: error + retention-days: 14 + native: + name: Pinned Kiro no-auth observations + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full')) }} + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Test finite no-auth routes and preservation contracts + run: python3 -m unittest discover -s scripts -p 'test_project_native_kiro_no_auth.py' -v + - name: Capture real pinned help validation and expected auth refusals + env: + AGENTPLUGINS_NATIVE_DISPOSABLE_HOSTED: '1' + run: python3 scripts/project_native_kiro_no_auth.py --output "$RUNNER_TEMP/kiro-no-auth-native" + - name: Preserve original bounded native evidence + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: kiro-no-auth-native-linux-amd64 + path: ${{ runner.temp }}/kiro-no-auth-native/upload/research.zip + if-no-files-found: error + retention-days: 14 + acceptance: + name: Kiro no-auth acceptance + needs: [lifecycle, native] + if: ${{ always() && (github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full'))) }} + runs-on: ubuntu-24.04 + steps: + - name: Require actual completed lifecycle and native contracts + env: + LIFECYCLE: ${{ needs.lifecycle.result }} + NATIVE: ${{ needs.native.result }} + run: | + test "$LIFECYCLE" = success + test "$NATIVE" = success + echo 'PASS: declared no-auth UAP installation and separately admitted native observations only; no authentication, model, native MCP or loaded-client lifecycle qualification.' + | tee "$RUNNER_TEMP/kiro-composed-cli-trust.log" + - name: Run Kiro exact approval, project safety and native ownership lifecycle + shell: bash + working-directory: install/integrationctl/agentplugins + run: go test -json -count=1 -timeout=180s ./clients/kiro -run '^TestKiro(ApprovalPreviewAndNoUnselectedPrivilege|ExactMCPApprovalDisposableLifecycle|ProjectApprovalDoesNotForgeWorkspaceTrust) - name: Admit actual named cases and unchanged source + if: ${{ always() }} + shell: bash + run: | + python3 - <<'PYTHON' + import hashlib, json, os, subprocess + from pathlib import Path + root = Path(os.environ['RUNNER_TEMP']) + before = json.loads((root / 'kiro-composed-source-before.json').read_text()) + def git(*args): + return subprocess.check_output(['git', *args], text=True).strip() + after = {'commit': git('rev-parse', 'HEAD'), 'tree': git('rev-parse', 'HEAD^{tree}'), + 'status': git('status', '--porcelain', '--untracked-files=normal')} + if before != after or after['status'] or after['commit'] != os.environ['EXPECTED_COMMIT']: + raise SystemExit('source changed during lifecycle') + cli = 'TestProjectKiroComposedSourceLifecycle' + continuity = 'TestKiroContinuityRejectsDetachedAuthority' + required = {'cli': [cli, cli + '/git', cli + '/git/user', cli + '/zip', cli + '/zip/user', + continuity, continuity + '/unchanged', continuity + '/appended-receipt', + continuity + '/source', continuity + '/installation', continuity + '/binding', + continuity + '/data', continuity + '/receipt-history', + 'TestKiroUserArchivePreservesAuthoredBytesWithAutocrlf', + 'TestKiroUserArchivePreservesAuthoredSkillWithAutocrlf'], + 'sdk': ['TestProjectKiroPublicSDKStdioDataRepairRestartAndRemove', + 'TestFacadeHostedPreparationPinsIntentAndSnapshot', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/available', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/wrapped-preflight', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/second-check-available', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/canceled', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/invalid-source', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/project', + 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation', + 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/retry', + 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/apply', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/recorded-automatic', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/retained-preference', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/owned-drift', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/supported', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/unsupported', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/project', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/personal-mapping', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/attested', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/update', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/recorded', + 'TestFacadeHostedPreparationRejectsRetainedStateAtMutationLock']} + receipts = [] + for label, tests in required.items(): + path = root / ('kiro-composed-' + label + '.log') + if path.stat().st_size > 8 * 1024 * 1024: + raise SystemExit('unbounded Go JSON log') + body = path.read_bytes() + rows = [json.loads(line) for line in body.splitlines()] + if not rows or any(row.get('Action') in ('fail', 'skip') for row in rows): + raise SystemExit('failed, skipped or empty lifecycle') + packages = {row.get('Package') for row in rows} + if len(packages) != 1 or not all(packages) or sum(row.get('Action') == 'pass' and 'Test' not in row for row in rows) != 1: + raise SystemExit('exact passing package required') + observed = {row['Test'] for row in rows if row.get('Action') in ('run', 'pass') and 'Test' in row} + if observed != set(tests) or any([row['Action'] for row in rows if row.get('Test') == test and row.get('Action') in ('run', 'pass')] != ['run', 'pass'] for test in tests): + raise SystemExit('exact named RUN/PASS cases required') + receipts.append({'log': path.name, 'bytes': len(body), 'sha256': hashlib.sha256(body).hexdigest(), + 'package': next(iter(packages)), 'tests': tests}) + receipt = {'source_before': before, 'source_after': after, 'logs': receipts, + 'qualification': 'UAP composed installation only; inert discovery/security/helper seams; no native Kiro loading'} + (root / 'kiro-composed-admission.json').write_text(json.dumps(receipt, sort_keys=True, indent=2) + '\n') + print('PASS: exact CLI Git/ZIP and SDK lifecycle RUN/PASS cases; clean source preserved') + PYTHON + - name: Preserve actual lifecycle logs and source admission + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: kiro-no-auth-uap-${{ matrix.os }} + path: | + ${{ runner.temp }}/kiro-composed-*.log + ${{ runner.temp }}/kiro-composed-source-before.json + ${{ runner.temp }}/kiro-composed-admission.json + if-no-files-found: error + retention-days: 14 + native: + name: Pinned Kiro no-auth observations + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full')) }} + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Test finite no-auth routes and preservation contracts + run: python3 -m unittest discover -s scripts -p 'test_project_native_kiro_no_auth.py' -v + - name: Capture real pinned help validation and expected auth refusals + env: + AGENTPLUGINS_NATIVE_DISPOSABLE_HOSTED: '1' + run: python3 scripts/project_native_kiro_no_auth.py --output "$RUNNER_TEMP/kiro-no-auth-native" + - name: Preserve original bounded native evidence + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: kiro-no-auth-native-linux-amd64 + path: ${{ runner.temp }}/kiro-no-auth-native/upload/research.zip + if-no-files-found: error + retention-days: 14 + acceptance: + name: Kiro no-auth acceptance + needs: [lifecycle, native] + if: ${{ always() && (github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full'))) }} + runs-on: ubuntu-24.04 + steps: + - name: Require actual completed lifecycle and native contracts + env: + LIFECYCLE: ${{ needs.lifecycle.result }} + NATIVE: ${{ needs.native.result }} + run: | + test "$LIFECYCLE" = success + test "$NATIVE" = success + echo 'PASS: declared no-auth UAP installation and separately admitted native observations only; no authentication, model, native MCP or loaded-client lifecycle qualification.' + | tee "$RUNNER_TEMP/kiro-composed-sdk-trust.log" - name: Admit actual named cases and unchanged source if: ${{ always() }} shell: bash From cac9d596f67ba49e3c6b9123b958e866865d7b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:49:31 +0200 Subject: [PATCH 18/52] fix(ci/kiro): keep YAML intact while admitting exact three-OS approval tests --- .../workflows/kiro-no-auth-installation.yml | 377 +----------------- 1 file changed, 10 insertions(+), 367 deletions(-) diff --git a/.github/workflows/kiro-no-auth-installation.yml b/.github/workflows/kiro-no-auth-installation.yml index 0052057642..1cbcfa881e 100644 --- a/.github/workflows/kiro-no-auth-installation.yml +++ b/.github/workflows/kiro-no-auth-installation.yml @@ -84,7 +84,16 @@ jobs: - name: Run SDK repair cold-restart retained-data removal lifecycle shell: bash working-directory: install/integrationctl/agentplugins - run: go test -json -count=1 -timeout=180s ./installer -run '^Test(ProjectKiroPublicSDKStdioDataRepairRestartAndRemove|FacadeHostedPreparation(PinsIntentAndSnapshot|PreservesAutomaticAndOtherFailures|RefusesAppearingRetainedInstallation|PreservesRecordedModesAndOwnership|EligibilityDoesNotBroadenScopeOrConsent|RejectsRetainedStateAtMutationLock)) - name: Admit actual named cases and unchanged source + run: go test -json -count=1 -timeout=180s ./installer -run '^Test(ProjectKiroPublicSDKStdioDataRepairRestartAndRemove|FacadeHostedPreparation(PinsIntentAndSnapshot|PreservesAutomaticAndOtherFailures|RefusesAppearingRetainedInstallation|PreservesRecordedModesAndOwnership|EligibilityDoesNotBroadenScopeOrConsent|RejectsRetainedStateAtMutationLock))$' | tee "$RUNNER_TEMP/kiro-composed-sdk.log" + - name: Run public CLI manifest-to-native tool approvals lifecycle + shell: bash + working-directory: cli + run: go test -json -count=1 -timeout=180s ./internal/agentpluginscli -run '^TestKiroPublisherMCPApprovalsFullCLI$' | tee "$RUNNER_TEMP/kiro-composed-cli-trust.log" + - name: Run Kiro exact approval, project safety and native ownership lifecycle + shell: bash + working-directory: install/integrationctl/agentplugins + run: go test -json -count=1 -timeout=180s ./clients/kiro -run '^TestKiro(ApprovalPreviewAndNoUnselectedPrivilege|ExactMCPApprovalDisposableLifecycle|ProjectApprovalDoesNotForgeWorkspaceTrust)$' | tee "$RUNNER_TEMP/kiro-composed-sdk-trust.log" + - name: Admit actual named cases and unchanged source if: ${{ always() }} shell: bash run: | @@ -211,369 +220,3 @@ jobs: test "$LIFECYCLE" = success test "$NATIVE" = success echo 'PASS: declared no-auth UAP installation and separately admitted native observations only; no authentication, model, native MCP or loaded-client lifecycle qualification.' - | tee "$RUNNER_TEMP/kiro-composed-sdk.log" - - name: Run public CLI manifest-to-native tool approvals lifecycle - shell: bash - working-directory: cli - run: go test -json -count=1 -timeout=180s ./internal/agentpluginscli -run '^TestKiroPublisherMCPApprovalsFullCLI - name: Admit actual named cases and unchanged source - if: ${{ always() }} - shell: bash - run: | - python3 - <<'PYTHON' - import hashlib, json, os, subprocess - from pathlib import Path - root = Path(os.environ['RUNNER_TEMP']) - before = json.loads((root / 'kiro-composed-source-before.json').read_text()) - def git(*args): - return subprocess.check_output(['git', *args], text=True).strip() - after = {'commit': git('rev-parse', 'HEAD'), 'tree': git('rev-parse', 'HEAD^{tree}'), - 'status': git('status', '--porcelain', '--untracked-files=normal')} - if before != after or after['status'] or after['commit'] != os.environ['EXPECTED_COMMIT']: - raise SystemExit('source changed during lifecycle') - cli = 'TestProjectKiroComposedSourceLifecycle' - continuity = 'TestKiroContinuityRejectsDetachedAuthority' - required = {'cli': [cli, cli + '/git', cli + '/git/user', cli + '/zip', cli + '/zip/user', - continuity, continuity + '/unchanged', continuity + '/appended-receipt', - continuity + '/source', continuity + '/installation', continuity + '/binding', - continuity + '/data', continuity + '/receipt-history', - 'TestKiroUserArchivePreservesAuthoredBytesWithAutocrlf', - 'TestKiroUserArchivePreservesAuthoredSkillWithAutocrlf'], - 'sdk': ['TestProjectKiroPublicSDKStdioDataRepairRestartAndRemove', - 'TestFacadeHostedPreparationPinsIntentAndSnapshot', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/available', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/wrapped-preflight', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/second-check-available', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/canceled', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/invalid-source', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/project', - 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation', - 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/retry', - 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/apply', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/recorded-automatic', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/retained-preference', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/owned-drift', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/supported', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/unsupported', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/project', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/personal-mapping', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/attested', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/update', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/recorded', - 'TestFacadeHostedPreparationRejectsRetainedStateAtMutationLock']} - receipts = [] - for label, tests in required.items(): - path = root / ('kiro-composed-' + label + '.log') - if path.stat().st_size > 8 * 1024 * 1024: - raise SystemExit('unbounded Go JSON log') - body = path.read_bytes() - rows = [json.loads(line) for line in body.splitlines()] - if not rows or any(row.get('Action') in ('fail', 'skip') for row in rows): - raise SystemExit('failed, skipped or empty lifecycle') - packages = {row.get('Package') for row in rows} - if len(packages) != 1 or not all(packages) or sum(row.get('Action') == 'pass' and 'Test' not in row for row in rows) != 1: - raise SystemExit('exact passing package required') - observed = {row['Test'] for row in rows if row.get('Action') in ('run', 'pass') and 'Test' in row} - if observed != set(tests) or any([row['Action'] for row in rows if row.get('Test') == test and row.get('Action') in ('run', 'pass')] != ['run', 'pass'] for test in tests): - raise SystemExit('exact named RUN/PASS cases required') - receipts.append({'log': path.name, 'bytes': len(body), 'sha256': hashlib.sha256(body).hexdigest(), - 'package': next(iter(packages)), 'tests': tests}) - receipt = {'source_before': before, 'source_after': after, 'logs': receipts, - 'qualification': 'UAP composed installation only; inert discovery/security/helper seams; no native Kiro loading'} - (root / 'kiro-composed-admission.json').write_text(json.dumps(receipt, sort_keys=True, indent=2) + '\n') - print('PASS: exact CLI Git/ZIP and SDK lifecycle RUN/PASS cases; clean source preserved') - PYTHON - - name: Preserve actual lifecycle logs and source admission - if: ${{ always() }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 - with: - name: kiro-no-auth-uap-${{ matrix.os }} - path: | - ${{ runner.temp }}/kiro-composed-*.log - ${{ runner.temp }}/kiro-composed-source-before.json - ${{ runner.temp }}/kiro-composed-admission.json - if-no-files-found: error - retention-days: 14 - native: - name: Pinned Kiro no-auth observations - if: ${{ github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full')) }} - runs-on: ubuntu-24.04 - timeout-minutes: 10 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - ref: ${{ github.event.pull_request.head.sha || github.sha }} - - name: Test finite no-auth routes and preservation contracts - run: python3 -m unittest discover -s scripts -p 'test_project_native_kiro_no_auth.py' -v - - name: Capture real pinned help validation and expected auth refusals - env: - AGENTPLUGINS_NATIVE_DISPOSABLE_HOSTED: '1' - run: python3 scripts/project_native_kiro_no_auth.py --output "$RUNNER_TEMP/kiro-no-auth-native" - - name: Preserve original bounded native evidence - if: ${{ always() }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 - with: - name: kiro-no-auth-native-linux-amd64 - path: ${{ runner.temp }}/kiro-no-auth-native/upload/research.zip - if-no-files-found: error - retention-days: 14 - acceptance: - name: Kiro no-auth acceptance - needs: [lifecycle, native] - if: ${{ always() && (github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full'))) }} - runs-on: ubuntu-24.04 - steps: - - name: Require actual completed lifecycle and native contracts - env: - LIFECYCLE: ${{ needs.lifecycle.result }} - NATIVE: ${{ needs.native.result }} - run: | - test "$LIFECYCLE" = success - test "$NATIVE" = success - echo 'PASS: declared no-auth UAP installation and separately admitted native observations only; no authentication, model, native MCP or loaded-client lifecycle qualification.' - | tee "$RUNNER_TEMP/kiro-composed-cli-trust.log" - - name: Run Kiro exact approval, project safety and native ownership lifecycle - shell: bash - working-directory: install/integrationctl/agentplugins - run: go test -json -count=1 -timeout=180s ./clients/kiro -run '^TestKiro(ApprovalPreviewAndNoUnselectedPrivilege|ExactMCPApprovalDisposableLifecycle|ProjectApprovalDoesNotForgeWorkspaceTrust) - name: Admit actual named cases and unchanged source - if: ${{ always() }} - shell: bash - run: | - python3 - <<'PYTHON' - import hashlib, json, os, subprocess - from pathlib import Path - root = Path(os.environ['RUNNER_TEMP']) - before = json.loads((root / 'kiro-composed-source-before.json').read_text()) - def git(*args): - return subprocess.check_output(['git', *args], text=True).strip() - after = {'commit': git('rev-parse', 'HEAD'), 'tree': git('rev-parse', 'HEAD^{tree}'), - 'status': git('status', '--porcelain', '--untracked-files=normal')} - if before != after or after['status'] or after['commit'] != os.environ['EXPECTED_COMMIT']: - raise SystemExit('source changed during lifecycle') - cli = 'TestProjectKiroComposedSourceLifecycle' - continuity = 'TestKiroContinuityRejectsDetachedAuthority' - required = {'cli': [cli, cli + '/git', cli + '/git/user', cli + '/zip', cli + '/zip/user', - continuity, continuity + '/unchanged', continuity + '/appended-receipt', - continuity + '/source', continuity + '/installation', continuity + '/binding', - continuity + '/data', continuity + '/receipt-history', - 'TestKiroUserArchivePreservesAuthoredBytesWithAutocrlf', - 'TestKiroUserArchivePreservesAuthoredSkillWithAutocrlf'], - 'sdk': ['TestProjectKiroPublicSDKStdioDataRepairRestartAndRemove', - 'TestFacadeHostedPreparationPinsIntentAndSnapshot', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/available', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/wrapped-preflight', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/second-check-available', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/canceled', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/invalid-source', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/project', - 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation', - 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/retry', - 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/apply', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/recorded-automatic', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/retained-preference', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/owned-drift', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/supported', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/unsupported', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/project', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/personal-mapping', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/attested', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/update', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/recorded', - 'TestFacadeHostedPreparationRejectsRetainedStateAtMutationLock']} - receipts = [] - for label, tests in required.items(): - path = root / ('kiro-composed-' + label + '.log') - if path.stat().st_size > 8 * 1024 * 1024: - raise SystemExit('unbounded Go JSON log') - body = path.read_bytes() - rows = [json.loads(line) for line in body.splitlines()] - if not rows or any(row.get('Action') in ('fail', 'skip') for row in rows): - raise SystemExit('failed, skipped or empty lifecycle') - packages = {row.get('Package') for row in rows} - if len(packages) != 1 or not all(packages) or sum(row.get('Action') == 'pass' and 'Test' not in row for row in rows) != 1: - raise SystemExit('exact passing package required') - observed = {row['Test'] for row in rows if row.get('Action') in ('run', 'pass') and 'Test' in row} - if observed != set(tests) or any([row['Action'] for row in rows if row.get('Test') == test and row.get('Action') in ('run', 'pass')] != ['run', 'pass'] for test in tests): - raise SystemExit('exact named RUN/PASS cases required') - receipts.append({'log': path.name, 'bytes': len(body), 'sha256': hashlib.sha256(body).hexdigest(), - 'package': next(iter(packages)), 'tests': tests}) - receipt = {'source_before': before, 'source_after': after, 'logs': receipts, - 'qualification': 'UAP composed installation only; inert discovery/security/helper seams; no native Kiro loading'} - (root / 'kiro-composed-admission.json').write_text(json.dumps(receipt, sort_keys=True, indent=2) + '\n') - print('PASS: exact CLI Git/ZIP and SDK lifecycle RUN/PASS cases; clean source preserved') - PYTHON - - name: Preserve actual lifecycle logs and source admission - if: ${{ always() }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 - with: - name: kiro-no-auth-uap-${{ matrix.os }} - path: | - ${{ runner.temp }}/kiro-composed-*.log - ${{ runner.temp }}/kiro-composed-source-before.json - ${{ runner.temp }}/kiro-composed-admission.json - if-no-files-found: error - retention-days: 14 - native: - name: Pinned Kiro no-auth observations - if: ${{ github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full')) }} - runs-on: ubuntu-24.04 - timeout-minutes: 10 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - ref: ${{ github.event.pull_request.head.sha || github.sha }} - - name: Test finite no-auth routes and preservation contracts - run: python3 -m unittest discover -s scripts -p 'test_project_native_kiro_no_auth.py' -v - - name: Capture real pinned help validation and expected auth refusals - env: - AGENTPLUGINS_NATIVE_DISPOSABLE_HOSTED: '1' - run: python3 scripts/project_native_kiro_no_auth.py --output "$RUNNER_TEMP/kiro-no-auth-native" - - name: Preserve original bounded native evidence - if: ${{ always() }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 - with: - name: kiro-no-auth-native-linux-amd64 - path: ${{ runner.temp }}/kiro-no-auth-native/upload/research.zip - if-no-files-found: error - retention-days: 14 - acceptance: - name: Kiro no-auth acceptance - needs: [lifecycle, native] - if: ${{ always() && (github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full'))) }} - runs-on: ubuntu-24.04 - steps: - - name: Require actual completed lifecycle and native contracts - env: - LIFECYCLE: ${{ needs.lifecycle.result }} - NATIVE: ${{ needs.native.result }} - run: | - test "$LIFECYCLE" = success - test "$NATIVE" = success - echo 'PASS: declared no-auth UAP installation and separately admitted native observations only; no authentication, model, native MCP or loaded-client lifecycle qualification.' - | tee "$RUNNER_TEMP/kiro-composed-sdk-trust.log" - - name: Admit actual named cases and unchanged source - if: ${{ always() }} - shell: bash - run: | - python3 - <<'PYTHON' - import hashlib, json, os, subprocess - from pathlib import Path - root = Path(os.environ['RUNNER_TEMP']) - before = json.loads((root / 'kiro-composed-source-before.json').read_text()) - def git(*args): - return subprocess.check_output(['git', *args], text=True).strip() - after = {'commit': git('rev-parse', 'HEAD'), 'tree': git('rev-parse', 'HEAD^{tree}'), - 'status': git('status', '--porcelain', '--untracked-files=normal')} - if before != after or after['status'] or after['commit'] != os.environ['EXPECTED_COMMIT']: - raise SystemExit('source changed during lifecycle') - cli = 'TestProjectKiroComposedSourceLifecycle' - continuity = 'TestKiroContinuityRejectsDetachedAuthority' - required = {'cli': [cli, cli + '/git', cli + '/git/user', cli + '/zip', cli + '/zip/user', - continuity, continuity + '/unchanged', continuity + '/appended-receipt', - continuity + '/source', continuity + '/installation', continuity + '/binding', - continuity + '/data', continuity + '/receipt-history', - 'TestKiroUserArchivePreservesAuthoredBytesWithAutocrlf', - 'TestKiroUserArchivePreservesAuthoredSkillWithAutocrlf'], - 'sdk': ['TestProjectKiroPublicSDKStdioDataRepairRestartAndRemove', - 'TestFacadeHostedPreparationPinsIntentAndSnapshot', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/available', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/wrapped-preflight', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/second-check-available', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/canceled', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/invalid-source', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/project', - 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation', - 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/retry', - 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/apply', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/recorded-automatic', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/retained-preference', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/owned-drift', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/supported', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/unsupported', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/project', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/personal-mapping', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/attested', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/update', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/recorded', - 'TestFacadeHostedPreparationRejectsRetainedStateAtMutationLock']} - receipts = [] - for label, tests in required.items(): - path = root / ('kiro-composed-' + label + '.log') - if path.stat().st_size > 8 * 1024 * 1024: - raise SystemExit('unbounded Go JSON log') - body = path.read_bytes() - rows = [json.loads(line) for line in body.splitlines()] - if not rows or any(row.get('Action') in ('fail', 'skip') for row in rows): - raise SystemExit('failed, skipped or empty lifecycle') - packages = {row.get('Package') for row in rows} - if len(packages) != 1 or not all(packages) or sum(row.get('Action') == 'pass' and 'Test' not in row for row in rows) != 1: - raise SystemExit('exact passing package required') - observed = {row['Test'] for row in rows if row.get('Action') in ('run', 'pass') and 'Test' in row} - if observed != set(tests) or any([row['Action'] for row in rows if row.get('Test') == test and row.get('Action') in ('run', 'pass')] != ['run', 'pass'] for test in tests): - raise SystemExit('exact named RUN/PASS cases required') - receipts.append({'log': path.name, 'bytes': len(body), 'sha256': hashlib.sha256(body).hexdigest(), - 'package': next(iter(packages)), 'tests': tests}) - receipt = {'source_before': before, 'source_after': after, 'logs': receipts, - 'qualification': 'UAP composed installation only; inert discovery/security/helper seams; no native Kiro loading'} - (root / 'kiro-composed-admission.json').write_text(json.dumps(receipt, sort_keys=True, indent=2) + '\n') - print('PASS: exact CLI Git/ZIP and SDK lifecycle RUN/PASS cases; clean source preserved') - PYTHON - - name: Preserve actual lifecycle logs and source admission - if: ${{ always() }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 - with: - name: kiro-no-auth-uap-${{ matrix.os }} - path: | - ${{ runner.temp }}/kiro-composed-*.log - ${{ runner.temp }}/kiro-composed-source-before.json - ${{ runner.temp }}/kiro-composed-admission.json - if-no-files-found: error - retention-days: 14 - native: - name: Pinned Kiro no-auth observations - if: ${{ github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full')) }} - runs-on: ubuntu-24.04 - timeout-minutes: 10 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - ref: ${{ github.event.pull_request.head.sha || github.sha }} - - name: Test finite no-auth routes and preservation contracts - run: python3 -m unittest discover -s scripts -p 'test_project_native_kiro_no_auth.py' -v - - name: Capture real pinned help validation and expected auth refusals - env: - AGENTPLUGINS_NATIVE_DISPOSABLE_HOSTED: '1' - run: python3 scripts/project_native_kiro_no_auth.py --output "$RUNNER_TEMP/kiro-no-auth-native" - - name: Preserve original bounded native evidence - if: ${{ always() }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 - with: - name: kiro-no-auth-native-linux-amd64 - path: ${{ runner.temp }}/kiro-no-auth-native/upload/research.zip - if-no-files-found: error - retention-days: 14 - acceptance: - name: Kiro no-auth acceptance - needs: [lifecycle, native] - if: ${{ always() && (github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full'))) }} - runs-on: ubuntu-24.04 - steps: - - name: Require actual completed lifecycle and native contracts - env: - LIFECYCLE: ${{ needs.lifecycle.result }} - NATIVE: ${{ needs.native.result }} - run: | - test "$LIFECYCLE" = success - test "$NATIVE" = success - echo 'PASS: declared no-auth UAP installation and separately admitted native observations only; no authentication, model, native MCP or loaded-client lifecycle qualification.' From 66b0ed2ff7c6554e23c4dea7c4cacca09af6d4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:50:31 +0200 Subject: [PATCH 19/52] test(kiro): prevent removal overwriting user-edited native tool grants --- .../clients/kiro/mcp_approvals_test.go | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go index 55dd90381a..b555aee449 100644 --- a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go +++ b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go @@ -183,6 +183,51 @@ func TestKiroExactMCPApprovalDisposableLifecycle(t *testing.T) { } } +// A previously confirmed tool allowlist belongs to the user's live config +// after installation. An out-of-band edit must not be overwritten by remove. +func TestKiroUserEditedAutoApprovalBlocksRemoval(t *testing.T) { + root := filepath.Join(t.TempDir(), ".kiro") + stage := filepath.Join(t.TempDir(), "stage") + if err := os.MkdirAll(stage, 0700); err != nil { + t.Fatal(err) + } + envelope := testKiroApprovedEnvelope(`{"version":1,"mcp_auto_approve":{"docs":["read_docs"]}}`) + plan := testKiroApprovalPlan(root, filepath.Join(t.TempDir(), "active"), domain.ScopeUser) + objects, err := New().Project(context.Background(), clients.ProjectionInput{StagingPath: stage, Plan: plan, Envelope: envelope}) + if err != nil { + t.Fatal(err) + } + if err := applyKiroNativeMutation(root, stage, nil, objects); err != nil { + t.Fatal(err) + } + config := filepath.Join(root, "settings", "mcp.json") + body, err := os.ReadFile(config) + if err != nil { + t.Fatal(err) + } + var document map[string]any + if err := json.Unmarshal(body, &document); err != nil { + t.Fatal(err) + } + servers := document["mcpServers"].(map[string]any) + server := servers["docs"].(map[string]any) + server["autoApprove"] = []string{"read_docs", "sensitive_write"} + edited, err := json.Marshal(document) + if err != nil { + t.Fatal(err) + } + if err := os.WriteFile(config, edited, 0600); err != nil { + t.Fatal(err) + } + if err := applyKiroNativeMutation(root, "", objects, nil); err == nil { + t.Fatal("remove replaced user-modified Kiro approval without consent") + } + after, err := os.ReadFile(config) + if err != nil || string(after) != string(edited) { + t.Fatalf("changed owned approval was not preserved: %v, %s", err, after) + } +} + func stringsToAny(values []string) []any { items := make([]any, len(values)) for i, value := range values { From c528aa13bb6cff81440b9bb1fdb3afb7855418ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:50:38 +0200 Subject: [PATCH 20/52] ci(kiro): admit exact modified-tool-grant ownership rejection on three OS --- .github/workflows/kiro-no-auth-installation.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kiro-no-auth-installation.yml b/.github/workflows/kiro-no-auth-installation.yml index 1cbcfa881e..e67af2697e 100644 --- a/.github/workflows/kiro-no-auth-installation.yml +++ b/.github/workflows/kiro-no-auth-installation.yml @@ -92,7 +92,7 @@ jobs: - name: Run Kiro exact approval, project safety and native ownership lifecycle shell: bash working-directory: install/integrationctl/agentplugins - run: go test -json -count=1 -timeout=180s ./clients/kiro -run '^TestKiro(ApprovalPreviewAndNoUnselectedPrivilege|ExactMCPApprovalDisposableLifecycle|ProjectApprovalDoesNotForgeWorkspaceTrust)$' | tee "$RUNNER_TEMP/kiro-composed-sdk-trust.log" + run: go test -json -count=1 -timeout=180s ./clients/kiro -run '^TestKiro(ApprovalPreviewAndNoUnselectedPrivilege|ExactMCPApprovalDisposableLifecycle|ProjectApprovalDoesNotForgeWorkspaceTrust|UserEditedAutoApprovalBlocksRemoval)$' | tee "$RUNNER_TEMP/kiro-composed-sdk-trust.log" - name: Admit actual named cases and unchanged source if: ${{ always() }} shell: bash @@ -148,7 +148,8 @@ jobs: 'TestKiroExactMCPApprovalDisposableLifecycle/repeat', 'TestKiroExactMCPApprovalDisposableLifecycle/update', 'TestKiroExactMCPApprovalDisposableLifecycle/repair', - 'TestKiroProjectApprovalDoesNotForgeWorkspaceTrust']} + 'TestKiroProjectApprovalDoesNotForgeWorkspaceTrust', + 'TestKiroUserEditedAutoApprovalBlocksRemoval']} receipts = [] for label, tests in required.items(): path = root / ('kiro-composed-' + label + '.log') From 7b50b52e15da02ff2a143f4d2ca0bf020208b8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:51:29 +0200 Subject: [PATCH 21/52] style(kiro): align exact approval negative-case table for gofmt lint --- .../clients/kiro/mcp_approvals_test.go | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go index b555aee449..df722a8d71 100644 --- a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go +++ b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go @@ -44,22 +44,22 @@ func testKiroApprovalPlan(root, active string, scope domain.InstallScope) domain func TestKiroNamedMCPApprovalSchemaFailClosed(t *testing.T) { valid := `{"version":1,"mcp_auto_approve":{"docs":["read_docs","get-library.id"]}}` for name, raw := range map[string]string{ - "empty": "", - "root": "[]", + "empty": "", + "root": "[]", "unsupported-version": `{"version":2,"mcp_auto_approve":{"docs":["read"]}}`, - "empty-list": `{"version":1,"mcp_auto_approve":{"docs":[]}}`, - "wildcard": `{"version":1,"mcp_auto_approve":{"docs":["*"]}}`, - "embedded-wildcard": `{"version":1,"mcp_auto_approve":{"docs":["read*"]}}`, - "path": `{"version":1,"mcp_auto_approve":{"docs":["../secret"]}}`, - "duplicate-tool": `{"version":1,"mcp_auto_approve":{"docs":["read","read"]}}`, - "duplicate-server": `{"version":1,"mcp_auto_approve":{"docs":["read"],"docs":["write"]}}`, - "unknown-field": `{"version":1,"mcp_auto_approve":{"docs":["read"]},"all_tools":true}`, - "field-alias": `{"Version":1,"mcp_auto_approve":{"docs":["read"]}}`, - "field-alias-server": `{"version":1,"MCP_AUTO_APPROVE":{"docs":["read"]}}`, + "empty-list": `{"version":1,"mcp_auto_approve":{"docs":[]}}`, + "wildcard": `{"version":1,"mcp_auto_approve":{"docs":["*"]}}`, + "embedded-wildcard": `{"version":1,"mcp_auto_approve":{"docs":["read*"]}}`, + "path": `{"version":1,"mcp_auto_approve":{"docs":["../secret"]}}`, + "duplicate-tool": `{"version":1,"mcp_auto_approve":{"docs":["read","read"]}}`, + "duplicate-server": `{"version":1,"mcp_auto_approve":{"docs":["read"],"docs":["write"]}}`, + "unknown-field": `{"version":1,"mcp_auto_approve":{"docs":["read"]},"all_tools":true}`, + "field-alias": `{"Version":1,"mcp_auto_approve":{"docs":["read"]}}`, + "field-alias-server": `{"version":1,"MCP_AUTO_APPROVE":{"docs":["read"]}}`, "noncanonical-number": `{"version":1.0,"mcp_auto_approve":{"docs":["read"]}}`, - "wrong-shape": `{"version":1,"mcp_auto_approve":{"docs":"read"}}`, - "null": `{"version":1,"mcp_auto_approve":null}`, - "trailing-content": valid + " {}", + "wrong-shape": `{"version":1,"mcp_auto_approve":{"docs":"read"}}`, + "null": `{"version":1,"mcp_auto_approve":null}`, + "trailing-content": valid + " {}", } { t.Run(name, func(t *testing.T) { if _, err := decodeMCPApprovals(json.RawMessage(raw)); err == nil { From 84137ff6be7b54c2162e9fee2b976e0a26fb4fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:53:52 +0200 Subject: [PATCH 22/52] test(kiro): gofmt ownership lifecycle test declaration --- .../agentplugins/clients/kiro/mcp_approvals_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go index df722a8d71..9a1c74b0f9 100644 --- a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go +++ b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go @@ -111,7 +111,7 @@ func TestKiroExactMCPApprovalDisposableLifecycle(t *testing.T) { "unrelated": 9007199254740993, "mcpServers": {"foreign": {"url": "https://foreign.test", "autoApprove": ["*"]}} }`) - var previous []domain.NativeObjectOwnership + var previous []domain.NativeObjectOwnership for _, trial := range []struct { name string list []string From d97e753eaba148e48c3126498d7841a99fe027cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:57:55 +0200 Subject: [PATCH 23/52] fix(kiro): admit scoped approval extension to automatic native verification --- .../agentplugins/clients/kiro/activate.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/install/integrationctl/agentplugins/clients/kiro/activate.go b/install/integrationctl/agentplugins/clients/kiro/activate.go index a816a9e532..1479e47cf8 100644 --- a/install/integrationctl/agentplugins/clients/kiro/activate.go +++ b/install/integrationctl/agentplugins/clients/kiro/activate.go @@ -45,18 +45,10 @@ func (*Adapter) VerifierAvailable(_ domain.DetectedClient, plan domain.DeliveryP if strings.TrimSpace(backendExecutable) == "" { return false } - if !strings.Contains(strings.ToLower(backendExecutable), "kiro") || len(plan.Components) == 0 { + if !strings.Contains(strings.ToLower(backendExecutable), "kiro") { return false } - for _, component := range plan.Components { - if component.Support == domain.SupportUnsupported { - continue - } - if component.Kind != domain.ComponentSkill && component.Kind != domain.ComponentMCPServer { - return false - } - } - return true + return kiroNativeComponents(plan.Components) } // PreflightActivation rejects a prepare request that cannot own native objects, From d93287a4ebc781465764a20d29c386cf4b5dfdd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:57:58 +0200 Subject: [PATCH 24/52] ci(kiro): admit fail-closed approval schema cases on three OS --- .../workflows/kiro-no-auth-installation.yml | 148 +++++++++++++++++- 1 file changed, 147 insertions(+), 1 deletion(-) diff --git a/.github/workflows/kiro-no-auth-installation.yml b/.github/workflows/kiro-no-auth-installation.yml index e67af2697e..af16f752c1 100644 --- a/.github/workflows/kiro-no-auth-installation.yml +++ b/.github/workflows/kiro-no-auth-installation.yml @@ -92,7 +92,153 @@ jobs: - name: Run Kiro exact approval, project safety and native ownership lifecycle shell: bash working-directory: install/integrationctl/agentplugins - run: go test -json -count=1 -timeout=180s ./clients/kiro -run '^TestKiro(ApprovalPreviewAndNoUnselectedPrivilege|ExactMCPApprovalDisposableLifecycle|ProjectApprovalDoesNotForgeWorkspaceTrust|UserEditedAutoApprovalBlocksRemoval)$' | tee "$RUNNER_TEMP/kiro-composed-sdk-trust.log" + run: go test -json -count=1 -timeout=180s ./clients/kiro -run '^TestKiro(NamedMCPApprovalSchemaFailClosed|ApprovalPreviewAndNoUnselectedPrivilege|ExactMCPApprovalDisposableLifecycle|ProjectApprovalDoesNotForgeWorkspaceTrust|UserEditedAutoApprovalBlocksRemoval) | tee "$RUNNER_TEMP/kiro-composed-sdk-trust.log" + - name: Admit actual named cases and unchanged source + if: ${{ always() }} + shell: bash + run: | + python3 - <<'PYTHON' + import hashlib, json, os, subprocess + from pathlib import Path + root = Path(os.environ['RUNNER_TEMP']) + before = json.loads((root / 'kiro-composed-source-before.json').read_text()) + def git(*args): + return subprocess.check_output(['git', *args], text=True).strip() + after = {'commit': git('rev-parse', 'HEAD'), 'tree': git('rev-parse', 'HEAD^{tree}'), + 'status': git('status', '--porcelain', '--untracked-files=normal')} + if before != after or after['status'] or after['commit'] != os.environ['EXPECTED_COMMIT']: + raise SystemExit('source changed during lifecycle') + cli = 'TestProjectKiroComposedSourceLifecycle' + continuity = 'TestKiroContinuityRejectsDetachedAuthority' + required = {'cli': [cli, cli + '/git', cli + '/git/user', cli + '/zip', cli + '/zip/user', + continuity, continuity + '/unchanged', continuity + '/appended-receipt', + continuity + '/source', continuity + '/installation', continuity + '/binding', + continuity + '/data', continuity + '/receipt-history', + 'TestKiroUserArchivePreservesAuthoredBytesWithAutocrlf', + 'TestKiroUserArchivePreservesAuthoredSkillWithAutocrlf'], + 'sdk': ['TestProjectKiroPublicSDKStdioDataRepairRestartAndRemove', + 'TestFacadeHostedPreparationPinsIntentAndSnapshot', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/available', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/wrapped-preflight', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/second-check-available', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/canceled', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/invalid-source', + 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/project', + 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation', + 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/retry', + 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/apply', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/recorded-automatic', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/retained-preference', + 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/owned-drift', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/supported', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/unsupported', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/project', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/personal-mapping', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/attested', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/update', + 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/recorded', + 'TestFacadeHostedPreparationRejectsRetainedStateAtMutationLock'], + 'cli-trust': ['TestKiroPublisherMCPApprovalsFullCLI'], + 'sdk-trust': ['TestKiroNamedMCPApprovalSchemaFailClosed', + 'TestKiroNamedMCPApprovalSchemaFailClosed/empty', + 'TestKiroNamedMCPApprovalSchemaFailClosed/root', + 'TestKiroNamedMCPApprovalSchemaFailClosed/unsupported-version', + 'TestKiroNamedMCPApprovalSchemaFailClosed/empty-list', + 'TestKiroNamedMCPApprovalSchemaFailClosed/wildcard', + 'TestKiroNamedMCPApprovalSchemaFailClosed/embedded-wildcard', + 'TestKiroNamedMCPApprovalSchemaFailClosed/path', + 'TestKiroNamedMCPApprovalSchemaFailClosed/duplicate-tool', + 'TestKiroNamedMCPApprovalSchemaFailClosed/duplicate-server', + 'TestKiroNamedMCPApprovalSchemaFailClosed/unknown-field', + 'TestKiroNamedMCPApprovalSchemaFailClosed/field-alias', + 'TestKiroNamedMCPApprovalSchemaFailClosed/field-alias-server', + 'TestKiroNamedMCPApprovalSchemaFailClosed/noncanonical-number', + 'TestKiroNamedMCPApprovalSchemaFailClosed/wrong-shape', + 'TestKiroNamedMCPApprovalSchemaFailClosed/null', + 'TestKiroNamedMCPApprovalSchemaFailClosed/trailing-content', + 'TestKiroApprovalPreviewAndNoUnselectedPrivilege', + 'TestKiroExactMCPApprovalDisposableLifecycle', + 'TestKiroExactMCPApprovalDisposableLifecycle/install', + 'TestKiroExactMCPApprovalDisposableLifecycle/repeat', + 'TestKiroExactMCPApprovalDisposableLifecycle/update', + 'TestKiroExactMCPApprovalDisposableLifecycle/repair', + 'TestKiroProjectApprovalDoesNotForgeWorkspaceTrust', + 'TestKiroUserEditedAutoApprovalBlocksRemoval']} + receipts = [] + for label, tests in required.items(): + path = root / ('kiro-composed-' + label + '.log') + if path.stat().st_size > 8 * 1024 * 1024: + raise SystemExit('unbounded Go JSON log') + body = path.read_bytes() + rows = [json.loads(line) for line in body.splitlines()] + if not rows or any(row.get('Action') in ('fail', 'skip') for row in rows): + raise SystemExit('failed, skipped or empty lifecycle') + packages = {row.get('Package') for row in rows} + if len(packages) != 1 or not all(packages) or sum(row.get('Action') == 'pass' and 'Test' not in row for row in rows) != 1: + raise SystemExit('exact passing package required') + observed = {row['Test'] for row in rows if row.get('Action') in ('run', 'pass') and 'Test' in row} + if observed != set(tests) or any([row['Action'] for row in rows if row.get('Test') == test and row.get('Action') in ('run', 'pass')] != ['run', 'pass'] for test in tests): + raise SystemExit('exact named RUN/PASS cases required') + receipts.append({'log': path.name, 'bytes': len(body), 'sha256': hashlib.sha256(body).hexdigest(), + 'package': next(iter(packages)), 'tests': tests}) + receipt = {'source_before': before, 'source_after': after, 'logs': receipts, + 'qualification': 'UAP composed installation only; inert discovery/security/helper seams; no native Kiro loading'} + (root / 'kiro-composed-admission.json').write_text(json.dumps(receipt, sort_keys=True, indent=2) + '\n') + print('PASS: exact CLI Git/ZIP, SDK and Kiro scoped approval RUN/PASS cases on the immutable source') + PYTHON + - name: Preserve actual lifecycle logs and source admission + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: kiro-no-auth-uap-${{ matrix.os }} + path: | + ${{ runner.temp }}/kiro-composed-*.log + ${{ runner.temp }}/kiro-composed-source-before.json + ${{ runner.temp }}/kiro-composed-admission.json + if-no-files-found: error + retention-days: 14 + native: + name: Pinned Kiro no-auth observations + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full')) }} + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Test finite no-auth routes and preservation contracts + run: python3 -m unittest discover -s scripts -p 'test_project_native_kiro_no_auth.py' -v + - name: Capture real pinned help validation and expected auth refusals + env: + AGENTPLUGINS_NATIVE_DISPOSABLE_HOSTED: '1' + run: python3 scripts/project_native_kiro_no_auth.py --output "$RUNNER_TEMP/kiro-no-auth-native" + - name: Preserve original bounded native evidence + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: kiro-no-auth-native-linux-amd64 + path: ${{ runner.temp }}/kiro-no-auth-native/upload/research.zip + if-no-files-found: error + retention-days: 14 + acceptance: + name: Kiro no-auth acceptance + needs: [lifecycle, native] + if: ${{ always() && (github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full'))) }} + runs-on: ubuntu-24.04 + steps: + - name: Require actual completed lifecycle and native contracts + env: + LIFECYCLE: ${{ needs.lifecycle.result }} + NATIVE: ${{ needs.native.result }} + run: | + test "$LIFECYCLE" = success + test "$NATIVE" = success + echo 'PASS: declared no-auth UAP installation and separately admitted native observations only; no authentication, model, native MCP or loaded-client lifecycle qualification.' + | tee "$RUNNER_TEMP/kiro-composed-sdk-trust.log" - name: Admit actual named cases and unchanged source if: ${{ always() }} shell: bash From 89980034fcae0f229d39b1767f094d8ab6fb239e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:58:02 +0200 Subject: [PATCH 25/52] test(kiro): keep approved MCP packages eligible for native automatic verification --- .../clients/kiro/mcp_approvals_test.go | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go index 9a1c74b0f9..abd3f554e1 100644 --- a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go +++ b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go @@ -103,6 +103,36 @@ func TestKiroApprovalPreviewAndNoUnselectedPrivilege(t *testing.T) { } } +func TestKiroExactApprovalPreservesNativeVerifierAndAutomaticActivation(t *testing.T) { + root := filepath.Join(t.TempDir(), ".kiro") + client := domain.DetectedClient{ClientID: domain.ClientKiro, ConfigRoot: root, ExecutablePath: "/fixture/kiro-cli"} + plan := testKiroApprovalPlan(root, filepath.Join(t.TempDir(), "active"), domain.ScopeUser) + plan.InstallIntent = domain.InstallIntentAutomatic + adapter := New() + request := domain.ActivationRequest{Client: client, Plan: plan, BackendExecutable: client.ExecutablePath} + if !adapter.VerifierAvailable(client, plan, client.ExecutablePath) || + !adapter.AutomaticallyActivates(clients.Env{}, request) { + t.Fatal("a selected, exact Kiro approval must not disable native verification or installation") + } + + // The exact Kiro authorization extension is the only added component; + // unknown extensions must not gain another client's verification privilege. + plan.Components = append(plan.Components, domain.ComponentDecision{ + Kind: domain.ComponentExtension, Name: "com.example.foreign", Support: domain.SupportNative, + }) + request.Plan = plan + if adapter.VerifierAvailable(client, plan, client.ExecutablePath) || + adapter.AutomaticallyActivates(clients.Env{}, request) { + t.Fatal("Kiro accepted automatic verification for a foreign extension") + } + plan.Components = []domain.ComponentDecision{{ + Kind: domain.ComponentExtension, Name: MCPApprovalNamespace, Support: domain.SupportNative, + }} + if adapter.VerifierAvailable(client, plan, client.ExecutablePath) { + t.Fatal("Kiro approval extension alone must not qualify as installed native components") + } +} + func TestKiroExactMCPApprovalDisposableLifecycle(t *testing.T) { root := filepath.Join(t.TempDir(), ".kiro") config := filepath.Join(root, "settings", "mcp.json") From 7e31590e2d159223f7b4d7325394235a33926ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 02:58:40 +0200 Subject: [PATCH 26/52] fix(ci/kiro): restore intact E2E workflow and admit exact trust cases across three OS --- .../workflows/kiro-no-auth-installation.yml | 138 +----------------- 1 file changed, 5 insertions(+), 133 deletions(-) diff --git a/.github/workflows/kiro-no-auth-installation.yml b/.github/workflows/kiro-no-auth-installation.yml index af16f752c1..89d56c2dc7 100644 --- a/.github/workflows/kiro-no-auth-installation.yml +++ b/.github/workflows/kiro-no-auth-installation.yml @@ -85,14 +85,14 @@ jobs: shell: bash working-directory: install/integrationctl/agentplugins run: go test -json -count=1 -timeout=180s ./installer -run '^Test(ProjectKiroPublicSDKStdioDataRepairRestartAndRemove|FacadeHostedPreparation(PinsIntentAndSnapshot|PreservesAutomaticAndOtherFailures|RefusesAppearingRetainedInstallation|PreservesRecordedModesAndOwnership|EligibilityDoesNotBroadenScopeOrConsent|RejectsRetainedStateAtMutationLock))$' | tee "$RUNNER_TEMP/kiro-composed-sdk.log" - - name: Run public CLI manifest-to-native tool approvals lifecycle + - name: Verify public Kiro CLI publisher approval install and repair shell: bash working-directory: cli run: go test -json -count=1 -timeout=180s ./internal/agentpluginscli -run '^TestKiroPublisherMCPApprovalsFullCLI$' | tee "$RUNNER_TEMP/kiro-composed-cli-trust.log" - - name: Run Kiro exact approval, project safety and native ownership lifecycle + - name: Verify Kiro exact MCP approval and ownership lifecycles shell: bash working-directory: install/integrationctl/agentplugins - run: go test -json -count=1 -timeout=180s ./clients/kiro -run '^TestKiro(NamedMCPApprovalSchemaFailClosed|ApprovalPreviewAndNoUnselectedPrivilege|ExactMCPApprovalDisposableLifecycle|ProjectApprovalDoesNotForgeWorkspaceTrust|UserEditedAutoApprovalBlocksRemoval) | tee "$RUNNER_TEMP/kiro-composed-sdk-trust.log" + run: go test -json -count=1 -timeout=180s ./clients/kiro -run '^TestKiro(NamedMCPApprovalSchemaFailClosed|ApprovalPreviewAndNoUnselectedPrivilege|ExactApprovalPreservesNativeVerifierAndAutomaticActivation|ExactMCPApprovalDisposableLifecycle|ProjectApprovalDoesNotForgeWorkspaceTrust|UserEditedAutoApprovalBlocksRemoval)$' | tee "$RUNNER_TEMP/kiro-composed-sdk-trust.log" - name: Admit actual named cases and unchanged source if: ${{ always() }} shell: bash @@ -160,6 +160,7 @@ jobs: 'TestKiroNamedMCPApprovalSchemaFailClosed/null', 'TestKiroNamedMCPApprovalSchemaFailClosed/trailing-content', 'TestKiroApprovalPreviewAndNoUnselectedPrivilege', + 'TestKiroExactApprovalPreservesNativeVerifierAndAutomaticActivation', 'TestKiroExactMCPApprovalDisposableLifecycle', 'TestKiroExactMCPApprovalDisposableLifecycle/install', 'TestKiroExactMCPApprovalDisposableLifecycle/repeat', @@ -187,136 +188,7 @@ jobs: receipt = {'source_before': before, 'source_after': after, 'logs': receipts, 'qualification': 'UAP composed installation only; inert discovery/security/helper seams; no native Kiro loading'} (root / 'kiro-composed-admission.json').write_text(json.dumps(receipt, sort_keys=True, indent=2) + '\n') - print('PASS: exact CLI Git/ZIP, SDK and Kiro scoped approval RUN/PASS cases on the immutable source') - PYTHON - - name: Preserve actual lifecycle logs and source admission - if: ${{ always() }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 - with: - name: kiro-no-auth-uap-${{ matrix.os }} - path: | - ${{ runner.temp }}/kiro-composed-*.log - ${{ runner.temp }}/kiro-composed-source-before.json - ${{ runner.temp }}/kiro-composed-admission.json - if-no-files-found: error - retention-days: 14 - native: - name: Pinned Kiro no-auth observations - if: ${{ github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full')) }} - runs-on: ubuntu-24.04 - timeout-minutes: 10 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - ref: ${{ github.event.pull_request.head.sha || github.sha }} - - name: Test finite no-auth routes and preservation contracts - run: python3 -m unittest discover -s scripts -p 'test_project_native_kiro_no_auth.py' -v - - name: Capture real pinned help validation and expected auth refusals - env: - AGENTPLUGINS_NATIVE_DISPOSABLE_HOSTED: '1' - run: python3 scripts/project_native_kiro_no_auth.py --output "$RUNNER_TEMP/kiro-no-auth-native" - - name: Preserve original bounded native evidence - if: ${{ always() }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 - with: - name: kiro-no-auth-native-linux-amd64 - path: ${{ runner.temp }}/kiro-no-auth-native/upload/research.zip - if-no-files-found: error - retention-days: 14 - acceptance: - name: Kiro no-auth acceptance - needs: [lifecycle, native] - if: ${{ always() && (github.event_name != 'pull_request' || (github.event.action != 'labeled' || (github.event.label.name == 'ci:full' && github.event.pull_request.draft == true)) && (github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:full'))) }} - runs-on: ubuntu-24.04 - steps: - - name: Require actual completed lifecycle and native contracts - env: - LIFECYCLE: ${{ needs.lifecycle.result }} - NATIVE: ${{ needs.native.result }} - run: | - test "$LIFECYCLE" = success - test "$NATIVE" = success - echo 'PASS: declared no-auth UAP installation and separately admitted native observations only; no authentication, model, native MCP or loaded-client lifecycle qualification.' - | tee "$RUNNER_TEMP/kiro-composed-sdk-trust.log" - - name: Admit actual named cases and unchanged source - if: ${{ always() }} - shell: bash - run: | - python3 - <<'PYTHON' - import hashlib, json, os, subprocess - from pathlib import Path - root = Path(os.environ['RUNNER_TEMP']) - before = json.loads((root / 'kiro-composed-source-before.json').read_text()) - def git(*args): - return subprocess.check_output(['git', *args], text=True).strip() - after = {'commit': git('rev-parse', 'HEAD'), 'tree': git('rev-parse', 'HEAD^{tree}'), - 'status': git('status', '--porcelain', '--untracked-files=normal')} - if before != after or after['status'] or after['commit'] != os.environ['EXPECTED_COMMIT']: - raise SystemExit('source changed during lifecycle') - cli = 'TestProjectKiroComposedSourceLifecycle' - continuity = 'TestKiroContinuityRejectsDetachedAuthority' - required = {'cli': [cli, cli + '/git', cli + '/git/user', cli + '/zip', cli + '/zip/user', - continuity, continuity + '/unchanged', continuity + '/appended-receipt', - continuity + '/source', continuity + '/installation', continuity + '/binding', - continuity + '/data', continuity + '/receipt-history', - 'TestKiroUserArchivePreservesAuthoredBytesWithAutocrlf', - 'TestKiroUserArchivePreservesAuthoredSkillWithAutocrlf'], - 'sdk': ['TestProjectKiroPublicSDKStdioDataRepairRestartAndRemove', - 'TestFacadeHostedPreparationPinsIntentAndSnapshot', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/available', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/wrapped-preflight', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/second-check-available', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/canceled', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/invalid-source', - 'TestFacadeHostedPreparationPreservesAutomaticAndOtherFailures/project', - 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation', - 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/retry', - 'TestFacadeHostedPreparationRefusesAppearingRetainedInstallation/apply', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/recorded-automatic', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/retained-preference', - 'TestFacadeHostedPreparationPreservesRecordedModesAndOwnership/owned-drift', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/supported', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/unsupported', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/project', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/personal-mapping', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/attested', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/update', - 'TestFacadeHostedPreparationEligibilityDoesNotBroadenScopeOrConsent/recorded', - 'TestFacadeHostedPreparationRejectsRetainedStateAtMutationLock'], - 'cli-trust': ['TestKiroPublisherMCPApprovalsFullCLI'], - 'sdk-trust': ['TestKiroApprovalPreviewAndNoUnselectedPrivilege', - 'TestKiroExactMCPApprovalDisposableLifecycle', - 'TestKiroExactMCPApprovalDisposableLifecycle/install', - 'TestKiroExactMCPApprovalDisposableLifecycle/repeat', - 'TestKiroExactMCPApprovalDisposableLifecycle/update', - 'TestKiroExactMCPApprovalDisposableLifecycle/repair', - 'TestKiroProjectApprovalDoesNotForgeWorkspaceTrust', - 'TestKiroUserEditedAutoApprovalBlocksRemoval']} - receipts = [] - for label, tests in required.items(): - path = root / ('kiro-composed-' + label + '.log') - if path.stat().st_size > 8 * 1024 * 1024: - raise SystemExit('unbounded Go JSON log') - body = path.read_bytes() - rows = [json.loads(line) for line in body.splitlines()] - if not rows or any(row.get('Action') in ('fail', 'skip') for row in rows): - raise SystemExit('failed, skipped or empty lifecycle') - packages = {row.get('Package') for row in rows} - if len(packages) != 1 or not all(packages) or sum(row.get('Action') == 'pass' and 'Test' not in row for row in rows) != 1: - raise SystemExit('exact passing package required') - observed = {row['Test'] for row in rows if row.get('Action') in ('run', 'pass') and 'Test' in row} - if observed != set(tests) or any([row['Action'] for row in rows if row.get('Test') == test and row.get('Action') in ('run', 'pass')] != ['run', 'pass'] for test in tests): - raise SystemExit('exact named RUN/PASS cases required') - receipts.append({'log': path.name, 'bytes': len(body), 'sha256': hashlib.sha256(body).hexdigest(), - 'package': next(iter(packages)), 'tests': tests}) - receipt = {'source_before': before, 'source_after': after, 'logs': receipts, - 'qualification': 'UAP composed installation only; inert discovery/security/helper seams; no native Kiro loading'} - (root / 'kiro-composed-admission.json').write_text(json.dumps(receipt, sort_keys=True, indent=2) + '\n') - print('PASS: exact CLI Git/ZIP, SDK and Kiro scoped approval RUN/PASS cases on the immutable source') + print('PASS: exact Kiro CLI+SDK approval cases and Git/ZIP lifecycle RUN/PASS on unchanged source') PYTHON - name: Preserve actual lifecycle logs and source admission if: ${{ always() }} From ce59111aaa956d2e0d88e3d95b8e60c73758db18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 03:00:35 +0200 Subject: [PATCH 27/52] fix(kiro): reject invisible or spoofed MCP tool names before native trust --- .../agentplugins/clients/kiro/mcp_approvals.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go index 5d70f9071e..5212542165 100644 --- a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go +++ b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals.go @@ -9,7 +9,6 @@ import ( "path/filepath" "slices" "strings" - "unicode" "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/clients" "github.com/777genius/plugin-kit-ai/install/integrationctl/agentplugins/clients/shared" @@ -82,11 +81,14 @@ func decodeMCPApprovals(raw json.RawMessage) (mcpApprovals, error) { // Kiro's wildcard is intentionally excluded: a package update may expose new // tools, and a reviewed source cannot authorize their future unknown behavior. func validKiroApprovalName(value string) bool { - if value == "" || len(value) > 128 || strings.TrimSpace(value) != value { + if value == "" || len(value) > 128 { return false } + // Trust previews must not permit invisible, bidirectional or markup-like + // names to impersonate a different tool. Native Kiro tool names are ASCII. for _, r := range value { - if unicode.IsControl(r) || r == '*' || r == '?' || r == '[' || r == ']' || r == '/' || r == '\\' { + if (r < 'a' || r > 'z') && (r < 'A' || r > 'Z') && + (r < '0' || r > '9') && r != '_' && r != '-' && r != '.' { return false } } From b16a41cb21333a63ee14b8f0b72e4c67b878527e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D0=B8=D1=8F?= Date: Sat, 21 Nov 2026 03:00:44 +0200 Subject: [PATCH 28/52] test(kiro): refuse bidi, zero-width and markup MCP approval spoofing --- .../agentplugins/clients/kiro/mcp_approvals_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go index abd3f554e1..20971b74be 100644 --- a/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go +++ b/install/integrationctl/agentplugins/clients/kiro/mcp_approvals_test.go @@ -67,6 +67,11 @@ func TestKiroNamedMCPApprovalSchemaFailClosed(t *testing.T) { } }) } + for _, name := range []string{"read docs", "read\u202e", "read\u200b", "read\nwrite", "