Repository navigation
Commit 48a5ad9
authored
feat(helm): render tool approval and the governance mode for muster (#1495)
* feat(helm): add the governance value and render muster's governance configuration
governance (trusted, the default, or governed) is the platform's governance mode for tool calls (giantswarm/giantswarm#38902). The meta chart renders it into the muster release as muster.governance (the mode and the servers muster treats as agent-manager and the Platform Manager) from the muster release that reads it (agent-platform.muster.governanceFloor), and holds it back from the connectivity release. An unknown mode or an own muster mode that differs fails the render. The values document muster's mcpserver-editor binding as the connector-admin role.
* feat(helm): set explicit tool approval on the connectivity chart's MCPServers
mcp-kubernetes ships the Recommended settings (read-only tools Allow, the rest Ask, rule Ask), kagent's session tools Allow all (rule Allow, every tool Allow), each a value (mcp-kubernetes.mcpServer.approval, kagent.controllerRoute.mcp.approval) rendered as spec.approval and validated against the CRD's enums, failing naming the key.
* feat(helm): bind muster-approval-binder to agent-manager's ServiceAccount
muster takes an agent's tool settings in a Session binding only from a sender allowed to bind toolapprovals in its namespace. The muster chart ships the Role; the connectivity release binds it to agent-manager's ServiceAccount, and only to it.
* test(helm): verify governance, connector admins, the binder and tool approval
* docs: describe tool approval and the governance mode
The chart README names governance, the connector-admin role, the binder and each shipped connector's approval value; README and the toolset presets link the Governing tool calls page.
* docs(skills): teach tool approval in the tools, building-blocks and agent-management skills
* feat(helm): render muster's approval installation and redirect allowlist
From the muster floor that reads governance, the meta chart sets
muster.approval.installation from backstage.installationName and adds the
portal's /sessions and klaus-gateway's /auth/slack/return to
muster.oauth.mcpClient.postLoginRedirectAllowlist. Mark the governance floor as
one placeholder value.
* test(helm): verify approval installation, redirect allowlist and the floor marker
* docs(skills): name approval's prerequisites and the derived redirect allowlist
* feat(helm): accept Block as the tool approval rule on the connectivity MCPServers
muster accepts Block as spec.approval.rule: tools without their own entry, new ones included, are hidden and refused. The comments say what governed platforms ask on kagent and mcp-kubernetes and that the kubernetes aliases follow the rule.
* feat(helm): render muster's governed servers with safe lists and bind the approval binder in muster's namespace
muster's new governance shape: governance.governedServers {server, role, safe} for every MCPServer the platform ships (top-level governedServers, keyed namespace/name outside muster's namespace), on trusted too so the role floors hold. governed below the muster floor and the earlier servers shape fail the render. muster.rbac.approvalBinder.subjects names agent-manager's ServiceAccount (the muster chart binds it in muster's namespace); the connectivity chart's own RoleBinding is gone, and an unnamed ServiceAccount the chart does not create fails. The redirect allowlist keeps a non-default port (backstage.publicPort, klaus-gateway's callbackBaseUrl as written) and refuses an invalid callbackBaseUrl; NOTES say when mcpClient.enabled is off. README: Block rule, governed servers, MCP-session retry, upgrade notes.
* test(helm): cover governed servers, their coverage, the binder and ported redirect entries
verify-tool-approval fails on a shipped MCPServer that is neither governed nor in governanceExempt, a floor on a safe list, a safe entry naming no tool of its server and differing kubernetes maps; it asserts a non-default port in both redirect entries (M1-1), invalid ports and URLs, the binder subjects, meta-to-connectivity overrides and the Block rule. The governance floor placeholder marker is now optional.
* docs(skills): describe the Block rule, the governed default, retry over the same MCP session and the upgrade
The skills no longer present agent-manager's per-agent tool lists (update_agent_access, set_agent_approval, tools on create_agent) as shipped: they apply once its schema has them. approval.source lists what muster reports (unavailable included). UPGRADE.md names the operator actions for tool approval.
* docs: bind tool approvals to the calling client, not the MCP session
* fix(helm): refuse a backstage.publicPort above 65535
* test(helm): refuse safe-list entries that look like writes unless annotated
A safe entry whose name starts with a write verb (create, delete, exec, set, approve, ...) fails verify-tool-approval unless a '# safe-write: <tool>: <reason>' comment above safe: says why it reads. Also covers publicPort 65535, 65536 and 99999.
* docs(skills): describe agent-manager's split update tools and set_agent_approval
* feat(helm): turn on agent-manager's tool approval from the floors that bind it
agent-manager's muster.toolApproval.enabled follows muster: on from the
agent-manager floor whose chart takes the key and muster's agent approval
floor (both placeholders until released), off below muster's, an own value
standing. The agent-management skill names toolSettings,
list_approval_grants and update_agent_access for connectors, and drops a
leftover sentence.
* feat(helm): call muster's session bindings API on its own port, admitting agent-manager alone
From muster's session bindings floor, the meta chart moves muster's
session bindings API off the aggregator port (sessionBindings.onMainPort
false), lets muster's network policy admit agent-manager's pods alone to
its port, points agent-manager's muster.bindingsUrl at it and opens
agent-manager's egress to it in both policy flavors. Own values stand.
verify-tool-approval covers the derivation.
* feat(helm): move the agent chart line to 3.x only with agent-manager's migrate hop and muster's approval floor
Agent chart 3.0 removes muster.requireApproval. agent-manager.agentChart.semver
reaches agent-manager, its migrate run and the agent-platform-operator, which
moves every organization's chart source at once, so a 3.x line now renders
only with agent-manager at the release whose migrate rewrites requireApproval
to default: Ask, muster at the release that enforces it, agent-manager's tool
approval on and the default agent on the same major; a range spanning 2.x and
3.x fails. make verify-agent-chart-line asserts it.
* docs: upgrade notes and skill for agent chart 3.0's default: Ask
* chore(helm): regenerate schema for tool-approval values
* chore(helm): mirror tool-approval defaults in the meta chart, regenerate schema, README and goldens
* test(helm): check the unknown governedServers key in the schema and the template
* fix(helm): keep the tool approval floors unset until their releases exist and read the agent chart line as migrate does
A placeholder floor admitted released musters that do not enforce
default: Ask, so a 3.x agent chart line could pass the render against them.
The tool approval, agent approval, governance, session bindings and 2.x ->
3.x migrate floors are now unset: a floor without a release admits nothing,
what it gates stays off, governed fails and every 3.x line is refused, until
the platform release that pins those versions sets them. The line's major is
decided as agent-manager's migrate decides it, so ~3.2, 3.1.x and bounded
ranges count as 3.x, and a range spanning majors or admitting only
pre-releases fails; the check runs with agent-manager off too. The verify
scripts exercise the gated paths on a chart copy with test floors.
* feat(helm): let the migrate run read organization namespaces
On the agent chart 2.x -> 3.x path agent-manager's migrate lists the
organization namespaces and reports their releases before the
agent-platform-operator moves their sources. Its identity may list
namespaces and, with organizations on, read HelmReleases, OCIRepositories and
Agents cluster-wide; it writes none of them.
* docs: upgrade notes for unset floors, mandatory migrate check and running sessions on agent chart 3.0
* fix(helm): tighten the agent chart line guard, scope the migrate reads to a 3.x line and refuse muster's own governance below the floor
The guard refuses a range whose bound admits a pre-release of the next
major (Flux would serve it), probes majors 0-99 as migrate does, and names a
value that is no semver range. A component range with || is held to its
lowest alternative's floor. The migrate identity lists namespaces and reads
organization releases, sources and Agents only while the line is 3.x, and
lists Agents rather than getting them. With the governance floor unset an
own muster.muster.governance fails, and governed says why without an empty
floor in the message.
* docs: running sessions need approval prerequisites once tool approval is on, and the refused range forms
* feat(helm): let agents call the Platform Manager's reads unasked on governed
governedServers.giantswarm-platform-manager.safe lists get_info,
list_installations, list_actions, get_action and verify_capability. Three of
them bring Action records up to date with GitHub as the caller and may post
those facts to the review thread or the standup channel; none decides
anything. The dry runs share their tools with the commits and keep asking,
as do verify_installation, watch_action, deny_action and the floors.
* feat(helm): add a migrate preflight that dry-runs the 3.x path before the agent chart line moves
The mandatory dry run could not run as the migration's identity on the 2.x
line: the namespace list and organization reads rendered only on a 3.x line.
agentManager.migration.preflightSemver renders a never-started CronJob
<migration>-preflight running migrate --dry-run against that range, and a 3.x
preflight range grants the identity the same read-only access the 3.x path
needs. Unset, nothing changes.
* docs: run the mandatory 3.x dry run through the migrate preflight, and why the floors are not values
* feat(helm): make governance a map with roleFloors and drop installation-specific defaults
governance mirrors muster's governance configuration: {mode: trusted |
governed, roleFloors: {role: [tools]}}; roleFloors renders as
muster.governance.roleFloors (added to muster's built-in floors) and a role
declared there is a valid governedServers role. A string fails the render
with a hint. The default governedServers entry for a vendor's own server and
the vendor admin groups as connector-admin and workflow-editor subjects are
gone: the editors default to placeholder groups nobody belongs to, and an
installation names its own. Tests use generic fixtures, the agent chart line
check reads an exact version pin as its major, and private references are
removed from templates and tests.
* docs: describe governance as a map, the editor placeholders and how an installation adds its own governed servers
* fix(helm): default the muster editors to subjects no identity provider can issue, and refuse roleFloors the chart would drop
The placeholder editor groups had the org:team shape a Dex GitHub
connector emits, so with no groups prefix a real group could match them.
The defaults are now ServiceAccount subjects the chart never creates
(kube-system/agent-platform-unset-connector-admins and -workflow-editors):
nobody holds the Roles until an installation names its own subjects. A
non-empty governance.roleFloors below the muster governance floor fails the
render instead of being dropped. Tests drop an internal finding id and derive
the platform team's names from their fixture.
* docs: neutral governed-server example and the fail-closed editor defaults in UPGRADE.md
* fix(helm): read a next-major pre-release upper bound as written for Helm releases whose semver skips pre-releases
* fix(helm): refuse floors that need the governance wiring while its floor is unset, select muster's own namespace for the session bindings egress, refuse governed mode with muster off
- a floor of tool approval, agent approval, the session bindings port or the agent chart 3.x line set while agent-platform.muster.governanceFloor is unset fails the render naming both
- networkPolicy.musterSessionBindingsNamespace (set from muster's namespace) selects muster in both policy flavours
- governance.mode governed or governance.roleFloors with components.muster off fails the render
- verify-agent-chart-line also runs the pre-release bound cases under Helm 3.17 where .bin/ holds it
* fix(helm): let migrate rewrite organization releases on the 3.x line under a scope policy, and read every alternative of a range
On the 3.x line itself (not a preflight range) with organizations on, the
migrate identity may update HelmReleases and write its report ConfigMap
cluster-wide, so it rewrites the organization releases agent-manager owns and
marks each organization ready for the agent-platform-operator's move of its
chart source. The ValidatingAdmissionPolicy
agent-platform-organization-migrate-scope holds those writes to organization
namespaces and the kagent namespace, to spec.values of an organization's
HelmRelease and to the report's name.
The agent chart line guard and the connectivity chart's 3.x probe also probe
every version a range names, with its next patch and minor, as migrate and
the operator do: 3.0.1 || 2.6.0 spans two majors and is refused.
UPGRADE.md describes the per-organization cut-over and its hand step.
* docs(skills): organizations wait at chart 2.x until migrate marks them ready
* fix(helm): grant migrate's organization writes only during the cut-over and hold their metadata
The migrate identity's update on HelmReleases and its report ConfigMap in
organization namespaces now render only while agentManager.migration.cutover
is set on a 3.x line, which UPGRADE.md says to unset once no organization is
held. agent-platform-organization-migrate-scope also refuses a change of an
organization release's labels, annotations, ownerReferences or finalizers.
verify-agent-chart-line pins the connectivity chart's own 3.x probe (an exact
pin, a || alternative), and UPGRADE.md states the window up to the operator's
rollout, the releases created after a run and the re-run.
* fix(connectivity): accept only a boolean true as migration cutover
agentManager.migration.cutover was read by truthiness, so the string "false"
granted the migration its organization writes. A string now fails the render;
verify-agent-chart-line asserts it.
* fix(helm): let agent-manager read the default agent's release for its tool approval settings
The default agent's release lives in the chart's Flux namespace, not in the kagent namespace agent-manager manages, so a session of the default agent could not read its settings. From agent-manager's tool approval floor the chart derives agent-manager.muster.toolApproval.platformReleases [<Flux namespace>/default-agent], which grants get on that release by name; verify-tool-approval asserts it.
* fix(helm): pass the default agent's approval values to agent-manager on a remote target
With gitops.target.kubeConfig agent-manager runs on the target cluster and cannot read the default agent's HelmRelease, which stays on the management cluster, so every default-agent session was refused. The chart now renders agent-manager.muster.toolApproval.platformAgents there instead of platformReleases: the Agent kagent/default-agent, the release its Flux labels name (<Flux namespace>/<target>-default-agent) and the release's tools, toolset, default and muster.requireApproval, taken from the values the release is rendered with (agent-platform.defaultAgent.approval). verify-tool-approval asserts it. Without a target nothing changes.
* fix(approval): tell agent-manager which Agent the default agent's release renders
muster.toolApproval.platformReleases now maps the release to the Agent it
renders, so agent-manager binds the default agent through that release only
and refuses an Agent whose Flux labels name another or none.
* feat(approval): sign the portal in with its own OAuth client and trust only it for muster's sign-in handoff
backstage.oidcClientId gives the portal a client of its own at the platform's
issuer (secret: portal-dex-client-secret of global.identity.existingSecret,
mounted optional as AGENT_PLATFORM_PORTAL_OIDC_CLIENT_SECRET). The portal then
also requests the platform client's audience, so muster, the managers and the
API server accept its tokens as before; their azp names the portal's client.
With such a dedicated client and backstage.signInHandoff on (the default),
the meta chart lists that client, and only that one, in muster's
approval.handoffClients from agent-platform.muster.handoffFloor (unset until
the muster release exists): a click on Open in portal chat then opens muster's
approval page or connector sign-in signed in. The shared client is never
listed; an own handoffClients naming it fails the render, since agents'
delegations and CLIs hold its tokens. The trade-off (a holder of a person's
portal token can open that person's approval page without a browser sign-in;
the decision still takes the click on muster's page) is documented in
docs/authentication.md.
* feat(approval): trust the portal's own client for muster's inline approval decisions
muster renamed approval.handoffClients to approval.trustedClients: the
clients listed there decide a person's approvals inline (POST
/approvals/{id}/decision with the person's token) and get sign-in handoff
tickets. The chart lists the portal's dedicated client as trustedClients
from the new floor agent-platform.muster.trustedClientsFloor (unset until
that muster is released), and as handoffClients from handoffFloor below
it. An own list under either name stands; naming the shared client fails
the render. Docs, the tools skill and verify-tool-approval follow.
* fix(approval): bind the portal's workload for muster's inline decisions and trust only its dedicated client
From agent-platform.muster.trustedClientsFloor, while muster trusts the
portal's client, the muster release binds muster-approval-decider (verb
decide on toolapprovals) to the portal's ServiceAccount and nothing else
(muster.rbac.approvalDecider.subjects, an own list stands), and the
backstage release projects that ServiceAccount's token for audience
muster at /var/run/secrets/muster.giantswarm.io/serviceaccount/token,
beside its own extra volumes. muster takes a person's portal token on its
decision API and handoff endpoint only with that workload token.
muster.approval.trustedClients and handoffClients may name only the
portal's dedicated client: any other id fails the render (the shared
client as before, and now dex-k8s-authenticator, the kagent UI's or
klaus-gateway's client, a CLI's), in an own list as well.
* fix(approval): list the portal as muster's trusted client only from the trusted-clients floor
Drop agent-platform.muster.handoffFloor and its handoffClients branch: a
muster below the trusted-clients floor issues handoff tickets without the
workload review and the sign-in confirmation, and must not be trusted with
them. An own list under either name still stands.
* docs: condense tool approval docs
* docs: move tool approval docs into the repository
* fix(agent-platform): refuse agent chart ranges that admit a major past 99
Document the range grammar agent-platform.agentChart.majors reads and refuse
a line that admits an agent chart major of 100 or more as unsupported, as
agent-manager's migrate and the agent-platform-operator do.
* fix(muster): fail the render for explicit trusted client lists below the floor
* fix(muster): bind only ServiceAccounts as approval deciders
An own muster.rbac.approvalDecider.subjects list, which an installation
sets for a portal deployed as its own release (components.backstage off),
now fails the render for any subject other than a ServiceAccount: a bound
group or user could approve for any person whose token it holds. The test
covers such a portal: an own decider list and trustedClients list stand,
and the platform projects no token.
* fix(backstage): refuse a second projection of the portal's workload token
Where the platform projects the portal's workload token for muster, the
portal chart's own projection (backstage.backstage.musterWorkloadToken) or
an own volume or mount of that name fails the render instead of a pod
declaring it twice. The tests add mixed decider lists, an entry without a
kind, and the same with the portal on.
* feat: set the tool approval release floors and move the component ranges to the epic releases1 parent 4bf5906 commit 48a5ad9
40 files changed
Lines changed: 4091 additions & 195 deletions
File tree
- docs
- helm
- agent-platform-connectivity
- templates
- agent-manager
- backstage
- kagent
- mcp-kubernetes
- organizations
- agent-platform
- examples
- templates
- skills
- agent-platform-agent-management
- agent-platform-building-blocks
- agent-platform-tools
- tests
- golden
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1478 | 1478 | | |
1479 | 1479 | | |
1480 | 1480 | | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
1481 | 1492 | | |
1482 | 1493 | | |
1483 | 1494 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
33 | 88 | | |
34 | 89 | | |
35 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
47 | 64 | | |
48 | 65 | | |
49 | 66 | | |
| |||
0 commit comments