Admin Cursor SDK Dispatch
The admin automations page can launch Cursor cloud agents for focused repo work. The dispatch flow is standalone: it talks only to the Cursor SDK and has no dependency on any cron or legacy automation integration.Admin flow
- A verified admin opens
/admin/internal/automations. - The admin chooses a task kind and enters a bounded repo prompt.
- The browser posts to
/api/admin/automations/cursor-agentusing the existing FM session. - The server validates admin access, calls
Agent.prompt(...), and returns the terminal SDK result. - Cursor-created PRs appear in the existing automations PR table when they match one of these conventions:
- branch starts with
cursor-sdk/ - PR title starts with
[Cursor SDK] - PR has a
cursor-sdklabel
- branch starts with
Request contract
POST /api/admin/automations/cursor-agent
Headers:
Content-Type: application/json- existing
fm_sessioncookie orAuthorization: Bearer <fm_session_jwt>
kind must be one of:
smoke-test-fixci-fixtech-debt
branch is optional. When omitted, the server generates cursor-sdk/<kind>-<timestamp>.
Environment
Required:CURSOR_API_KEY
CURSOR_AGENT_REPO_URLoverrides the default Funding Machine GitHub repo URL.CURSOR_AGENT_MODELoverrides the defaultcomposer-2model.
Guardrails
- The SDK runs only on the server. Never expose
CURSOR_API_KEYto the browser. - Dispatch is self-contained: it requires only the Cursor SDK environment above and does not depend on, call, or emit events to any other automation system.
Agent.prompt(...)is used because it is a one-shot API that disposes SDK resources automatically.

