Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

confine: RunAgent truncates the command when it contains its own literal --

Closed Beginner friendly
#133 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #231 by @tnalbant — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
cli, security

Research direction

Start with cli/confine/run.go:37, where RunAgent separates confine’s flags from the agent command, and trace how the remaining arguments reach the agent invocation. Reproduce with confine run -- mytool arg1 -- arg2 arg3; done means the agent receives every token after the first separator, including its own -- and the trailing arguments.

Written by the indexing model from the issue text.

Description

bug good first issue

Problem

In packages/cli/confine/run.go:37, RunAgent splits its own arguments on the first -- it finds to separate confine's own flags from the agent command to run, but if the agent command itself legitimately contains a -- token (e.g. as an argument to the wrapped program), everything after that embedded -- is dropped rather than passed through to the agent.

Impact

Any agent invocation whose own command line needs to include a literal -- argument (common for tools that use -- to separate their own flags from positional arguments) has that argument and everything after it silently truncated, changing the effective command run and potentially breaking the wrapped tool or silently dropping intended arguments.

Repro

  1. Invoke confine with an agent command that itself contains --, e.g. confine run -- mytool arg1 -- arg2 arg3.
  2. Observe that arg2 arg3 (everything after the agent's own --) is truncated from what actually gets executed, rather than being passed through as part of the agent's arguments.

Suggested fix

Split only on the first -- to separate confine's own flags from the start of the agent command (this part is correct), but then pass every remaining token, including any subsequent literal --, through to the agent invocation unmodified, rather than re-applying ---splitting logic to the already-separated agent command portion.

Dominant language
Go
Stars
157
Forks
19
Avg merge
4h 21m
Merged PRs (30d)
91

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from solongate/agent-security

All issues in solongate/agent-security

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.