Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
26175f2
feat: add reusable egress policies for agents and sandboxes
EItanya Oct 12, 2026
7928853
test(helm): verify read-only egress policy RBAC
EItanya Oct 13, 2026
7902870
fix: validate MCP credential headers and test tool egress
EItanya Oct 13, 2026
94891d0
style: align egress imports with main
EItanya Oct 13, 2026
5f24176
test: adapt egress fixture to optional harness image
EItanya Oct 14, 2026
f98a467
fix: require current prepared revisions for new instances
EItanya Oct 15, 2026
4a53b01
test: align runtime lifecycle with revision readiness
EItanya Oct 15, 2026
5b39d41
test: exercise Codex egress through shell requests
EItanya Oct 15, 2026
855514a
fix: reconcile egress policy changes on live actors
EItanya Oct 15, 2026
57adcf8
fix: add live egress storage through a new migration
EItanya Oct 16, 2026
ddf5d7f
test: exercise live egress through a shared skill on every harness
EItanya Oct 16, 2026
21a160f
test: keep live egress probes in the foreground
EItanya Oct 16, 2026
cdfa5be
fix: target live egress updates and keep prepared runtimes available
EItanya Oct 16, 2026
a12f664
refactor: clarify token passthrough origin naming
EItanya Oct 16, 2026
47c38d1
refactor: persist controller-translated egress policy per revision
EItanya Oct 16, 2026
ed6a09d
fix: finish live egress review follow-ups
EItanya Oct 16, 2026
36c5ef6
fix: skip unchanged egress updates and separate revision promotion
EItanya Oct 16, 2026
c0220a8
test: make egress probe runs and expectations explicit
EItanya Oct 16, 2026
88c88b9
fix: serialize egress publication per revision
EItanya Oct 16, 2026
0c445aa
test: verify sessions use the last successful revision after invalid …
EItanya Oct 16, 2026
43712a5
refactor: fold egress schema into the initial migration
EItanya Oct 16, 2026
7bc82ca
test: wait for agent retirement before asserting session rejection
EItanya Oct 16, 2026
d16abd9
refactor: queue egress policy publication by revision
EItanya Oct 16, 2026
ca09950
refactor: record revisions and initial egress policies atomically
EItanya Oct 16, 2026
67cb452
refactor: own live egress grants on source definitions
EItanya Oct 16, 2026
15c9680
test: cover agent grants during compilation failures
EItanya Oct 16, 2026
9755533
fix: simplify egress reconciliation and preserve validation semantics
EItanya Oct 16, 2026
0df9d88
refactor: apply live egress during source preparation
EItanya Oct 16, 2026
6c3046f
refactor: record and promote revisions atomically
EItanya Oct 16, 2026
39b0856
refactor: name source policy access EgressGrant
EItanya Oct 16, 2026
483e85e
refactor: share harness skills paths with e2e tests
EItanya Oct 16, 2026
029c8a9
fix: simplify egress ownership and allow HTTP credentials
EItanya Oct 16, 2026
c8fec1c
fix: admit egress grants independently of runtime readiness
EItanya Oct 16, 2026
15001b9
feat: add outbound credential binding extension
codyhartsook Oct 14, 2026
921be1e
docs: shorten credential extension overview
codyhartsook Oct 14, 2026
09e6b6b
feat: pass agent identity to credential binders
codyhartsook Oct 14, 2026
9c3b06e
refactor: resolve egress policy before harness rendering
codyhartsook Oct 15, 2026
59be74f
refactor: split egress policy resolution into helpers
codyhartsook Oct 15, 2026
4934ee2
style: group adkconfig egress test imports
codyhartsook Oct 15, 2026
e24a7e1
fix: keep Harness literal model keys out of gateway bindings
codyhartsook Oct 15, 2026
d5dafd4
fix: preserve explicit auth and unify credential binding rendering
codyhartsook Oct 15, 2026
e6bf128
fix(egress): validate provider references and cover credential compos…
codyhartsook Oct 16, 2026
f0455d6
test: cover credential extension under live grant admission
codyhartsook Oct 17, 2026
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
3 changes: 3 additions & 0 deletions docs/architecture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ the agent processes.
| `Harness` | Kubernetes (`api.kagent.dev/v1alpha3`) | Runtime implementation, workload, credentials, capacity, and snapshot policy |
| `AgentTemplate` | Kubernetes (`api.kagent.dev/v1alpha3`) | Portable agent behavior: model, prompt, tools, skills, and plugins |
| `SandboxTemplate` | Kubernetes (`api.kagent.dev/v1alpha3`) | Tools image, environment, and preparation policy for standalone sandboxes |
| `EgressPolicy` | Kubernetes (`api.kagent.dev/v1alpha3`) | Additional HTTP(S) origins and gateway credentials selected by Agents and SandboxTemplates |
| prepared revision | PostgreSQL and ate-api | Immutable compiled runtime input and its Substrate ActorTemplate |
| `Session` | PostgreSQL, exposed by gRPC | Stable conversation identity and runtime lifecycle |
| `Sandbox` | PostgreSQL, exposed by gRPC and MCP | Owner-scoped scratch environment with process/file access and expiration |
Expand Down Expand Up @@ -95,6 +96,8 @@ cleanup. Session lifecycle workers independently pause/suspend idle Actors.

## Documents

- [Egress policies](egress-policies.md)
- [Runtime credential injection](credential-injection.md)
- [Configuration and compilation](configuration-and-compilation.md)
- [Runtime and lifecycle](runtime-and-lifecycle.md)
- [Client lifecycle retries](../lifecycle-retries.md)
Expand Down
11 changes: 7 additions & 4 deletions docs/architecture/configuration-and-compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,11 @@ revision. AgentTemplate is shared context with no runtime status. Child template
references are resolved under the root Agent's Harness; they do not require
separate Agents or matching Harness references.

A failed compile or apply leaves the previous successful revision available.
Sessions pin a prepared revision, so later template edits do not mutate a
running session.
A failed compile or apply retains the previous successful revision, which
remains available for fresh Sessions during pending or failed edits. Initial
creation requires a successful revision. Existing Sessions and creation retries
keep their pinned revision. Explicit egress grants use current policies
independently of runtime preparation.

Harness compilers only translate inputs. The controller and Substrate adapter own
application and readiness. The central entry points are
Expand Down Expand Up @@ -391,7 +393,8 @@ no synthetic Kubernetes object is created for an inline template.

Create a session with `kagent agent session create --agent assistant -n kagent`.
The gRPC create request and ScheduledRun target one `agent` resource reference.
The controller selects that Agent's latest successful revision. Deleting an Agent
The store selects that Agent's latest successful revision, including while an
edit is pending or failed. Deleting an Agent
retires its definition; sessions and checkpoints retain their pinned revisions.
Recreating the same name creates a new identity and cannot inherit the old
Agent's last successful revision.
Expand Down
59 changes: 44 additions & 15 deletions docs/architecture/credential-injection.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# Runtime credential injection

Kagent requires Substrate **v0.4.0-alpha1**. The compiler turns ModelConfig API
keys and Secret-backed RemoteMCPServer headers into destination-scoped egress
bindings. Substrate's gateway fetches the referenced Kubernetes Secret and
Kagent requires Substrate **v0.5.0-alpha2**. The runtime compiler turns
ModelConfig API keys and Secret-backed RemoteMCPServer headers into pinned
destination-scoped bindings. Independently, EgressPolicy admission supplies
additional live bindings. Substrate's gateway fetches the referenced Kubernetes Secret and
replaces the outgoing HTTP header when the request carries a placeholder. SDKs
receive an inert placeholder where they require an API key; real credentials never enter compiled environments,
runtime configuration, or revision provenance.

Bindings are persisted with the prepared revision and installed before a
session becomes ready, including retries and checkpoint forks. Secret names,
keys, destinations, and headers affect revision identity. Secret values and
Secret UIDs do not. Rotation is handled by the gateway; its credential cache can
Inferred integration bindings are persisted with the prepared revision; their
Secret names, keys, destinations, and headers affect revision identity. Explicit
EgressPolicy bindings are resolved from current policies and update live actors
without changing that revision. Conflicts hold new grants and report the
independent [EgressPoliciesApplied condition](egress-policies.md#preparation-and-lifecycle);
they do not block runtime compilation. Both are installed before execution, including
creation retries, resume, and checkpoint forks. Secret values and Secret UIDs
do not affect revision identity. Rotation is handled by the gateway; its credential cache can
take up to five minutes to refresh, without recompiling or restarting an agent.

## Installation
Expand Down Expand Up @@ -58,24 +63,48 @@ overrides of these variables are rejected.
| RemoteMCPServer Secret-backed header | Configured header; Secret contains its full value |

Provider endpoint overrides determine the allowed HTTP(S) origin. Egress rules
match its scheme, DNS name, and port; credential bindings remain scoped to the
hostname and header. Different credentials for the same hostname and header
are rejected, including conflicts between models, memory embeddings, and MCP
servers. Use distinct DNS names for
origins requiring different credentials. IP-address destinations are unsupported
by Substrate egress policies.
and credential bindings both match its scheme, DNS name, and port. Different
credentials for the same origin and header are rejected, including conflicts
between models, memory embeddings, MCP servers, and explicit policies. Distinct
ports on the same DNS name can use different credentials. IP-address destinations
are unsupported by Substrate egress policies.

The v1alpha3 revision format stores full origins. It assumes a clean installation;
previously persisted hostname-only credential bindings are rejected rather than
reinterpreted across every port on that host.

Harness and SandboxTemplate environment entries accept only literal `value`
strings, including empty strings. Configure Secret-backed credentials on
ModelConfig or RemoteMCPServer for gateway injection.
ModelConfig, RemoteMCPServer, or [EgressPolicy](egress-policies.md) for gateway injection.

AWS IAM signing keys, Google service-account keys, and OAuth client credentials
require mechanisms beyond static header injection and are rejected rather than
serialized into runtimes.
Caller-token passthrough retains its existing behavior. A passthrough model
cannot share a hostname with static gateway credentials, which would override
cannot share an origin with static gateway credentials, which would override
the caller's authentication.

## Controller credential extension

Embedded controllers can set `app.Options.EgressPolicyTranslator` to add credential
references for eligible model and MCP destinations before client rendering. See
[PolicyTranslator](../../go/core/pkg/egressext/policy.go) for the contract. Core
validates and pins the bindings, then renders client placeholders.

MCP Secret bindings can coexist with extension bindings on different headers.
Literal or ConfigMap MCP headers prevent additions at their origin. Model
requirements restrict the header and prefix. An extension binding that conflicts
with a model or MCP binding in the draft fails compilation. A later EgressPolicy
conflict does not block compilation. Pinned integration bindings take precedence,
and admission holds the new grants and reports
[EgressPoliciesApplied](egress-policies.md#preparation-and-lifecycle).
EgressPolicy-only destinations are outside the draft.

References require a registered Substrate provider and use
`ate-secret://<provider>/<path>`, with a lowercase DNS provider, no port, and at
least two nonempty, unescaped path segments. Clients must send the bound header
to trigger injection. Keyless Gemini support remains a follow-up.

## Deferred API fields

The source retains commented declarations for Harness and SandboxTemplate
Expand Down
Loading