AGENT SKILL

secretzero-handle

Use when the task touches `.env`, dotenv/json/yaml secret files, local `file` targets, or any workflow where secret material could enter agent context. Enforces `SZ_AGENT_MODE=true` spill-safe CLI usage, ingest preseed, strict manifest validation, and safe discovery patterns alongside `secretzero-agent` / `secretzero-author`.

License 许可
Apache-2.0
所属仓库
zloeber/SecretZero
最近更新
2026-10-31
Stars
★ 8
Forks
0

01 前言 Front Matter

name
secretzero-handle
license
Apache-2.0
metadata
{ "author": "secretzero", "version": "1.1" }
description
Use when the task touches `.env`, dotenv/json/yaml secret files, local `file` targets, or any workflow where secret material could enter agent context. Enforces `SZ_AGENT_MODE=true` spill-safe CLI usage, ingest preseed, strict manifest validation, and safe discovery patterns alongside `secretzero-agent` / `secretzero-author`.
allowed-tools
Bash(secretzero:*) Read
compatibility
Requires SecretZero CLI (Python 3.12+). Always set SZ_AGENT_MODE=true before CLI on agent hosts.

03 SKILL.md 正文

SecretZero Handle (spill-safe context)

Enforces skills/secretzero/SKILL.md absolute rule: SecretZero only for secrets; never load values into agent context.

Use this skill together with skills/secretzero-agent/SKILL.md and skills/secretzero-author/SKILL.md whenever:

  • The manifest references .env, *.env, or local / file targets that read or write environment files.
  • You are asked to pre-seed or import values from disk into the lockfile.
  • The agent might otherwise run secretzero render, list variables, get --reveal, or terraform --include-static-secrets.

Set spill-safe mode

export SZ_AGENT_MODE=true

With this set:

  • secretzero validate also enforces no plaintext static-like payloads in the merged manifest (same rules as --strict-manifest-plaintext).
  • secretzero render is blocked (full interpolated manifest may contain secrets).
  • secretzero list variables --format json returns names only (values_redacted).
  • secretzero list targets redacts non-structural target config fields in JSON and text summaries.
  • secretzero get --reveal is blocked.
  • secretzero backup create without --encrypted is blocked; backup restore --print is blocked.
  • secretzero agent adopt / agent list are safe under spill mode (metadata-only JSON). Use --preseed-lockfile to hash present credentials without printing values. agent backup is an alias of agent adopt (not value-export backup).
  • secretzero terraform with --include-static-secrets is blocked.

Unset SZ_AGENT_MODE only on trusted local shells when you intentionally need full dumps.

SZ_AGENT (Vector 3 automation) and SZ_AGENT_MODE can both be set; spill guards apply when either is true.

MCP server spill mode

The first-party MCP server (secretzero-mcp, see docs/mcp-setup.md) sets SZ_AGENT_MODE=true on startup when the variable is unset — same spill contract as CLI above.

  • MCP tools (sz_status, sz_sync, sz_discover, sz_rotate, sz_drift_check) return metadata only and reject reveal parameters.
  • Set SZ_WORKSPACE (or pass tool workspace) to the repository root so lockfile/Secretfile resolution matches the project.
  • MCP does not replace agent sync --web or ingest preseed — use CLI for human seeding and lockfile import from disk.
  • Co-load this skill whenever MCP is used for authoring or operations alongside secretzero-author / secretzero-agent.

Pre-seed lockfile from a secrets file (no values on stdout)

  1. Ensure Secretfile.yml defines each secret with a local / file target whose config.path matches the on-disk file (e.g. .env).
  2. Use placeholders / null leaves for static-like secrets—no literals in YAML when SZ_AGENT_MODE is on.
  3. Run:
secretzero ingest preseed --source ./.env --file Secretfile.yml --format json

Stdout is metadata only (counts, per-secret status, matched secret names)—same contract as secretzero import.

For broader key discovery when authoring manifests:

secretzero detect . --all-keys --format json

That lists variable names from dotenv-style files (no values).

Authoring rules under agent handle

  • Never read_file on .env, .env.*, *.pem, or lane .szvar files that may contain secrets.
  • Prefer secretzero ingest preseed + secretzero validate instead of copying values into chat or YAML.
  • Use secretzero agent sync --web for human entry when ingest cannot cover a secret.

Install / verify

Same as other SecretZero skills (uv tool install "secretzero[all]", then secretzero --help, secretzero ingest preseed --help).

04 同仓库更多 Skills

zloeber
zloeber/SecretZero

secretzero

Compatibility entrypoint for SecretZero skills. Enforces the absolute rule: never consume secrets in agent context — use SecretZero for all secret handling. Routes to secretzero-author, secretzero-agent, secretzero-handle, and secretzero-agent-adopt.

★ 8
zloeber
zloeber/SecretZero

secretzero-handle

Use when the task touches `.env`, dotenv/json/yaml secret files, local `file` targets, or any workflow where secret material could enter agent context. Enforces `SZ_AGENT_MODE=true` spill-safe CLI usage, ingest preseed, strict manifest validation, and safe discovery patterns alongside `secretzero-agent` / `secretzero-author`.

★ 8
zloeber
zloeber/SecretZero

secretzero-author

Use when authoring, reviewing, or walking a user through a new or existing `Secretfile.yml`. Guided session: manifest root, inventory table, optional local discovery, add/edit loop with secret-type and target menus, validate, optional `secretzero web`. Hermes + MCP notes included. Safe contextless discovery, `.szvar` lanes, policy-bound targets. Inherits absolute rule from `skills/secretzero/SKILL.md`. Co-load `skills/secretzero-handle/SKILL.md` for `.env` / spill-safe CLI.

★ 8
zloeber
zloeber/SecretZero

secretzero-agent

Use for agentic and operational SecretZero workflows including unified `agent sync`, CLI/API/MCP parity, secure human-in-the-loop vectors, and automation-safe run loops.

★ 8
zloeber
zloeber/SecretZero

secretzero-agent-adopt

Use for agent runtime integration: discover Hermes/OpenClaw installs, bootstrap SecretZero environments with `secretzero agent list` / `agent adopt`, lockfile preseed, and restore loops. Inherits absolute rule from `skills/secretzero/SKILL.md` (SecretZero only; never secrets in context).

★ 8
zloeber
zloeber/SecretZero

secretzero

Compatibility entrypoint for SecretZero skills. Enforces the absolute rule: never consume secrets in agent context — use SecretZero for all secret handling. Routes to secretzero-author, secretzero-agent, secretzero-handle, and secretzero-agent-adopt.

★ 8