Cofounder Docs
Environment Files & Secrets
Upload env files, download managed staging env files, and add project secrets.
Environment Files & Secrets
Use Settings > Env Files & Secrets to manage project configuration.
This page has three areas:
- Environment Files for uploading and editing encrypted
.envfiles - Managed Vercel Staging Export for downloading staging environment variables from managed Vercel projects
- Secrets for adding API keys to managed Vercel projects and the development environment
Environment Files
Upload .env files when you want Cofounder to store project configuration as editable variables.
After upload, open the file to view and edit individual variables.
Managed Vercel Staging Export
When a managed app or marketing Vercel project exists, Cofounder can download that project's staging environment variables as a .env file.
If no managed project is available yet, the project selector and download action stay disabled.
Secrets
Use Add Secret for API keys that should be pushed directly to a managed Vercel project.
Choose the secret name, value, target environments, and project. The Staging environment is sent to Vercel Preview behind the scenes. Secret values are sent to Vercel and are not stored in our systems.
Turn on Development environment when code running in the agent's sandbox needs to use the secret through an environment variable. This is useful for local verification against a third-party API, payment provider, or internal service.
Secrets marked this way show a Development badge. You can change development environment access later from the pencil icon and save with Save Development Access.
Only enable a secret for the development environment when the task needs it. Do not paste secret values into task messages or chat.
CLI and API access
Use the CLI to save a secret without putting its value in a command or chat:
cofounder secrets set STRIPE_SECRET_KEY
cofounder secrets set STRIPE_SECRET_KEY --stdin --json < /secure/path/key.txt
cofounder secrets list --json
cofounder secrets delete STRIPE_SECRET_KEY --yes --jsonSet COFOUNDER_ORG_ID to the company you want to change. You must belong to
that company. Interactive input is hidden. With --stdin, every UTF-8 byte is
part of the value, including trailing newlines; the limit is 65,536 bytes.
For JSON output, setting requires --stdin and deleting requires --yes.
The CLI automatically updates production and configured staging in the product Vercel project and attempts redeployment. It does not accept a destination parameter. Existing marketing and development copies remain unchanged. Listing returns names, destinations, configuration status, and timestamps. Deleting removes all tracked copies of the key, including saved parts of an incomplete update.
The same operations are available through HTTP. Use an authenticated bearer
token and X-Organization-Id for every request. HTTP writes require a
destinations list: app and marketing each update production and staging
and attempt redeployment; development makes the secret available through the
existing sandbox credential path. Updating selected destinations preserves the others.
| Method and path | Request | Response |
|---|---|---|
POST /secrets | {"secrets":[{"key":"STRIPE_SECRET_KEY","value":"<supplied privately>","destinations":["app"]}]} | A results array with per-key write receipts |
GET /secrets | No body | A secrets array containing metadata, never values |
DELETE /secrets/STRIPE_SECRET_KEY | No body | {"deleted":true} after all tracked copies are removed |
For example, have your secret source prepare the JSON request in a protected file, then submit that file without placing the value in shell history:
curl --fail-with-body "$COFOUNDER_API_BASE_URL/secrets" \
-H "Authorization: Bearer $COFOUNDER_API_TOKEN" \
-H "X-Organization-Id: $COFOUNDER_ORG_ID" \
-H 'Content-Type: application/json' \
--data-binary @/secure/path/secret-request.jsonUse HTTPS for remote endpoints. Secret names are normalized to uppercase with
hyphens replaced by underscores; names starting with COFOUNDER_ are reserved
for writes. Destinations must be nonempty and unique.
Inspect every POST result, even after HTTP 200. A successful receipt has
success: true, error_code: null, and writes entries containing
destination, scope, and status: "saved". A partial result has
success: false, error_code: "write_incomplete", and reports saved and
unknown scopes. resources_unavailable means destination setup must be fixed
before writing. Invalid requests return a redacted 422 response.
The CLI exits 1 for partial or unknown outcomes and does not automatically replay the request. To recover, re-submit the same intended value; this may trigger another redeploy. HTTP retries should also keep the same destinations. If deletion fails, retry it to remove remaining copies. Metadata cannot prove whether a request with a lost response reached the provider.
Saving a value does not verify a running deployment, and existing apps or sandbox processes may keep using a previous value after it changes or is deleted.
How Agent Secret Access Stays Safe
Agent access does not mean the raw credential is written into the conversation or stored in the workspace.
When a sandbox starts, the agent can use the same environment variable name, such as STRIPE_SECRET_KEY or OPENAI_API_KEY. The value inside the sandbox is a placeholder, not the raw secret.
When sandbox code makes a brokered network request with that placeholder, Cofounder's trusted backend swaps in the real credential for the outbound request. This lets the code call the service without exposing the secret value to the agent's files, chat messages, or normal command output.
For local tools or non-HTTP clients that validate or consume the value before making an HTTP request, run the command through gic-run -- <command>. gic-run resolves brokered placeholders only for the child process environment, applies every secret it can resolve, and skips unresolved placeholders with a warning instead of blocking. It must never be used to print raw secret values; refer to the environment variable name or placeholder name when diagnosing a failure.
If a task no longer needs the credential, turn off Development environment for that secret.