Answer: The recommended way is to use the Secrets tab in Cursor settings at cursor.com, where secrets are exposed to the cloud agent as environment variables. You can also use environment-scoped secrets for credentials that should only be available to agents using one environment. Status: Confirmed Entry: tool/cursor/permissions-and-security/cloud-agent-secrets-env-vars Revision: 2 Digest: sha256:5504c759f3f9e76d (changes whenever the content changes) Timeline: Created: 2026-11-13T03:10:17Z Last changed: 2026-11-18T12:31:13Z (TOTP code command: — → oathtool --totp -b "$TOTP_SECRET") Last verified: 2026-11-20T12:37:05Z Next check: 2026-11-21T12:37:05Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of recommended method | Secrets tab in Cursor settings | [1] | 2026-11-20 how secrets are exposed | environment variables | [1] | 2026-11-20 environment-scoped secrets scope | every repo in that environment | [1] | 2026-11-20 TOTP code command | oathtool --totp -b "$TOTP_SECRET" | [1] | 2026-11-20 AWS IAM role secret name | CURSOR_AWS_ASSUME_IAM_ROLE_ARN | [1] | 2026-11-20 AWS profile | cursor-cloud-agent | [1] | 2026-11-20 Sources: [1] Anysphere. "cursor.com/docs/cloud-agent/setup.md". https://cursor.com/docs/cloud-agent/setup.md Role: primary. Accessed: 2026-11-20T12:37:05Z Quote: "Recommended: use the Secrets tab in Cursor settings" (Supports: recommended method) Quote: "These are exposed to the cloud agent as environment variables." (Supports: how secrets are exposed) Quote: "Environment-scoped secrets apply to every repo in that environment." (Supports: environment-scoped secrets scope) Quote: "The agent can generate the current 6-digit code with `oathtool --totp -b "$TOTP_SECRET"`." (Supports: TOTP code command) Quote: "add a user or team secret named `CURSOR_AWS_ASSUME_IAM_ROLE_ARN` set to the ARN of the IAM role you created." (Supports: AWS IAM role secret name) Quote: "`AWS_PROFILE` is set to `cursor-cloud-agent`" (Supports: AWS profile) Snapshot SHA-256: bee9bf95b0d0ddc89471ed9a2785bf36af0740a8856abbbdc55e98692c1af03d (captured 2026-11-17T12:46:57Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-17T12:46:58Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:37:05Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:37:05Z Last attempt: 2026-11-20T12:37:05Z Notes and limitations: Extracted automatically from a single official source (section "Environment variables and secrets"). Related: https://latestn.com/tool/cursor/permissions-and-security/cloud-agents-api-authentication How do I authenticate requests to the Cursor Cloud Agents API? https://latestn.com/tool/cursor/permissions-and-security/config-file-edit-approval Do Cursor agents need approval to edit configuration files? https://latestn.com/tool/cursor/permissions-and-security/configure-auto-review How do I configure Auto-review in Cursor? https://latestn.com/tool/cursor/permissions-and-security/cloud-agent-secret-access Can Cursor Cloud Agents read secrets and credentials? https://latestn.com/tool/cursor/permissions-and-security/cloud-agent-secret-types What are the different secret types in Cursor Cloud Agents and when should I use each? https://latestn.com/tool/cursor/permissions-and-security/cloud-agent-secrets-and-network-access How do I give a Cursor Cloud Agent access to secrets and network URLs it needs? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T12:31:13Z | changed | TOTP code command: — → oathtool --totp -b "$TOTP_SECRET" | [1] 2026-11-18T12:31:13Z | changed | environment-scoped secrets scope: — → every repo in that environment | [1] 2026-11-18T12:31:13Z | changed | how secrets are exposed: — → environment variables | [1] 2026-11-18T12:31:13Z | changed | recommended method: — → Secrets tab in Cursor settings | [1] 2026-11-18T12:31:13Z | changed | STS credential expiry: 1 hour → — | [1] 2026-11-18T12:31:13Z | changed | TOTP 2FA code command: oathtool --totp -b "$TOTP_SECRET" → — | [1] 2026-11-18T12:31:13Z | changed | Environment-scoped secrets: Environment-scoped secrets apply to every repo in that environment. → — | [1] 2026-11-18T12:31:13Z | changed | Recommended method: Secrets tab in Cursor settings → — | [1] 2026-11-13T03:10:17Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/cursor/permissions-and-security/cloud-agent-secrets-env-vars/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/cursor/permissions-and-security/cloud-agent-secrets-env-vars POST: https://latestn.com/dispute/tool/cursor/permissions-and-security/cloud-agent-secrets-env-vars with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/cursor/permissions-and-security/cloud-agent-secrets-env-vars?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I add secrets and environment variables to a Cursor cloud agent? Revision 2, last verified 2026-11-20T12:37:05Z. https://latestn.com/tool/cursor/permissions-and-security/cloud-agent-secrets-env-vars (accessed 2026-11-21T10:02:55Z). @misc{LatestN_tool_cursor_permissions_and_security_cloud_agent_secrets_env_vars_r2, title = {How do I add secrets and environment variables to a Cursor cloud agent?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/cursor/permissions-and-security/cloud-agent-secrets-env-vars}}, note = {Revision 2; digest sha256:5504c759f3f9e76d; last verified 2026-11-20T12:37:05Z; accessed 2026-11-21T10:02:55Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/cursor/permissions-and-security/cloud-agent-secrets-env-vars