Skip to content

Personas: agents pick personas, and who picked sets the limits #781

Closed

Description

@bryantderosier

Item 6 of 11 in the Personas v2: simpler specialists milestone. It ships with or before #743 (auto-approve new Crews and additions without approval).

The problem

I want agents to grab a saved persona when one fits, without me setting up every worker by hand. But once agents are picking personas, and Crews can auto-approve and add members without asking, nothing stops an agent from handing a persona more than it has itself:

  • more access than the agent is running with;
  • models I left unchecked on purpose.

Today, a thread agent that spawns a persona with j5_spawn_agent gets the persona's own access, whatever the caller's is. The user docs even say so: "Spawning is not limited by the spawning agent's own access" (docs/j5/user/personas.md). And personas are the one case allowed to use models outside Models for custom members.

Where this sits

This is decision 1 of the Personas v2 proposal. Bastian's comment "Make launch authority explicit and enforce it everywhere" tightened it. It also narrows one Crews v2 decision: the "personas can use their own models" exception now applies only to personas a person picked.

What we already have

  • j5_spawn_agent: apps/server/src/j5/a2a/SpawnAgentService.ts:367-395. A persona's runtime mode replaces the caller's. Only outside MCP agents are capped, through assertPersonaWithinApprovedLevel (apps/server/src/j5/a2a/mcp/outsideAgent.ts:118).
  • delegate_task: apps/server/src/j5/agents/agentDelegation.ts:63-100. A plain child is held to the eligibility list (memberModels.assertEligible). A persona child skips that check and goes to invokeAgent (agentInvocation.ts). The docs say a persona subagent "cannot broaden the parent's permissions". Check whether that's actually enforced, and where.
  • Crew launches and additions: CrewLaunchService.ts and CrewRuntimeRequestService.ts in apps/server/src/j5/a2a/. A human-approved card can set runtimeModeOverride on the assignment ("Human-approved crew access").
  • Eligibility list: apps/server/src/j5/agents/crewMemberModels.ts (CrewMemberModels.assertEligible), configured in apps/web/src/j5/crew/CrewMemberModelsSettings.tsx, from Crews: choose which models custom members can use #744.
  • Assignment: OrchestrationV2AgentPersonaAssignment in packages/contracts/src/j5/agentPersona.ts:89. It records the resolved route, but not who picked the persona.

Proposal

Who picked the persona sets the limits.

An agent-picked persona:

  • uses only the entries in its list that are also on the eligibility list;
  • can't have more access than the caller's effective sandbox, meaning the runtime mode the caller's thread actually runs with, not the access its own persona declares. A caller with no persona is compared the same way.

If no entry meets both limits, the launch fails with reasons and the caller escalates (#785).

A person-picked persona keeps today's exception: it can use its own models even if they're unchecked, and it gets its saved access. A person picked it when it came from:

  • an @persona mention;
  • a Crew roster card the person approved, edited or not, since the card shows each member's model, reasoning, and access;
  • a member the person edited.

Auto-approved rosters and Captain additions always count as agent picks.

Every persona worker records its pick source:

One service method owns this check, and every launch path calls it:

  • j5_spawn_agent;
  • delegate_task;
  • Crew launches and additions;
  • scheduled tasks that reach any of those.

That way no path can skip it.

Acceptance criteria

  • The persona assignment records its pick source: person, agent, or allow-once with the waived constraint. Old assignments without it still decode.
  • An agent-picked persona skips entries that aren't on the eligibility list, and reports why for each one.
  • An agent-picked persona whose access is broader than the caller's effective sandbox is refused with a reason. A caller with no persona is compared by its thread's runtime mode.
  • The same persona launches when a person picks it: through an @persona mention, an approved roster card (edited or not), or an edited member.
  • Auto-approved rosters and Captain additions are held to the eligibility list and the access cap.
  • j5_spawn_agent, delegate_task, Crew launch, and Crew addition all refuse the same over-limit pick with the same reason. One service method owns the check.
  • The agent guidance and tool descriptions (j5_spawn_agent, delegate_task, j5_propose_crew, j5_request_crew_member) encourage passing persona when one fits, and explain the limits.
  • The Models for custom members note reads "personas you pick can run on their own models".
  • docs/j5/user/personas.md no longer says spawning ignores the spawner's access. docs/j5/product/features/crews.md reflects the narrowed exception.
  • Focused tests cover each launch path refusing an over-access agent pick, an unchecked model skipped for an agent pick but used for a person pick, and the pick source recorded on each.

Out of scope

Open question

How does each path know a person made the pick? An @persona mention and an approved card are clear. For delegate_task, I'd treat any call made during a turn whose user message contains the @persona:ID mention as a person's pick, and every other call as an agent's. Does that hold up, or do we need something more explicit?

Activity

  1. added
    enhancement
    on Oct 29, 2026
  2. added a commit that references this issue on Nov 8, 2026
    35c3a8b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions