credential-and-env-injection

Designs credential injection and secret isolation for generated agent runtimes and synthesized tools.

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/dperussina/function2agent --skill credential-and-env-injection-dperussina
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: credential-and-env-injection
Source: https://github.com/dperussina/function2agent/tree/main/.cursor/skills/credential-and-env-injection
Command: npx skills add https://github.com/dperussina/function2agent --skill credential-and-env-injection-dperussina

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Agents with shell access and resource-plane credentials create a lethal combination: secrets leak into model context, environment variables are readable by the agent itself, and a sandboxed shell can bypass every tool-level control by reaching the database directly. This Skill provides the design rules for keeping secrets out of the model's context and out of the agent's reach. ## Core Features & Use Cases - Two-plane credential separation: Enforces physically separate model-plane and resource-plane credential subsystems with different rotation, blast-radius, and detection profiles. - Credential broker pattern: Replaces free-text secret fields with a credential_ref enum bound to a manifest, validated in middleware and resolved server-side outside the sandbox. - Egress and redaction controls: Specifies default-deny network egress via a mandatory external proxy, redaction at the tool-response serialization seam before compaction, and CI canary tests for leaked synthetic credentials. - Use Case: When adding a database connection string to a generated agent runtime, apply these rules to emit a brokered credential_ref handle, deny direct network paths from the sandbox to the database, and default the tool's authorization to UNRESOLVED pending human review. ## Quick Start Ask the agent to review how API keys and database credentials should reach a generated agent stack without entering the model's context.

Frequently Asked Questions about credential-and-env-injection

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

FAQPage Schema
How do I inject secrets into an AI agent without exposing them to the model?▼

Use a credential_ref enum bound to a manifest in the tool schema instead of free-text secret fields. Middleware validates the ref and hard-fails on unknown values, while a broker outside the sandbox resolves the actual secret server-side so it never enters the model's context.

Why are environment variables unsafe for agent sandboxes?▼

Environment variables are readable by the agent itself through env, printenv, /proc/self/environ, or subprocess inheritance, and shell access is a first-class tool in these runtimes. They remain appropriate only for non-secret configuration and references to broker identity material.

What is the difference between model-plane and resource-plane credentials?▼

Model-plane credentials access the upstream LLM and leaks cost money, while resource-plane credentials access customer databases and APIs where leaks cause irreversible data loss. The model plane centralizes per tenant; the resource plane must fragment to per-tool or per-call short-lived credentials.

How do I stop an agent shell from reaching production databases directly?▼

Enforce default-deny egress at a mandatory proxy outside the sandbox, allowlisting by host and port with pinned addresses, denying DNS and loopback. The sandbox's only reachable address should be the proxy, so a co-located database is unreachable rather than merely filtered.

When should secrets be redacted from agent traces and memory?▼

Redact at the tool-response serialization seam, before values enter the model context, compaction, or persistence. Once a secret reaches the context window it propagates to traces, prompt caches, and summaries, making downstream cleanup only best-effort.

Can static analysis derive tool authorization automatically?▼

Static analysis can derive read-versus-write behavior, table footprints, and declarative authorization annotations, but not data ownership, business destructiveness, or reversibility. Tools with underivable authorization must emit authorization: UNRESOLVED and stay disabled until a human binds a scope.