Background Agent Secrets and Dockerfile

Describe the Bug

I have a environment.json that uses a Dockerfile to build my environment. It’s been working well, but doing printenv in the Background Agent’s Terminal doesn’t show any of the secrets I’ve set in my Cursor Settings.

Are these secrets available to the host building the Dockerfile or are they supposed to be availble to the agent in the resulting container?

Steps to Reproduce

  1. Setup background agents using a Dockerfile.
  2. Add a secret
  3. printenv in the agent’s terminal.

Expected Behavior

I expect the secret to be available to the agent in their environment.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.2.1 (Universal)
VSCode Version: 1.99.3
Commit: 031e7e0ff1e2eda9c1a0f5df67d44053b059c5d0
Date: 2025-07-03T06:08:06.355Z (4 days ago)
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

2 Likes

Having the same issue.

Same issue here, since a few days. No secrets available in the instance as of today.

Also, if scripts in the install command depend on the secret the container won’t even start. If no a fix, what are workaround we can do in the meantime?

This is probably not related to the app, but a few days later and nothing, still failing in

Version: 1.2.4 (Universal)
VSCode Version: 1.99.3
Commit: a8e95743c5268be73767c46944a71f4465d05c90
Date: 2025-07-10T16:55:16.443Z (1 day ago)
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

I did a printenv in my environment.json install command and I see the variables there. Not sure if something changed but it seems fixed now. @pandaiolo and @riverchen, maybe you can do this too and see if it works for you?

  "install": "printenv && original_command"
1 Like

Yep, I can see the vars now! I have some problems with firebase emulator now, that is running from a Docker image and failing to reach google:

Error: Failed to make request to https://storage.googleapis.com/firebase-preview-drop/emulator/ui-v1.14.0.zip

Haven’t investigate much so far, it’s been a few days it does not work anymore.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.