Cursor

Redact secrets from your Cursor agents and prevent them from leaking into logs.

Prerequisite

Install the Cursor CLI. The Cursor desktop app does not necessarily install the separate agent command.
$ curl https://cursor.com/install -fsS | bash
$ agent --version

1. Install

Get the Dotenvx CLI.

$ curl -sfS https://dotenvx.sh | sh

2. Add your secrets

Add a secret to your .env file.
$ echo "HELLO=World" > .env

3. Run Cursor with redaction

Run Cursor with your real secrets while redacting them from its output.
$ dotenvx run --redact -- agent -p --force 'Run `dotenvx get HELLO` and echo back just Hello VALUE' --output-format text
Hello [REDACTED]