Egress policy compilers: give them the Session, and let a Session add destinations

Aperta
#3,441 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
backend

Direzione di ricerca

Start with go/core/pkg/egresspolicy/egresspolicy.go and proto/kagent/api/v1/sessions.proto, then trace how Session actors receive compiled egress policies on create, repoint, and rollback. The core open question is who may authorize per-Session destinations; review the two comments and discuss the admission model with maintainers before implementation. Done means an agreed design covering compiler input, validation, authentication handling, and policy updates across those lifecycle events.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem. An egress policy compiler (#3263) reads Input{Atespace, GatewayTargets} (go/core/pkg/egresspolicy/egresspolicy.go:19-22) and runs once per revision, so every Session of an Agent gets the same actor policy. Some destinations are known only when a Session is created: the repository host a person's working copy lives on, the forge API that host serves, a per-Session service. Today such a Session is refused at the gateway for a host its Agent did not list. Session has no egress field (proto/kagent/api/v1/sessions.proto:34-55), and a compiler cannot see the Session, so neither path can add a per-Session destination.

Proposal.

  1. The compiler Input gains the Session (id, creator, agent) when the policy is compiled for a Session actor. That is enough for an out-of-tree compiler to bind per-Session destinations.
  2. Optionally, Session.egress: destinations in the vocabulary of EgressPolicy.spec.destinations, given on CreateSession, validated like an EgressPolicy, and compiled into the Session actor's own policy on create, on repoint and on rollback. A destination's authentication takes the same sources as EgressPolicy, so a credential never enters the sandbox.

Who may add which destination is the open design question: a signed grant, an allow-list on the Agent, or an EgressPolicy the Session references. We have a reference implementation of both steps and can adapt it to whichever admission you prefer.

Lingua principale
Go
Stelle
4.5k
Fork
937
Merge medio
1g 10h
PR unite (30g)
150

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di kagent-dev/kagent

Tutte le issue di kagent-dev/kagent

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.