Skip to content

fix(runtime): propagate session permissions to background agents and skills#3490

Open
Piyush0049 wants to merge 1 commit into
docker:mainfrom
Piyush0049:fix/background-agent-permissions
Open

fix(runtime): propagate session permissions to background agents and skills#3490
Piyush0049 wants to merge 1 commit into
docker:mainfrom
Piyush0049:fix/background-agent-permissions

Conversation

@Piyush0049

Copy link
Copy Markdown
Contributor

Overview

This PR resolves an issue where background agents and run_skill sub-sessions were bypassing session-level permission rules by relying on a hardcoded ToolsApproved: true flag.

Changes

  • Propagated Permissions: Added Permissions: params.ParentSession.Permissions to the SubSessionConfig in agent_delegation.go and skill_runner.go.
  • Removed Security Bypass: Removed the hardcoded ToolsApproved: true from RunAgent. Background tasks now correctly inherit both the ToolsApproved boolean and the granular Permissions rules from their parent session.

Security Impact

This is a strict security improvement. By passing the parent permissions down, the sub-sessions correctly integrate with the dispatcher's auto-deny logic:

  1. Explicitly approved tools (YOLO mode or Allow lists) run seamlessly.
  2. Tools requiring user confirmation (default Ask) hit the dispatcher's NonInteractive check and are safely auto-denied, preventing background agents from hanging or bypassing user consent.

…skills

This removes the hardcoded ToolsApproved bypass and ensures background tasks inherit the Allow/Deny/Ask permission configuration from their parent session. When tools fall back to 'Ask' in a background non-interactive context, the dispatcher correctly auto-denies them.
@Piyush0049 Piyush0049 requested a review from a team as a code owner July 6, 2026 18:04
@aheritier aheritier added kind/fix PR fixes a bug (maps to fix:). Use on PRs only. area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection labels Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants