Doppler Secrets Management
Relevant source files
The following files were used as context for generating this wiki page:
Doppler Secrets Management within swe-term serves as a mandatory security layer for handling sensitive credentials, particularly when interacting with AI agents and external LLM providers. The system enforces strict protocols to prevent secret leakage into logs, terminal history, or Large Language Model (LLM) prompts by utilizing the Doppler CLI as the primary interface for secret access and validation.
The integration focuses on environment variable injection and runtime resolution, ensuring that raw secret values remain isolated from the application's persistent storage and communication channels. This approach aligns with the project's core principles of safety and blast radius protection, especially when executing ad hoc scripts or deploying extensions like swe_distiller.
Sources: AGENTS.md:1-25, AGENTS.md:286-300
Security Restrictions and Protocols
The project mandates a set of restrictive policies for interacting with secrets to maintain security integrity. These rules apply to both manual terminal operations and automated agent behaviors.
Doppler CLI Usage Rules
- Validation Only: The Doppler CLI (
doppler) should be used to validate the existence of secrets (e.g., usingdoppler secrets --only-names). - Process Injection: Secrets must be injected into processes using
doppler run. - No Raw Retrieval: Raw secret values must NEVER be retrieved via
doppler secrets getordoppler secrets downloadfor use in prompts, logs, or command outputs. - Anti-Leakage: Printing secrets to
stdoutorstderris strictly prohibited. Secret values must not be placed in message bodies sent to LLM APIs.
Sources: AGENTS.md:288-295
Python and Ad Hoc Scripts
For Python scripts requiring sensitive data, the workflow requires environment injection:
doppler run --project=<project> --config=<config> -- python <script.py>
Scripts are designed to resolve secrets from runtime environment variables and fail fast if required variables are missing.
Sources: AGENTS.md:297-304
Data Flow and Injection Architecture
The following diagram illustrates how secrets flow from the Doppler vault into the application environment without being exposed to the logging or orchestration layers.
The application process resolves secrets strictly from the injected environment variables, maintaining a clear boundary between sensitive data and observable outputs.
Sources: AGENTS.md:291-304, extensions/swe_distiller/src/extraction/llm.rs:115-120
Secrets in Extensions (swe_distiller)
In the swe_distiller extension, secrets are primarily used to authenticate with LLM providers like Jina or Ollama. These are resolved through environment variables at runtime.
LLM Provider Authentication
When the LLM extraction pipeline is enabled via the --llm flag, the system checks for specific environment variables. For example, the Jina provider looks for JINA_API_KEY to perform bearer authentication.
// extensions/swe_distiller/src/extraction/llm.rs:115-120
if let Ok(api_key) = env::var("JINA_API_KEY") {
if !api_key.trim().is_empty() {
req = req.bearer_auth(api_key);
}
}
Configuration and Environment Variables
The following environment variables are recognized for configuring the secure extraction pipeline:
| Variable | Purpose | Default / Reference |
|---|---|---|
JINA_API_KEY | API Key for Jina Reader API | None |
OLLAMA_BASE_URL | Base URL for local Ollama instance | http://127.0.0.1:11434 |
SWE_DISTILLER_LLM_PROVIDERS | Comma-separated list of providers | gemma4:31b-cloud,reader-lm:1.5b,jina |
Sources: extensions/swe_distiller/src/extraction/llm.rs:88-120, extensions/swe_distiller/README.md:29-37
Implementation in Pipeline Orchestration
The pipeline orchestration layer in lib.rs and the CLI in main.rs handle the passing of options that trigger the use of these secrets. When the llm option is set to true, the extract_url function initiates the LLM provider orchestration, which in turn accesses the environment-injected secrets.
The sequence ensures that secrets are only accessed at the final point of use within the internal LLM module.
Sources: extensions/swe_distiller/src/lib.rs:36-54, extensions/swe_distiller/src/main.rs:64-75, extensions/swe_distiller/src/extraction/llm.rs:27-60
Conclusion
Doppler Secrets Management in swe-term is a non-negotiable security framework. By enforcing the use of the Doppler CLI for process injection and strictly prohibiting the exposure of raw secret values in code, logs, or LLM interactions, the project ensures that sensitive credentials remain protected across its modular architecture and AI-driven workflows.
Sources: AGENTS.md:286-306