Agent skill · software engineering · jeremylongshore
langchain-multi-env-setup
Build reliable dev / staging / prod isolation for LangChain 1.0 services\
Why this skill is useful
Adds specific integration patterns for managing environment configurations and secrets in LangChain 1.0 that the AI wouldn't reliably generate on its own.
What it needs
Requires boto3, google-cloud-secret-manager, hvac, python installed locally. About 8k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
LangChain Multi-Env Setup (Python) Overview 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 ANTHROPICAPIKEY=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 LANGCHAINENV=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: This skill owns the per-env config plumbing — Settings skeleton, Secret Manager integration, per-env pinning, startup smoke test. It does not own the full secrets lifecycle (rotation, revocation, scope) — that belongs to langchain-security-basics. Pin: langchain-core 1.0.x, langchain-anthropic 1.0.x, pydantic >= 2.5, pydantic-settings >= 2.1. Pain anchors: P37 (primary), P20 (checkpointer schema — cross-ref langchain-langgraph-checkpointing). Two numbers: smoke test < 10 seconds; env-var count ~15-30 (more than 30 means Settings is absorbing feature flags and should split). Prerequisites Python 3.10+ (3.11+ recommended for Literal and StrEnum ergonomics) langchain-core >= 1.0, < 2.0 pydantic >= 2.5, pydantic-settings >= 2.1 One secret backend: GCP Secret Manager (google-cloud-secret-manager), AWS Secrets Manager (boto3), or HashiCorp Vault (hvac) Completed langchain-sdk-patterns — the Settings object is injected into the chain factories from that skill Instructions Run these six steps in order — each adds one invariant the next step depends on: 1. Define a Settings class with SecretStr keys, Literal env, and fail-fast validation. 2. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/langchain-multi-env-setup--273bdb