Environments

- Local development: Use 1Password CLI to pass the variables stored in an Environment to applications or scripts at runtime, or create a locally mounted
.envfile for tools that expect an environment file on disk. - AI-assisted coding: Keep plaintext secrets out of an LLM’s context using a locally mounted
.envfile that your IDE can read without storing the plaintext contents on your device. Use 1Password hooks to validate your setup before the agent executes shell commands. - Containerized apps: Use 1Password SDKs to retrieve Environment variables directly in your application container’s code, or use 1Password CLI to load variables into an init container or sidecar at runtime.
- CI/CD pipelines: Use 1Password CLI to load the right set of variables into your pipeline for the current development stage by pointing to the Environment your pipeline needs. Authenticate with a service account for automated, least privilege access.
.env files directly into 1Password, and you can share your Environments with your team members for quick and secure collaboration.
Get started
Create and manage Environments.
Access secrets through local .env files
Sync an Environment to a local .env file.
Programmatically read Environments
Fetch variables from Environments with 1Password CLI or SDKs.
Sync secrets to AWS Secrets Manager
Centralize secrets management and simplify your AWS Secrets Manager workflow.
Find .env files with plaintext secrets
Use Developer Watchtower to scan your local disk for
.env files with plaintext secrets, then import them into Environments.You can also replace hardcoded secrets in your code using secret references.
Shell plugins
- Cloud provider CLIs: Authenticate
awsand other cloud provider CLIs with 1Password instead of storing access keys in~/.aws/credentialsor shell profiles. - Version control: Use the GitHub or GitLab shell plugins to authenticate
ghorglabwithout storing plaintext tokens in your environment. - Local development tools: Authenticate package managers and development CLIs like Homebrew without storing credentials in config files.
Choose your configuration
Use the tables below to find the best tools and authentication method for your specific use case. Every scenario includes a recommended tool and authentication method.Tool options
- 1Password Environments: Best for managing project secrets in 1Password and eliminating plaintext secrets in code.
- 1Password CLI: Best for quick testing, shell scripts, CI/CD pipelines, Infrastructure as Code, build tools and task runners. Environments require the latest CLI beta.
- 1Password SDKs: Best for native integrations with Go, Python, or JavaScript applications. Environments require the latest SDK beta.
- 1Password Shell Plugins: Best for securing command-line tools and adding convenient biometric authentication to any CLI.
- 1Password Connect server: Securely access secrets in your company’s apps and cloud infrastructure using a private REST API.
Authentication options
- 1Password desktop app: Authenticate locally in the same way you unlock your 1Password desktop app, like with biometrics or your 1Password account password. Requires minimal setup with no token management and enables human-in-the-loop approval for sensitive workflows.
- 1Password Service Accounts: Authenticate using a token scoped to specific vaults or Environments, with no user interaction required. Best for headless servers, automated workflows, and shared building. Service accounts can’t access your built-in Personal, Private, or Employee vault.
- Connect server token: Authenticate with your Connect server host and token.
Scenarios
Local development
Production environments
Secrets management
Next steps
Choose what you want to do next:Secure your deployments
Securely load secrets into CI/CD, containers, and production apps at runtime with least-privilege access.
Secure AI access
Provide credentials to AI agents and tools without exposing them in prompts, LLM context, or config files.