test(translator): tighten skills security context assertions#2005
test(translator): tighten skills security context assertions#2005mesutoezdil wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the agent manifest translation and tests to avoid setting privileged container security context when skills are configured.
Changes:
- Removed
securityContext.privileged=truefrom skills-related golden manifest outputs. - Updated security context tests to assert that skills do not introduce a container security context by default.
- Refactored
buildSkillsRuntimeto no longer mutateneedCodeExecIsolationvia a pointer parameter.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| go/core/internal/controller/translator/agent/testdata/outputs/agent_with_skills.json | Updates golden output to remove privileged container security context. |
| go/core/internal/controller/translator/agent/testdata/outputs/agent_with_git_skills.json | Updates golden output to remove privileged container security context. |
| go/core/internal/controller/translator/agent/security_context_test.go | Adjusts test expectation: skills should not set a container security context. |
| go/core/internal/controller/translator/agent/manifest_builder.go | Removes needCodeExecIsolation mutation from buildSkillsRuntime API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1699ce8 to
7527aee
Compare
skills init container handles loading, main container does not need privileged=true. only BashTool (cfg.GetExecuteCode) needs it. fixes kagent-dev#1997 Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
Reduce multi-line comments to single lines. Replace the weak if-not-nil guard with a direct assert.Nil so the test actually fails when the security context is unexpectedly set. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
8ae08a6 to
d21dc3e
Compare
Skills can execute code though, that's part of the point |
hm, skills run trusted pythn packs installed via the init container, they execute inside the normal python runtime without needing a sandbox. and needcodeexecisolation drives the gvisor sandbox, which is for untrusted arbitrary code execution (executedode). the 2 are separate concerns? |
Why don't they need a sandbox? Skills very often allow the agents to generate code files to run. They also use |
y r right, missed the srt dependency. should i close this and reopen after substrate replaces srt? |
Skills mounting files via an init container do not require a privileged container. That requirement belongs to ExecuteCode (the code sandbox). The previous behavior set needCodeExecIsolation = true inside buildSkillsRuntime as a side effect, causing any agent with skills to get Privileged: true even when code execution was disabled. This change decouples the two: only cfg.GetExecuteCode() drives needCodeExecIsolation, and skills set up their own volumes without touching that flag.
Changes: