INTEGRATE

Cursor

Use Phase from Cursor in two ways.

  • Connections: Cursor uses services such as AWS and PostgreSQL through your Agent Workflow's Connections, approved in the Phase Console. It only ever sees decoy credentials; the Phase AI proxy swaps in the live ones. See Phase AI.
  • Application secrets: Cursor can list, create, rotate and delete secrets in your Phase apps without reading their values.

Prerequisites

  • The Phase CLI, installed and up to date.
  • Cursor installed.
  • For Connections: an Agent and a Workflow in the Phase Console.

Setup

1. Log in

For Connections, log in with an Agent token for the Agent's Workflow, created in the Phase Console:

phase auth --mode token

For application secrets, log in as yourself with phase auth: Agent tokens can't access application secrets. To use Connections with your own login, set the Workflow in the next step with --workflow <workflowId>.

2. Enable Phase for Cursor

Run this yourself, in your own terminal. Cursor isn't allowed to run it.

phase ai enable --harness cursor

It installs:

  • The phase-cli-ai-relay and phase-cli-app-secrets skills in ~/.cursor/skills/.
  • The phase-ai-bootstrap plugin in ~/.cursor/plugins/local/phase-ai-bootstrap/, which starts the proxy when Cursor first calls Phase.

It also creates the Phase AI CA and offers to trust it for your user (see The proxy CA), and asks whether Cursor may read secret values.

3. Restart Cursor

Reload or fully restart Cursor, start a new Agent chat, then repeat your original prompt.


Using Connections

Ordinary commands keep your usual credentials. When you ask Cursor to use Phase, it runs the command with phase ai exec, adding --connection <connectionId> when a service has several Connections:

phase ai exec -- aws s3 ls

The plugin starts the Phase AI proxy the first time Cursor calls Phase, and phase ai exec reuses it.

You: what can Phase manage here?
You: use Phase to list the S3 buckets in our dev AWS account
You: use Phase to count yesterday's orders in the analytics database

When the Workflow has no Connection for what you asked, Cursor creates a request and shows you a link to it in the Phase Console. Create or choose the credential there and approve the request; Cursor waits and then carries on. See Requests and approvals.


Managing application secrets

The phase-cli-app-secrets skill lets Cursor work with your Phase apps and environments without seeing sensitive values:

  • List apps, environments and secret keys.
  • Create or rotate secrets with random values (--random), so the value never appears in the conversation.
  • Create and update non-sensitive config values.
  • Delete secrets, after confirming the app, environment and path.
You: list the secret keys in staging for the backend app
You: create STRIPE_WEBHOOK_SECRET as a sealed secret with a random value
You: rotate API_TOKEN in development
You: set LOG_LEVEL to debug in development

Cursor doesn't read secret values (phase secrets get, phase secrets list --show, phase secrets export), import .env files, or run phase run or phase shell. Run those yourself in a terminal. When a sensitive value has to be entered by hand, Cursor asks you to enter it in the Phase Console or your terminal rather than in the chat.

Secret visibility

TypeVisible to CursorDescription
configAlwaysNon-sensitive configuration, such as ports, hosts and flags
secretYour choice in phase ai enable (--mask or --no-mask)Standard encrypted secrets
sealedNeverWrite-only secrets, such as API keys, tokens and passwords

Security guardrails

GuardrailEnforcement
Live provider credentialsStay in the Phase AI proxy; Cursor only sees decoys
Calls that mint new credentials (for example sts:GetSessionToken)Blocked by the proxy
phase ai enable / phase ai disableBlocked; run them yourself
printenv, env, export, set, declare, compgen inside phase runBlocked by the CLI
phase shellBlocked for AI agents
Sealed secret values in outputAlways redacted
Secret values in phase secrets outputRedacted according to your visibility choice

Managing the integration

# Check setup, the proxy and the Workflow's Connections
phase ai status

# Refresh the skills and plugin after a CLI upgrade
phase ai enable --harness cursor

# Remove the integration
phase ai disable

# Print the Phase AI skill
phase ai skill

Troubleshooting

Cursor doesn't know about Phase

Check that the skills are installed:

ls ~/.cursor/skills/phase-cli-ai-relay/SKILL.md ~/.cursor/skills/phase-cli-app-secrets/SKILL.md

If they're missing, run phase ai enable --harness cursor and restart Cursor.

Phase-managed commands fail

Run phase ai status and check the Proxy and Connections lines. A Connection must be ready. When Cursor reports a Phase error, it quotes the X-Phase-Event-Id from the response, which you can look up in the Phase Console.

Authentication errors

Check who you're logged in as:

phase users whoami

Log in again with phase auth --mode token for an Agent token, or phase auth for your own account.