You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose agentId in subagentStart hook for secure parent-child policy correlation #5059
Describe the feature or problem you'd like to solve
The subagentStart hook provides the parent session’s sessionId, but does not expose the agentId of the subagent being started.
Subsequent hooks triggered by that subagent, such as preToolUse, use the subagent’s agentId as their sessionId. This means there is currently no deterministic way to associate a subagent’s tool calls with the parent session before those tool calls occur.
This becomes a problem when implementing security or policy enforcement around hooks. For example, a parent session may establish a policy context containing its working directory, repository, branch, and allowed operations. Subagents should inherit that context, but without knowing their agentId at subagentStart, their later preToolUse calls cannot be safely mapped back to the parent.
This is especially important in Fleet mode, where multiple subagents may execute concurrently and heuristic correlation based on working directory, timing, or agent name would not be reliable.
This appears to be resolved as of GitHub Copilot CLI v1.0.114. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.
Activity
copilot-cli-bot commentedon Nov 24, 2026
This appears to be resolved as of GitHub Copilot CLI v1.0.114. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.