Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `agent.egressPolicyRefs` (empty by default): names of EgressPolicies in the agent's namespace, rendered into the Agent's `spec.egressPolicyRefs` as `{name}` entries beside `spec.egress`. The chart copies none of a policy's rules. At most 16 unique resource names; the schema refuses anything else, naming the entry. Needs a kagent line that serves `egresspolicies.api.kagent.dev` (giantswarm/kagent-upstream#620).

- `agent.egress` accepts `tls://<host>:<port>` entries: TLS that the egress gateway forwards without decrypting it, matched on the SNI server name, for a database or message broker that speaks TLS from its first byte. Same host rules as an HTTP(S) origin, and a port is required. The schema and the render refuse an entry without a port, with a path or on an IP address, naming it. Needs the kagent line from 1.21.0, whose Agent accepts `tls://` in `spec.egress` (giantswarm/kagent-upstream#740); an older kagent refuses the Agent (giantswarm/agent#58).

- `agent.egress` (empty by default): HTTP(S) origins the agent may reach besides what its revision compiles, such as `https://github.com:443` or `https://*.githubusercontent.com` (one wildcard label, over at least two labels), rendered into the Agent's `spec.egress` (kagent-dev/kagent#3019, which the kagent line must carry; a kagent without the field prunes it). At most 64 unique origins; the chart refuses anything that is not an origin, naming the entry.
Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,34 @@ agent:
from the platform's per-Harness list, which agent-manager writes into
`agent.egress`; another origin is refused there.

**Picking an EgressPolicy.** A tenant's admins can bundle origins, and the
credential header the gateway adds to them, into an `EgressPolicy` in the
namespace (`kubectl -n <namespace> get egresspolicies.api.kagent.dev`). An
agent picks one by name in `agent.egressPolicyRefs`, beside its own
`agent.egress`; the chart renders the names into the Agent's
`spec.egressPolicyRefs` and copies none of the policy's rules:

```yaml
agent:
egressPolicyRefs:
- github
- go-modules
egress:
- https://orders.example.com # typed origins still work next to them
```

- At most 16 names, each a resource name, none twice; the schema refuses
anything else, naming the entry.
- The policy is read where it lives: an origin added to it reaches every agent
that picks it from that agent's next Session, with no upgrade of the agent's
release. The Agent recompiles on the change and reports `Ready=False` until
its new revision is ready.
- A name with no EgressPolicy in the namespace blocks the whole Agent:
`ResolvedRefs=False` with `resolve EgressPolicy "<namespace>/<name>": not
found`, and it is not Ready until the policy exists or the ref is removed.
- An agent on a coding Harness reaches only its Harness's platform list:
agent-manager refuses a ref there.

**What a denial looks like.** The platform answers a refused request, so it
reads like an outage, not a policy:

Expand Down
3 changes: 2 additions & 1 deletion helm/agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ What an agent can reach and how to add a host (`agent.egress`): [What an agent c

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| agent | object | `{"description":"","displayName":"","egress":[],"harness":"kagent","iconUrl":"","name":"","systemMessage":"You are a helpful agent.\n"}` | Identity and prompt of the agent. |
| agent | object | `{"description":"","displayName":"","egress":[],"egressPolicyRefs":[],"harness":"kagent","iconUrl":"","name":"","systemMessage":"You are a helpful agent.\n"}` | Identity and prompt of the agent. |
| agent.name | string | `""` | Technical resource name (DNS-1123) of the Agent and of its RemoteMCPServer. Defaults to the Helm release name. |
| agent.displayName | string | `""` | Human-friendly name, Unicode allowed. Rendered as the ui.giantswarm.io/display-name annotation on the Agent. Size-limited so it cannot become a description. |
| agent.description | string | `""` | Rendered into the Agent's spec.template.description. It shares the compiled agent config's size budget with the system prompt (see systemMessage), so keep it to a few sentences. |
| agent.iconUrl | string | `""` | Fully qualified URL of the agent's avatar icon. Rendered as the ui.giantswarm.io/icon-url annotation on the Agent (the template has no icon field); the Dev Portal reads it. Populated by the agent-creation flows with the canonical avatar URL. |
| agent.systemMessage | string | `"You are a helpful agent.\n"` | The agent's system prompt. Rendered into the Agent's spec.template.systemPrompt. At most 20000 characters; move long reference material into a skill. A prompt heavy in `<`, `>` or `&` can still exceed the runtime limit under this cap, and the Agent then reports why. |
| agent.harness | string | `"kagent"` | Name of the platform Harness that runs the agent, in the agent's namespace. Rendered into the Agent's spec.harnessRef.name; the Agent selects its Harness, no label and no Harness-side selector is involved. The platform ships the `kagent` Harness (the Go ADK runtime); an Agent whose Harness does not exist reports `ResolvedRefs=False` and never becomes Ready. |
| agent.egress | list | `[]` | Origins the agent may reach besides the destinations its revision compiles (the model, its MCP servers, its skill and plugin sources, telemetry), such as `https://github.com:443`, `https://proxy.golang.org` or `tls://db.example.com:5432`. Rendered into the Agent's spec.egress. An origin is `http(s)://<host>[:port]` with no path, or `tls://<host>:<port>` with a required port: TLS that the egress gateway forwards without decrypting it, matched on the SNI server name (a database or message broker that speaks TLS from the first byte, not STARTTLS). The host may have `*` as its leftmost label (`https://*.githubusercontent.com` matches one label, such as raw.githubusercontent.com) and a wildcard needs two labels under it, so nothing opens a whole top-level domain or every host. At most 64 origins. The chart refuses anything else, naming the entry. |
| agent.egressPolicyRefs | list | `[]` | Names of EgressPolicies in the agent's namespace whose origins (and credential headers) the agent may also reach, such as `github` or `go-modules`. Rendered into the Agent's spec.egressPolicyRefs as `{name}` entries; the chart copies none of a policy's rules, so a change to the policy reaches the agent from its next Session without an upgrade of this release. At most 16 unique names. A name with no EgressPolicy in the namespace keeps the Agent from becoming Ready (ResolvedRefs=False). |
| modelConfig | object | `{"name":"default-model-config"}` | Which platform-provisioned ModelConfig the agent uses, referenced by name. kagent resolves it in the agent's own namespace. The chart never creates or mutates a ModelConfig, and tenants never handle LLM credentials. |
| modelConfig.name | string | `"default-model-config"` | Name of the platform-provisioned ModelConfig in the agent's namespace. Rendered into the Agent's spec.template.modelConfig.name. |
| context | object | `{"compaction":{"compactionInterval":null,"enabled":true,"eventRetentionSize":4,"overlapSize":null,"summarizer":{"modelConfig":"","promptTemplate":""},"tokenThreshold":24000}}` | Kept for the values of existing releases; rendered into nothing. Context compaction moved from the agent's template to the platform Harness (kagent-dev/kagent#2790; Harness.spec.kagent.compaction, set by the platform as kagent.harness.compaction), where it applies to every agent the Harness admits. The kagent line from 1.1.0 has no spec.context on the AgentTemplate, and a template that carries it is refused at admission. Everything under this key is ignored. |
Expand Down
6 changes: 6 additions & 0 deletions helm/agent/templates/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@ spec:
egress:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.agent.egressPolicyRefs }}
egressPolicyRefs:
{{- range . }}
- name: {{ . | quote }}
{{- end }}
{{- end }}
template:
{{- include "agent.spec" . | nindent 4 }}
61 changes: 61 additions & 0 deletions helm/agent/tests/agent_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1174,3 +1174,64 @@ tests:
asserts:
- failedTemplate:
errorPattern: 'agent[./]egress'

