Let Cursor deploy to production safely
Give Cursor a scoped Gregale `--agent` token via `GREGALE_TOKEN` and project rules in `AGENTS.md`, or connect it via `gregale mcp connect --client cursor`, with server-side approval gates, budgets, undo and canary rollbacks.
To let Cursor deploy to production safely, give it a scoped Gregale agent key
via GREGALE_TOKEN instead of your personal gregale login session, or connect
it to Gregale's hosted MCP server. Cursor can then build, deploy, inspect
logs, and check errors non-interactively while Gregale enforces production gates
in the API: risky changes pause for your approval link, releases ramp through
1%, 10%, 50% and 100% with automatic 5xx rollback, non-code changes can be
undone, and a per-agent budget caps spend growth.
Set it up
curl -fsSL https://get.gregale.dev | sh
gregale login # you sign in once in your browser
gregale key create cursor-agent --agent # scoped key for Cursor, not your login
gregale init --agents --name my-api # deploy, check and rollback steps in AGENTS.md
Set GREGALE_TOKEN in Cursor's terminal or MCP environment (do not commit the
token into Git or paste it into rules files). GREGALE_TOKEN overrides any
saved human login so Gregale applies agent limits automatically. Cursor reads
AGENTS.md in the repository root, and you can also register Gregale's hosted
MCP server (in preview) cleanly with one command:
gregale mcp connect --client cursor
Guardrails enforced in Gregale's API
| Risk | What Gregale enforces |
|---|---|
| Cursor deletes or modifies production | Destructive or risky production mutations pause and return a review link for human approval (how) |
| A broken release takes production down | Every deploy climbs 1% → 10% → 50% → 100% and rolls back automatically on 5xx spikes (beta) |
| Cursor alters env vars, crons or scale | gregale mcp connection undo reverses non-code settings, and activity audits writes for 7 days (how) |
| A retry loop inflates hosting costs | Per-agent budget + gregale scale --plan cost preview check spend before changes apply (how) |
Because every rule runs server-side in Gregale's API rather than relying on a
.cursorrules prompt, the guardrails hold even if Cursor invokes shell commands
autonomously.
What Cursor runs in day-to-day deploys
gregale deploy --dry-run
gregale --non-interactive --json deploy --path . --worktree --name my-api
gregale --non-interactive --json app health my-api --errors
--non-interactive --json never opens a browser or blocks on interactive
prompts, and emits structured JSON error codes on stderr so Cursor can diagnose
failures without scraping HTML.
Sources
Deploy with Cursor, Use Gregale from coding agents, Best cloud platform for AI coding agents in 2026.
Questions
- How do I let Cursor deploy to Gregale without risking production?
Run
gregale key create cursor-agent --agent, set it asGREGALE_TOKENin Cursor instead of relying on your personalgregale login, addAGENTS.mdviagregale init --agents, and let Gregale enforce approval links, per-agent spend caps and 1% canary rollbacks in the API.- Does Cursor support Gregale’s MCP server?
Yes. Run
gregale mcp connect --client cursorto connect Cursor tohttps://api.gregale.dev/mcpover OAuth.- Are `.cursorrules` enough to stop unsafe production commands?
No. Prompt rules can be ignored or misinterpreted, whereas Gregale enforces approval gates, budget checks, mutation undo and 5xx canary rollbacks server-side whenever
GREGALE_TOKENis an--agentkey.