golem-add-secret-rust

Adds environment-scoped secrets to Rust Golem agents using typed config and CLI commands.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-add-secret-rust
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-add-secret-rust
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/rust/golem-add-secret-rust
Command: npx skills add https://github.com/golemcloud/golem --skill golem-add-secret-rust

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust Golem agents often need sensitive values like API keys, passwords, and tokens, but these must never be checked into source control alongside golem.yaml. This Skill shows how to declare, inject, read, and manage secrets safely per environment.

Core Features & Use Cases

  • Secret Declaration: Mark fields of type Secret<T> with #[config_schema(secret)] inside a ConfigSchema struct, including nested config structs.
  • Constructor Injection: Receive secrets through a Config<T> parameter annotated with #[agent_config] in the agent constructor, and reveal values at runtime with .get().
  • CLI Management: Create, list, update, and delete environment-scoped secrets with golem secret commands, plus secretDefaults in golem.yaml for local development.
  • Use Case: An agent connecting to a database declares host and port as regular config and the password as Secret<String>, then sets the real value per environment with golem secret create db.password.

Quick Start

Add a secret API key to my Rust Golem agent config and show me how to set its value with the golem CLI.

Frequently Asked Questions about golem-add-secret-rust

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

FAQPage Schema
How do I add secrets to a Rust Golem agent?

Declare a field of type Secret<T> in a ConfigSchema struct and annotate it with #[config_schema(secret)]. Inject it through a Config<T> constructor parameter marked #[agent_config], then call .get() on the secret at runtime to reveal its value.

How do I create and update secrets with the golem CLI?

Use golem secret create with a path, --secret-type, and --secret-value to create a secret in the current environment. Update it with golem secret update-value, list with golem secret list, and remove it with golem secret delete.

Are Golem secrets stored in golem.yaml?

No, secrets are never stored in golem.yaml because that file is checked into source control. They are managed per environment via the CLI, though secretDefaults in golem.yaml can provide values for local development only.

Can a Golem agent have optional secrets?

Yes, use Option<Secret<T>> for optional secrets. Missing required secrets cause agent creation or deployment to fail, so optional secrets are the way to handle values that may not exist in every environment.

Do secret updates require restarting the Golem agent?

No, secrets are lazily loaded, so a fresh .get() call can observe updated values without restarting the agent. Each reveal pins the resolved secret revision for deterministic retries and replay.