Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Builds dev, staging, and prod config isolation for LangChain 1.0 services using Pydantic Settings, SecretStr, and cloud Secret Manager.
48% 96%+48 ptsof test cases passed
Passed 22 of 23 test cases with the skill, and 11 of 23 without it.
Our prompt engineers publish prompt templates to LangSmith. Currently, staging and production servers pull whichever prompt version has the 'latest' tag, causing untracked prompt regressions in production. How should prompt retrieval be anchored across environments?
Each environment configuration explicitly pins a specific prompt commit hash string.
3 of 3 safety checks passed
A team ships a LangChain 1.0 service to staging with python-dotenv loading
.env.staging into os.environ. Security audits —
docker exec STAGING-POD env prints ANTHROPIC_API_KEY=sk-ant-api03-... in
plain text. Anyone with kubectl exec, any sidecar, any core dump, any
error tracker that auto-captures process env sees the key. This is pain
P37: secrets loaded from .env in production containers leak via env.
A second failure chains. A developer runs the staging deploy from a shell
where LANGCHAIN_ENV=production was set hours earlier. The loader picks
the prod .env, staging answers with a prompt commit tuned only for the
prod model tier, latency doubles. Two root causes: no type-safe env gate,
no startup validation that would have caught the mismatched model id.
Both are one refactor:
# BAD — dotenv populates os.environ; any process with container access sees it
from dotenv import load_dotenv
load_dotenv(".env.production")
api_key = os.environ["ANTHROPIC_API_KEY"] # P37: leaks via `docker exec env`
# GOOD — SecretStr in a validated Settings object, pulled from Secret Manager
from pydantic import SecretStr
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
env: Literal["dev", "staging", "prod"]
anthropic_api_key: SecretStr
settings = build_settings() # pulls from GCP Secret Manager in prod
api_key = settings.anthropic_api_key.get_secret_value()
# repr(settings) prints `SecretStr('**********')` — safe to log
This skill owns the per-env config plumbing — Settings skeleton,
Secret Manager integration, per-env pinning, startup smoke test. It does
Next to this one in the catalogue, plus more from the same author.