You see a redacted credential in the settings page, but your Python job still fails after the key changes.
For this week, use the Web UI for personal interactive trials, inject DEEPSEEK_API_KEY at runtime for Python SDK and CI jobs, and give shared remote Macs restricted execution accounts instead of one team-wide secret.
SECTION 01 Who should read this?
This guide is for developers configuring DeepSeek Harness on a personal Mac, platform engineers maintaining shared or remote Macs, and team leads defining key rotation or offboarding rules.
The important question is not which input field feels easier. It is who owns the DeepSeek API Key, who can read it, and who must replace or revoke it.
SECTION 02 Start with the storage decision, not the interface
DeepSeek Harness presents several practical credential paths, but they serve different operating models.
For a single user testing a model through the Web UI, the built-in credential entry is usually the shortest route. The documented behavior is that the secret is written under the $DSH_HOME/.credentials.yaml location, while the settings view retains a reference and returns a redacted description instead of exposing the full value again. This is useful for an interactive session because you do not need to edit a project file every time you start the harness.
That convenience has limits.
A redacted display does not mean the key is unreadable to every local process. A user account, backup job, diagnostic tool, or remote administrator with sufficient access may still reach the underlying file or the process environment. Treat “not shown in the interface” and “not accessible on the machine” as two separate security claims.
For Python SDK work, the stronger default is a runtime environment variable. DeepSeek’s official Python examples read the credential with os.environ.get('DEEPSEEK_API_KEY'), while the client keeps the API endpoint and application logic in code. (DeepSeek’s official Python API sample)
The official DeepSeek first API call guide also separates the API endpoint, model request, and authentication value, which is the right boundary to preserve when you move from a personal test to a repeatable process.
Personal UI storage is a convenience choice. Runtime injection is a lifecycle choice.
The distinction matters because the same key can move through several places during a normal development cycle:
- The provider settings screen.
$DSH_HOME/.credentials.yaml.- A shell profile or launch script.
- A Python process environment.
- A CI runner or remote task account.
- Logs, error traces, session records, and support archives.
Each additional location expands the review and rotation burden. If a key appears in four places, replacing it in the provider configuration alone may leave three stale copies behind.
SECTION 03 What the Web UI stores and what it does not prove
The Web UI is suitable when one person owns the machine, the session is interactive, and the credential does not need to travel with a repository or deployment artifact.
According to the current Harness provider behavior, the saved credential is associated with the local configuration path represented by $DSH_HOME/.credentials.yaml. The interface does not continue to display the complete secret after saving; it shows a masked or redacted description and preserves a credential reference in the settings data.
That gives you three operational benefits:
- You avoid pasting the secret into every new session.
- You can keep provider configuration separate from application source code.
- You can replace the stored credential without rewriting Python files or project configuration.
It does not give you automatic enterprise secret management. The current fact boundary does not establish built-in operating-system keychain support, a managed enterprise vault integration, or automatic rotation. Do not describe those capabilities as part of DeepSeek Harness unless the version-specific provider guide confirms them.
The local account boundary is therefore decisive. On a personal Mac, use a dedicated user account if the computer is also used by family members, contractors, or visiting developers. Limit remote login and screen-sharing access. Review whether the home directory is included in backups. If the Mac is rented or administered by another party, confirm who can access the filesystem before placing a long-lived key in a local credentials file.
You can review the broader account and privacy responsibilities in the VPSNIX privacy policy, but do not treat a policy page as a substitute for OS-level permission review.
SECTION 04 Python SDK projects should use runtime injection
A Python SDK project normally needs repeatable startup, isolated sessions, and easy credential replacement. Those requirements favor environment variables over hard-coded values.
The official DeepSeek Python pattern is direct:
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("DEEPSEEK_API_KEY"),
base_url="https://api.deepseek.com",
)
The API documentation uses the same environment variable name in Python examples and in other OpenAI-compatible integrations. (DeepSeek’s official Python API sample)
The advantage is not that an environment variable is invisible. A process can read its own environment, and privileged operators may inspect process details depending on the operating system and tooling. The advantage is that the credential is injected at the execution boundary rather than embedded in source code.
Use this pattern when:
- You run several independent project directories.
- You need to test a replacement key without changing application files.
- You create disposable virtual environments.
- You start the same job locally, through CI, and on a remote Mac.
- You want the repository to remain safe to clone and review.
Do not commit any of the following:
- An
export DEEPSEEK_API_KEY=...command containing the real value. - A
.envfile with an active secret. - A shell script that writes the secret into a tracked configuration file.
- A notebook cell containing a literal API key.
- A test fixture that uses a production credential.
- A failed command copied into an issue or build log.
If you need a persistent local startup file, keep it outside the repository, restrict its permissions, and document only the variable name in the project. A safe example can show DEEPSEEK_API_KEY=replace-me, but it must never contain a usable credential.
For deployment, inject the variable immediately before the process starts. Then verify that the application fails closed when the variable is missing. A clear authentication error is safer than silently switching to a different account or provider.
DeepSeek’s public examples also show environment-variable-based configuration for command-line and agent integrations, reinforcing the separation between application configuration and the secret value. (DeepSeek’s official Crush integration guide)
SECTION 05 Remote automation should bind credentials to execution identity
A scheduled task, CI job, or background agent should not inherit the key of whichever user happened to install DeepSeek Harness on the Mac.
Bind the secret to the task account, repository, project, or execution pool. That way, the credential owner matches the work being performed. If a customer task needs to stop, you can disable that task identity without interrupting unrelated internal jobs.
The minimum runtime sequence is:
- The scheduler selects the intended task identity.
- The runner injects
DEEPSEEK_API_KEYinto the process environment. - The harness starts with a clean session directory.
- The task performs a short authentication check.
- Logs record the provider and request status, but never the secret.
- The runner removes or invalidates the injected value when the task ends.
The fifth step requires more than searching for the literal key. Check for:
- Authorization headers in verbose HTTP output.
- Exception objects that include request configuration.
- Shell tracing enabled with
set -x. - Diagnostic dumps of environment variables.
- Session exports that preserve provider settings.
- Crash reports or temporary files created by wrappers.
Define a stop signal before the first unattended run. For example, a failed authentication response, an unexpected provider identifier, or a missing environment variable should stop the job rather than trigger indefinite retries. Repeated retries can create noisy logs, obscure the original failure, and complicate the question of which credential was actually used.
When a job fails, compare its behavior with the official DeepSeek error code guide. Authentication failures, invalid request formats, rate limits, and service errors require different responses; treating every failure as a bad key can lead to unnecessary rotation or unsafe retry loops.
DeepSeek’s public examples also show environment-variable-based configuration for command-line and agent integrations, reinforcing the separation between application configuration and the secret value. (DeepSeek’s official agent integration documentation)
SECTION 06 Shared Mac environments need separate responsibility lanes
A shared remote Mac is not equivalent to a personal workstation with more CPU capacity. It has more users, more sessions, and more opportunities for ownership to become ambiguous.
At minimum, separate these responsibility lanes:
- Administrator: manages accounts, permissions, provider configuration, and emergency access.
- Task execution account: runs scheduled or automated work and receives only the credentials required for that work.
- Ordinary access account: can use approved tools but cannot read every stored credential or modify provider configuration.
Do not assume that a single $DSH_HOME/.credentials.yaml file solves multi-user access. The file may be hidden from normal interface views while remaining readable to an account with filesystem access. Check the file owner, group permissions, parent directory permissions, backup scope, and remote administration path.
A team-wide key also creates two operational failures.
First, attribution becomes weak. If several people use one DeepSeek API Key, the provider may show usage under one credential even when different projects caused the requests. Your internal logs may not be sufficient to reconstruct ownership.
Second, rotation becomes disruptive. If a customer project, internal experiment, and nightly automation share one key, a single replacement can interrupt all three. Separating credentials by project or cost center lets you rotate one lane while keeping the others running.
You should not force separate keys where the provider or account model cannot support them. Instead, separate the execution accounts and maintain an internal mapping of account, project, owner, and rotation responsibility. The goal is not to create paperwork. The goal is to answer, within one incident review, who could read the key and who must replace it.
For a broader remote Mac permission design, connect this credential decision with the VPSNIX help center rather than treating API configuration as an isolated task.
SECTION 07 Use this decision path before you save anything
Choose the first condition that matches your workload.
- If one person owns the Mac, uses DeepSeek Harness interactively, and does not share the session, choose the built-in Web UI credential entry. Keep the local account protected and review backup and remote-access scope.
- If Python, a shell job, CI, or a disposable session starts the harness, choose runtime
DEEPSEEK_API_KEYinjection. Keep the value outside the repository and outside tracked launch files. - If a remote task runs without a person present, inject the key into the task’s execution identity. Do not inherit credentials from the administrator’s login shell.
- If several users share one Mac, separate administrator, execution, and ordinary access accounts before storing a long-lived key. If you cannot define who owns and rotates the credential, pause the deployment.
- If several projects have different owners or cost centers, use separate credentials or a documented credential boundary. Do not use one shared key merely because it is faster to configure.
- If you need automatic key rotation, do not assume DeepSeek Harness provides it internally. Design the rotation around the surrounding operating environment and verify the provider behavior after each change.
- If you are moving from a stored UI credential to an environment variable, remove the old copy only after the new process has passed an authentication test. Otherwise, you may turn a controlled migration into an outage.
This is a layered decision, not an either-or rule. A developer can use UI storage for a personal trial while the same team uses runtime injection for CI and restricted accounts for remote jobs.
SECTION 08 Rotate credentials through a five-stage timeline
A useful rotation process has five milestones.
1. Create
Record the owner, project, purpose, creation date, and intended execution identities. Do not put the secret value in the record. Store only a reference that lets an authorized operator identify the credential.
2. Deliver
Choose one delivery path. For a personal session, that may be the Web UI. For Python or CI, it should normally be runtime injection. For a shared remote Mac, the delivery path must target the task account rather than every user.
3. Use
Run a small verification request and record the non-secret evidence: account or project identifier where available, provider name, model name, timestamp, and success or failure result. DeepSeek’s API examples show that the returned response includes model information, which can help confirm that the request reached the intended route. (DeepSeek’s official comparison testing guide)
4. Replace
Load the new credential into the intended location, restart or reload the affected process, and run a verification request. Check both the new process and any long-running worker. A daemon that started before the replacement may still hold the previous environment in memory.
5. Revoke
Disable or delete the previous key after the replacement is confirmed. Then inspect failed jobs, retries, session records, and support logs for accidental exposure. Keep an audit record without retaining the secret itself.
Changing the provider or deleting a credential can affect new requests, but it does not rewrite old session records. Older conversations may still contain model and provider identifiers, tool results, or configuration references. Treat historical sessions as data that requires separate review, especially when a provider migration or offboarding event is involved.
SECTION 09 Independent FAQ
Where is a DeepSeek Harness API Key saved after UI setup?
The documented location is represented by $DSH_HOME/.credentials.yaml. The settings view keeps a reference and shows a redacted description instead of the complete secret. Check the active DSH_HOME value and the account that launched the process before searching for the file. A different user or session directory can produce a different result.
What should a Python SDK read?
Use DEEPSEEK_API_KEY from the process environment. This matches the official Python example and keeps credential replacement separate from application code. Pass the variable into the process through a protected local startup method, CI secret injection, or task runner. Avoid storing the actual value in source files, notebooks, shell history, or project-level credentials.yaml.
Can everyone on a remote Mac use one key?
Avoid that design when the Mac hosts multiple projects or users. One shared key makes usage attribution weak and turns a single rotation into a multi-project outage. If a temporary shared key is unavoidable, restrict the accounts that can launch the harness, document the owner, and set a replacement deadline before work begins.
Do old sessions continue after key replacement?
Do not assume either outcome. New requests depend on the credential available to the current process, while old session records can still retain model and provider metadata. Test one old session after replacement, inspect the resulting authentication behavior, and stop the session if it uses an unintended provider or account.
SECTION 10 A compact acceptance run for your next configuration
Before you call the setup complete, perform these checks in order:
- Identify the owner of the DeepSeek API Key.
- Write down the exact execution account that will use it.
- Select UI storage or runtime injection based on the decision path above.
- Start a clean DeepSeek Harness session.
- Confirm that a missing key produces a controlled failure.
- Confirm that the valid key completes one test request.
- Inspect logs, errors, session records, shell history, and temporary files.
- Replace the key in a test environment.
- Verify that the new process uses the replacement.
- Revoke the old key and record the evidence without recording the secret.
If you cannot complete steps 1, 2, or 7, the problem is not the input method. The environment lacks a clear credential boundary.
SECTION 11 Choose the Mac arrangement that matches the responsibility model
A personal Mac with UI storage is quick for interactive trials, but it ties the credential to one local account and makes remote administration or team handoff harder. A shared remote Mac can provide a consistent execution environment, but unrestricted accounts, common home directories, and one team-wide key create attribution gaps and rotation outages. A local Python setup gives you control, yet it also leaves you responsible for backups, permissions, uptime, and process isolation.
If you only need temporary DeepSeek Harness experiments, a managed Mac environment from VPSNIX can be easier to evaluate than purchasing hardware or leaving a shared workstation loosely configured. The better experience comes from starting with a defined account boundary, injecting the key only where the task needs it, and keeping replacement evidence separate from the secret itself. If your workload is a permanent, high-volume deployment or requires direct physical peripherals, owning and operating dedicated hardware may still be the better choice.
Before launching an agent on a shared environment, choose the storage path, name the credential owner, and write the rotation stop signal. Then keep a copy of the checklist without any secret values.
SECTION 12 FAQ
Where does DeepSeek Harness keep an API key saved through the interface?
As of August 18, 2026, the documented Web UI flow writes the credential to the path represented by $DSH_HOME/.credentials.yaml. The settings screen keeps a credential reference and returns a redacted description rather than showing the secret again. That protects accidental display, but it does not make the credential unreadable to every process or account that can access the file.
How should a Python SDK project read a DeepSeek API key?
Use the DEEPSEEK_API_KEY environment variable at process startup and let the Python client read it with os.environ.get. This keeps the source code independent from the active credential and makes replacement easier. Do not commit shell exports, .env files, launch scripts, notebooks, or CI logs that contain the actual value.
Can several people share one model key on a remote Mac?
They can technically use the same key, but it is a poor default for a team. Shared use removes clear ownership, makes attribution difficult, and forces unrelated jobs to stop when the key is rotated. Use separate execution identities or scoped credentials for administrators, automated tasks, and ordinary users whenever the environment supports that separation.
Will an old DeepSeek Harness session keep working after the API key changes?
A new request normally depends on the credential currently available to the process or provider configuration, so changing or deleting a key can affect new requests immediately after reload or restart. An existing conversation record may still contain the model and provider identifiers used earlier. Treat that history as separate evidence and verify whether the old session can authenticate before assuming it will continue.