Skip to content

feat(delegation): add policy-bound profiles - #50720

Closed
marcusglee11 wants to merge 1 commit into
NousResearch:mainfrom
marcusglee11:feature/delegation-profiles-v1
Closed

feat(delegation): add policy-bound profiles#50720
marcusglee11 wants to merge 1 commit into
NousResearch:mainfrom
marcusglee11:feature/delegation-profiles-v1

Conversation

@marcusglee11

Copy link
Copy Markdown

Summary

Implements a v1 of policy-bound delegation profiles for delegate_task.

  • Adds optional profile to top-level delegate_task and per-task batch entries.
  • Resolves profiles from trusted delegation.profiles config.
  • Lets profiles set provider/model/base_url via the existing credential resolver, trusted ACP transport, reasoning effort, toolset allowlist, approval policy provenance, and per-profile max iterations.
  • Fails closed on unknown/malformed profiles.
  • Rejects profile combined with per-call acp_command / acp_args so raw task payloads cannot mutate trusted transport policy.
  • Emits profile/provider/transport/toolsets/approval/max-iteration provenance in subagent result entries.

Safety shape

Profiles are policy objects, not free per-call provider overrides:

  • profile toolsets are an upper bound;
  • per-call toolsets may narrow but not widen;
  • explicit empty toolsets: [] means no toolsets rather than falling back;
  • profile ACP fields are config-only and validated;
  • profile + per-call ACP override conflicts are rejected by key presence, including acp_args=[].

Review provenance

AA/Oracle architecture review on the issue returned AMEND: implement named policy-bound profiles rather than arbitrary per-call model/provider overrides.

A follow-up AA implementation review returned REVISE; blockers were addressed before this PR:

  • empty profile toolsets no longer fail open;
  • acp_args=[] conflict is rejected;
  • MCP inheritance cannot widen profiled toolsets;
  • ACP profile fields are validated.

Tests

  • python3 -m py_compile tools/delegate_tool.py
  • uv run --with pytest python -m pytest tests/tools/test_delegate.py -q148 passed
  • uv run --with ruff ruff check tools/delegate_tool.py tests/tools/test_delegate.pyAll checks passed!

Related

Builds on / addresses the integrated enhancement proposed in #9459.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/delegate Subagent delegation labels Jun 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: #4928 (feature request for named delegation capability profiles), #11169 / #34754 / #41998 (open competing implementations), #44412 (closed earlier attempt).

This PR takes a distinct policy-bound mechanism (toolsets as an upper bound that per-call args may narrow but not widen, fail-closed validation, ACP-override conflict rejection, AA/Oracle review provenance) rather than the flexible override-with-fallback approach of the sibling PRs. Tracking as related so reviewers can compare mechanisms across the cluster — not marking duplicate.

@teknium1

teknium1 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

This is the kanban

@teknium1 teknium1 closed this Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have tool/delegate Subagent delegation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants