environment

A command group for separating project secrets into development, staging, and production environments. The active environment controls which secrets are used locally and where pull or push operations apply.

In plain words
What is it for?
Switch environments, view their secret counts, copy or merge secrets, and delete all secrets from the active environment.
Why use it?
It helps prevent accidentally using or changing secrets from the wrong environment. It also makes it easier to compare, copy, or combine secrets between environments.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/the-17/agentsecrets/environment
Clone the repo
git clone --depth 1 https://github.com/The-17/agentsecrets
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 681 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00681
Opus 5 $0.00000 $0.00341
Sonnet 5 $0.00000 $0.00136
Haiku 4.5 $0.00000 $0.00068

Measured yesterday against content hash 2c5f5400e828, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

environment scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/environment.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.

agentsecrets environment

Manage environments (development, staging, production) within your active project.

Overview

AgentSecrets projects are partitioned into three environments by default: development, staging, and production. Your active environment determines which secrets are synced to your local OS keychain, and which external environment is modified when you use the secrets pull or secrets push commands.

Usage

agentsecrets environment [command]

Supported Commands

Command Description
switch <environment> Switch the active environment
list List all environments with their secret counts
copy <from> <to> Instantly copy all secrets from one environment to another
merge <from> <to> Merge structure and prompt for new values
clean Delete all secrets in the current environment

Switching Environments

Switching environments automatically isolates your secret namespaces locally. Whenever you switch, you should perform a pull to fetch the destination environment's keys to your local machine.

agentsecrets environment switch staging
# Successfully switched to staging environment.

agentsecrets secrets pull
# Synced 12 secrets from cloud to OS keychain.
# This is environment scoped

Listing Environments

See how many secrets exist in each external environment under your current active project.

agentsecrets environment list

# ENVIRONMENT      SECRETS
# development      12     <- active
# staging          14
# production       14

Copying Secrets

If you're provisioning a new environment (such as initialising staging using your development tokens), you can copy all your secrets directly. This action will overwrite the destination environment if it already possesses values for the source keys.

agentsecrets environment copy development staging
# Copied 12 secrets from development to staging.

Comparing Secrets

Read the full file on GitHub · 106 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 106 lines · 0 tokens per session scan A 2c5f5400e828

Subscribe to this mod's changes

environment is a command published in the GitHub repository The-17/agentsecrets (172 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 681 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.