Overview
LangGraph Platform integrates with LangSmith for secure secrets management. All secrets are encrypted at rest and in transit.Quick Start
1
Set Secrets
2
Reference in Code
3
Deploy
Setting Secrets
Via CLI
Via LangSmith UI
- Go to smith.langchain.com
- Navigate to Settings → Secrets
- Click “Add Secret”
- Enter name and value
- Save
Viewing Secrets
Secret values are never displayed for security. You can only set or delete secrets.
Updating Secrets
Deleting Secrets
Environment-Specific Secrets
Use different secrets for each environment:- Development
- Staging
- Production
Common Secrets
LLM API Keys
Authentication
Database & Services
Accessing Secrets in Code
Secrets are available as environment variables:With Pydantic Settings
Best Practices
Use Strong Secrets
Use Strong Secrets
Generate cryptographically secure secrets:
Rotate Secrets Regularly
Rotate Secrets Regularly
Use Deployment-Specific Secrets
Use Deployment-Specific Secrets
Never share secrets between dev/staging/prod:
Validate Required Secrets
Validate Required Secrets
Check for required secrets at startup:
Never Log Secrets
Never Log Secrets
Troubleshooting
Secret not found error
Secret not found error
Symptom:
KeyError: 'ANTHROPIC_API_KEY'Solution:Wrong secret value
Wrong secret value
Symptom: API returns 401 UnauthorizedSolution:
Deployment-specific secret not working
Deployment-specific secret not working
Symptom: Production uses dev secretsSolution:
Security Considerations
Next Steps
Configuration
Configure your deployment
Deploy
Deploy with secrets
Monitoring
Monitor deployments
CI/CD
Automate secret management