# egressPolicyRefs: Agent.spec.egressPolicyRefs, the namespace's EgressPolicies by name
- it: renders no spec.egressPolicyRefs by default
asserts:
- notExists:
path: spec.egressPolicyRefs

- it: renders agent.egressPolicyRefs as spec.egressPolicyRefs names next to spec.egress
set:
agent:
egress:
- https://example.com
egressPolicyRefs:
- github
- go-modules
asserts:
- equal:
path: spec.egressPolicyRefs
value:
- name: github
- name: go-modules
- equal:
path: spec.egress
value:
- https://example.com

- it: refuses an empty EgressPolicy name through the values schema
set:
agent:
egressPolicyRefs:
- ""
asserts:
- failedTemplate:
errorPattern: 'agent[./]egressPolicyRefs'

- it: refuses an EgressPolicy name that is not a resource name through the values schema
set:
agent:
egressPolicyRefs:
- GitHub
asserts:
- failedTemplate:
errorPattern: 'agent[./]egressPolicyRefs'

- it: refuses a repeated EgressPolicy name through the values schema
set:
agent:
egressPolicyRefs:
- github
- github
asserts:
- failedTemplate:
errorPattern: 'agent[./]egressPolicyRefs'

- it: refuses more than 16 EgressPolicy names through the values schema
set:
agent:
egressPolicyRefs: [p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17]
asserts:
- failedTemplate:
errorPattern: 'agent[./]egressPolicyRefs'
10 changes: 10 additions & 0 deletions helm/agent/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@
"maxItems": 64,
"uniqueItems": true
},
"egressPolicyRefs": {
"type": "array",
"description": "Names of EgressPolicies in the agent's namespace whose origins (and credential headers) the agent may also reach, such as `github` or `go-modules`. Rendered into the Agent's spec.egressPolicyRefs as `{name}` entries; the chart copies none of a policy's rules, so a change to the policy reaches the agent from its next Session without an upgrade of this release. At most 16 unique names. A name with no EgressPolicy in the namespace keeps the Agent from becoming Ready (ResolvedRefs=False).",
"items": {
"type": "string",
"pattern": "^[a-z0-9]([-a-z0-9.]*[a-z0-9])?$"
},
"maxItems": 16,
"uniqueItems": true
},
"harness": {
"type": "string",
"description": "Name of the platform Harness that runs the agent, in the agent's namespace. Rendered into the Agent's spec.harnessRef.name; the Agent selects its Harness, no label and no Harness-side selector is involved. The platform ships the `kagent` Harness (the Go ADK runtime); an Agent whose Harness does not exist reports `ResolvedRefs=False` and never becomes Ready.",
Expand Down
9 changes: 9 additions & 0 deletions helm/agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ agent:
# host. At most 64 origins. The chart refuses anything else, naming the
# entry.
egress: []
# @schema type:array;item:string;itemPattern:^[a-z0-9]([-a-z0-9.]*[a-z0-9])?$;maxItems:16;uniqueItems:true
# -- (list) Names of EgressPolicies in the agent's namespace whose origins
# (and credential headers) the agent may also reach, such as `github` or
# `go-modules`. Rendered into the Agent's spec.egressPolicyRefs as
# `{name}` entries; the chart copies none of a policy's rules, so a change
# to the policy reaches the agent from its next Session without an upgrade
# of this release. At most 16 unique names. A name with no EgressPolicy in
# the namespace keeps the Agent from becoming Ready (ResolvedRefs=False).
egressPolicyRefs: []

# -- Which platform-provisioned ModelConfig the agent uses, referenced by name.
# kagent resolves it in the agent's own namespace. The chart never creates or
Expand Down
Loading