env-sanitization-rules

Enforce sanitized environment snapshots before spawning Rust child processes.

Updated Dec 4, 2025
One-click install
npx skills add https://github.com/jamieadams-nerd/umrs-project --skill env-sanitization-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: env-sanitization-rules
Source: https://github.com/jamieadams-nerd/umrs-project/tree/main/.claude/skills/env-sanitization-rules
Command: npx skills add https://github.com/jamieadams-nerd/umrs-project --skill env-sanitization-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Environment sanitization rules for Rust binaries ensure that the process environment is treated as attacker-controlled input, preventing leakage of secrets and unintended influence on child processes.

Core Features & Use Cases

  • Tiered env variable handling and scrub reporting to isolate sensitive keys
  • Enforced init_tool snapshot and Command::env_clear usage for deterministic environments
  • Guidance for implementing or reviewing env handling in umrs-core::init and related code

Quick Start

Integrate the env-sanitization rules into Rust binaries by enforcing a sanitized environment snapshot before any subprocess is spawned.

Frequently Asked Questions about env-sanitization-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent environment variable leakage when spawning child processes in Rust?

Rust environment sanitization enforces a single-shot snapshot of process variables before spawning child processes, treating the environment as attacker-controlled input to prevent secret leakage and unintended influence on subprocess execution.

What is the best way to scrub secrets from the environment in Rust binaries?

Scrubbing secrets from Rust binaries is best handled through Tier-based variable handling that isolates sensitive keys, prohibits environment mutations, and ensures secrets are never read from the environment during init_tool flows.

How do I enforce Command::env_clear usage before spawning subprocesses in Rust?

Enforcing Command::env_clear in Rust requires applying sanitization rules across init_tool flows and any code that reads std::env::var or spawns child processes, ensuring a sanitized environment snapshot is captured before subprocess execution.

Why should the process environment be treated as attacker-controlled input in Rust?

The process environment should be treated as attacker-controlled input in Rust because unsanitized variables can leak secrets and allow unintended influence on child processes, compromising deterministic execution and application security.

Does this environment sanitization approach work with umrs-core init flows?

Yes, this environment sanitization approach works with umrs-core init flows by providing guidance for implementing and reviewing environment handling in umrs-core::init and related code, ensuring deterministic environments across init_tool snapshots.

What are the limitations of prohibiting environment mutations in Rust binaries?

Prohibiting environment mutations in Rust binaries limits dynamic runtime configuration changes, requiring all environment variables to be captured in a single-shot snapshot during initialization rather than modified during execution.