Skip to content

test(translator): tighten skills security context assertions#2005

Open
mesutoezdil wants to merge 5 commits into
kagent-dev:mainfrom
mesutoezdil:test/tighten-security-context-tests
Open

test(translator): tighten skills security context assertions#2005
mesutoezdil wants to merge 5 commits into
kagent-dev:mainfrom
mesutoezdil:test/tighten-security-context-tests

Conversation

@mesutoezdil

@mesutoezdil mesutoezdil commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
  • Replace weak if containerSecurityContext != nil guard with assert.Nil so the test fails when a security context is unexpectedly set.
  • Reduce multi-line comment blocks to single lines in TestSecurityContext_SkillsNoPrivileged and TestSecurityContext_SkillsPSSRestricted.
  • Remove em dash from TestSecurityContext_SkillsPSSRestricted comment.

mesutoezdil and others added 4 commits June 11, 2026 18:23
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>
Copilot AI review requested due to automatic review settings June 12, 2026 21:45
@github-actions github-actions Bot added the testing Additional testing required label Jun 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=true from skills-related golden manifest outputs.
  • Updated security context tests to assert that skills do not introduce a container security context by default.
  • Refactored buildSkillsRuntime to no longer mutate needCodeExecIsolation via 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.

Comment thread go/core/internal/controller/translator/agent/manifest_builder.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Additional testing required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants