# Use Guardry Secrets with Cursor

> Connect Cursor to your Guardry vault with one scoped agent credential, the guardry CLI and the guardry-secrets skill.

Give Cursor a credential of its own instead of a `.env` file full of keys. Cursor reads only what the credential's scope and permissions allow, and each value it reads is recorded in the audit log. Setup takes one credential, one install command and one login.

## 1. Create an agent credential

[Request an invite](https://guardry.ai/invite/), or [sign in](https://app.guardry.ai/app/), and add the secrets Cursor needs.

Open **Agent access** and choose **Connect agent**. Set the scope (one environment, or every current and future environment in the organization), the permissions and the lifetime (1 hour, 4 hours, 7 days or 30 days). An optional name prefix such as `STRIPE_` narrows it further. The credential is shown once.

## 2. Install the CLI and the skill

```sh
curl -fsSL https://app.guardry.ai/install.sh | sh
```

This installs the `guardry` CLI and the `guardry-secrets` skill. The installer puts the skill in the shared agent-skills directory and, when it detects Cursor, in the Cursor directory too. To install it for Cursor explicitly:

```sh
guardry skill install --agent cursor
```

Start a new agent session to discover the skill. Installing it grants no access.

## 3. Sign in with a profile

```sh
guardry login --profile coding-agent
guardry --profile coding-agent whoami
guardry --profile coding-agent secrets list
```

`guardry login` asks for the credential at a hidden prompt. The other two commands check the profile and list entry names without reading any value.

## 4. Ask Cursor to use it

Tell Cursor which profile to use and what to run: "Use Guardry profile coding-agent to run this application with API_KEY. Do not print the value."

The CLI puts the named values into the program's environment and writes nothing to disk.

```sh
guardry --profile coding-agent secrets run --secret API_KEY --secret DATABASE_URL -- python agent.py
```

## 5. Use MCP instead, if you prefer

```sh
guardry --profile coding-agent mcp config
```

This prints the configuration for the MCP server built into the CLI: an executable path and a profile name, no credential. Add the printed configuration to your MCP client's server settings. See [the MCP server page](https://guardry.ai/agents/mcp.md).

## What the agent can and cannot do

- **Can** search names, descriptions and credential bundles without reading a value.
- **Can** read secret values, if the credential allows it. You can require your approval for each request.
- **Can** use an assigned service without ever receiving its credential. Two exist today: GitHub repository and issue reads for one named repository, and TOTP one-time codes.
- **Can** create new entries, if the credential allows it.
- **Cannot** edit, rotate or delete an existing entry, including one it created.
- **Cannot** see members, manage credentials or approve anything.

An agent that can read a secret can copy it. Guardry cannot control what a program does with a value afterwards.

## Questions

### Can Cursor change or delete my secrets?

No. An agent can never edit, rotate or delete an existing entry, including one it created. It can create new entries if you permit that.

### Should I use the skill or the MCP server?

Either works. Both use the same profile. The skill teaches the agent to use the `guardry` CLI. The MCP server has no plaintext-read tool unless you start it with `--allow-plaintext-tools`. Either way, the credential's permissions and any approval you require still apply.

### Which values should be secrets and which variables?

A secret's value is hidden. A variable's value is visible to every agent credential that covers its environment, without approval. Use variables for configuration that is not sensitive, such as a region name, and keep keys, tokens and passwords as secrets.

---

Source: https://guardry.ai/agents/cursor/ · Updated 2026-11-27 · Guardry for language models: https://guardry.ai/llms.txt
