{"record":{"id":"5652d541ddc8f8eb","repo":"paperclipai/paperclip","slug":"profile-ctx-profilename-is-persona-ctx-prof-5652d5","errorCode":null,"errorMessage":"Profile '${ctx.profileName}' is persona=${ctx.profile.persona}; use an agent prompt command or a board profile.","messagePattern":"Profile '(.+?)' is persona=(.+?); use an agent prompt command or a board profile\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/prompt.ts","lineNumber":147,"sourceCode":"    actor: \"agent\",\n    agent: me,\n    companyId: me.companyId,\n    prompt: body,\n    issueId: opts.issue,\n    title: opts.title,\n    wake: opts.wake !== false,\n  });\n  return result;\n}\n\nexport async function runBoardPrompt(\n  agentRef: string,\n  prompt: string,\n  opts: PromptOptions,\n): Promise<PromptResult> {\n  const ctx = resolveCommandContext(opts, { requireCompany: true });\n  if (ctx.profile.persona && ctx.profile.persona !== \"board\") {\n    throw new Error(`Profile '${ctx.profileName}' is persona=${ctx.profile.persona}; use an agent prompt command or a board profile.`);\n  }\n  const body = normalizePrompt(prompt);\n  const query = new URLSearchParams({ companyId: ctx.companyId ?? \"\" });\n  const agent = await ctx.api.get<Agent>(`${apiPath`/api/agents/${agentRef}`}?${query.toString()}`);\n  if (!agent) throw new Error(`Agent not found: ${agentRef}`);\n\n  return createOrCommentForAgent({\n    api: ctx.api,\n    actor: \"board\",\n    agent,\n    companyId: ctx.companyId ?? agent.companyId,\n    prompt: body,\n    issueId: opts.issue,\n    title: opts.title,\n    wake: opts.wake !== false,\n  });\n}\n","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/prompt.ts#L129-L165","documentation":"`runBoardPrompt` resolves the active profile and requires its `persona` to be `board` (or unset). If the profile persona is `agent`, it throws before any API request, because a board prompt must run with board/operator credentials and targets an agent by reference. This is the mirror of the agent-prompt persona guard.","triggerScenarios":"Invoking `paperclipai board prompt --agent <agentRef> ...` while the active profile is an agent persona (connected via `paperclipai connect` choosing the agent flow). Also triggered by `--profile <agentProfileName>` on the board prompt command.","commonSituations":"An operator and an agent sharing the same machine/context file; the current profile was set to the agent identity and the operator ran a board-prompt without switching; CI using an agent key where board auth is required.","solutions":["Switch to a board profile: `paperclipai --profile <boardProfile> board prompt --agent <ref> ...`","Reconfigure the profile persona to board via `paperclipai connect` (choose board)","If you actually are the agent, use `paperclipai agent prompt ...` instead"],"exampleFix":"# before (current profile is an agent profile)\npaperclipai board prompt --agent agent-1 \"do work\"\n# after\npaperclipai --profile board-op board prompt --agent agent-1 \"do work\"","handlingStrategy":"validation","validationCode":"function profileIsBoard(options: { context?: string; profile?: string }): boolean {\n  const { profile } = resolveProfile(readContext(options.context), options.profile);\n  return !profile.persona || profile.persona === \"board\";\n}\nif (!profileIsBoard(opts)) {\n  throw new Error(\"Switch to a board profile before running a board prompt.\");\n}","typeGuard":"function isBoardProfile(profile: { persona?: string }): profile is { persona: \"board\" } {\n  return profile.persona === \"board\";\n}","tryCatchPattern":null,"preventionTips":["Verify the active profile persona before board commands","Use `--profile` to be explicit","Separate board and agent contexts to prevent accidental cross-use"],"tags":["cli","profile","persona","auth","validation"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}