# Environment variables in cursor agent

**URL:** <https://forum.cursor.com/t/environment-variables-in-cursor-agent/61444>\
**Category:** Help\
**Created:** [March 9, 2025, 4:43am UTC](https://forum.cursor.com/t/environment-variables-in-cursor-agent/61444 "2025-03-09T04:43:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manifestautomation](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@manifestautomation](https://forum.cursor.com/u/manifestautomation)\
**Post date:** [March 9, 2025, 4:43am UTC](https://forum.cursor.com/t/environment-variables-in-cursor-agent/61444/1 "2025-03-09T04:43:40Z")

</div>

Hey , when cursor agent executes a command like “node foo.js”, and foo.js contains something like:

> const token = process.env.SECRET\_TOKEN

Is that environment variable coming from my terminal environment or cursors? Is there a way I can set secrets for cursor to use when it runs scripts that use environment variables?

---

<div class="post-metadata">

**Author:** ![lzd-1230](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/lzd-1230/32/40550_2.png) [@lzd-1230](https://forum.cursor.com/u/lzd-1230)\
**Post date:** [March 29, 2025, 1:25pm UTC](https://forum.cursor.com/t/environment-variables-in-cursor-agent/61444/2 "2025-03-29T13:25:28Z")

</div>

yeah，something like conda activate are alse needed in agent running command situation

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [June 18, 2026, 10:36am UTC](https://forum.cursor.com/t/environment-variables-in-cursor-agent/61444/3 "2026-06-18T10:36:02Z")

</div>

Closed on June 18, 2026, 10:36am UTC


