EgressPolicy: option to add a credential header when the request has none
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- go, kubernetes, yaml
调研方向
Start with substrate/cmd/atenet/internal/router/egress/credentials.go and docs/architecture/egress-policies.md, which the issue names. Trace how applyEffects handles a missing credential header and how destinations[].authentication is represented and validated; then check the egress policy tests. Done means an opt-in inject: Always adds the configured header when absent, replaces it when present, and leaves the default behavior unchanged.
由索引模型根据 Issue 内容生成。
描述
What we're trying to do
We run Kagent agents that work on a git repository. An agent's EgressPolicy
opens https://github.com with authentication that injects a GitHub token as
Authorization: Basic …, so the agent can git clone and git push without
the token ever entering the sandbox.
The problem
The egress gateway only replaces a credential header the request already
carries. It never adds a missing one (applyEffects in
substrate/cmd/atenet/internal/router/egress/credentials.go, and
docs/architecture/egress-policies.md). Plain git, npm, pip or curl send no
Authorization header, so the credential is never used.
Every client then has to be configured to send a placeholder:
- A static placeholder (for example git's
http.<url>.extraHeader) is sent
on every request. Where the agent has no credential, the placeholder goes
out unchanged. GitHub answers a bad credential with 401 even on public
repositories, so anonymous clones break. - A placeholder that is sent only after a 401 (a git credential helper) works
for git, but it's a shell snippet per client, and other clients have no
equivalent. - Neither can be set per agent, because Kagent sets env per Harness, not per
Agent or AgentTemplate.
Proposal
An opt-in setting on destinations[].authentication that makes the gateway
add the header when the request doesn't carry one, and still replace it when
it does. For example:
spec:
destinations:
- origin: https://github.com
authentication:
header: Authorization
prefix: "Basic "
secretKeyRef: {name: repo-token, key: git}
inject: Always # default: IfPresent (today's behavior)
- The default stays as it is, so nothing changes for existing policies.
- The gateway already writes the header with
OVERWRITE_IF_EXISTS_OR_ADD, so
this changes only the check that skips requests without the header. authenticationalready requires an exact origin, soAlwaysonly covers
hosts an administrator named explicitly.
With this, any client in the sandbox authenticates to an allowed origin
without configuration or placeholders. The credential still never enters the
sandbox.
Alternatives considered
- Per-Agent
envon AgentTemplate, which would let each agent get its own
placeholder configuration. It's still per client, and it was deferred
before. - Harness per credential set: it multiplies Harnesses and sandboxes for what
is policy, not runtime.
Happy to contribute a PR if the direction is acceptable.
- 主要语言
- Go
- 星标
- 4.2k
- 派生
- 890
- 平均合并
- 1 天 10 小时
- 30 天内合并 PR
- 171
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
kagent-dev/kagent 的其他 Issue
-
skills-init: commit-SHA skill refs never start (git checkout -- <sha> reads the SHA as a pathspec)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 84/100
kagent-dev/kagent#3571 ·
维护者通常 1 天内回复
-
Gemini catalogs omit gemini-4-argon and gemini-3.8-flash可能已有人在做 @jayunit100 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
kagent-dev/kagent#3524 · 1 条评论 ·
维护者通常 1 天内回复
-
Don't add the provider's public host to egress when a ModelConfig sets baseUrl可能已有人在做 @lakshyab20 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 81/100
kagent-dev/kagent#3507 · 1 条评论 ·
维护者通常 1 天内回复
-
[BUG] OpenAI and Ollama adapters send an empty tool message when a tool returns a dict可能已有人在做 @helloxjade 于 7 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
kagent-dev/kagent#3462 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
kagent-dev/kagent#3428 · 1 条评论 ·
维护者通常 1 天内回复
查看 kagent-dev/kagent 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
prime-radiant-inc/evener#5901 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 69/100
-
kind/bug
难度 2/5 1-3 小时 新手友好度 78/100
kyma-project/serverless#2769 ·
维护者通常 1 天内回复
-
ready-for-agent
难度 2/5 1-3 小时 新手友好度 78/100
hexlet-basics/hexlet-basics#962 ·
维护者通常 1 天内回复
-
imapproxy closeForMaintenance grace timer calls clientConn.Close() before closeMaintenanceTransport可能已有人在做 @dejanstrbac 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复