secrecy

Rust wrapper types that keep secrets out of logs, debug output, and Clone/Copy, and securely wipe them from memory on drop

Library
Cargo
v0.10.3
577stars
Apache-2.0 OR MIT

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
53/100Fair
Development Activity44
Maintenance12
Community68
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture78
Code Quality82
Innovation72
Learning Curve85

secrecy is a small, forbid(unsafe_code) Rust crate built around one idea: a secret value (an API key, password, or private key) should be structurally hard to leak by accident. Its core SecretBox<T> type wraps any value so it cannot be printed via Debug, serialized, or copied without going through an explicit ExposeSecret trait call - forcing every place a secret is actually read to be visible and intentional in the code. When a SecretBox is dropped, its contents are zeroed out via the zeroize crate so the plaintext doesn’t linger in memory.

Maintained by iqlusion (part of the iqlusioninc/crates collection of Rust crates) alongside cryptography and key-management crates like zeroize and bip32, secrecy has become a common building block wherever Rust code handles credentials, tokens, or cryptographic key material and wants the type system to help prevent leaking them into logs or error messages.

What You Get

  • SecretBox<T>, a generic wrapper that stores any value as a secret and blocks its accidental exposure via Debug or logging
  • The ExposeSecret trait, requiring callers to explicitly opt in every time they need the underlying secret value
  • Automatic memory zeroing on drop, built on the zeroize crate, so secret bytes don’t remain readable in freed memory
  • Optional serde support (feature-gated) for deserializing owned secret values while minimizing accidental copies
  • no_std-compatible design (with alloc), making it usable in embedded and constrained environments

Common Use Cases

  • Wrapping API keys, tokens, or passwords in application config structs so they can’t be accidentally printed in logs or error messages
  • Holding cryptographic key material in memory with a guarantee that it’s zeroed out as soon as it goes out of scope
  • Passing secrets through a codebase where the type system should force every read site to be an explicit, auditable expose_secret() call
  • Deserializing secret values from config files or environment variables via serde without leaving extra plaintext copies around

Under The Hood

Architecture - The crate is intentionally minimal (a single ~350-line src/lib.rs): SecretBox<T> is a newtype wrapper around T, with manual (non-derived) implementations of Debug/Clone/etc. that either omit the inner value or route through explicit APIs, and a Drop impl that calls into the zeroize crate’s Zeroize trait to overwrite the memory before deallocation. The ExposeSecret trait is the single sanctioned way to read the wrapped value, keeping every access point grep-able and auditable. Tech Stack - Pure Rust, no_std-compatible with the alloc feature, depends only on zeroize (with optional serde support gated behind a cargo feature), uses Rust edition 2024 and requires Rust 1.85+; part of the iqlusioninc/crates Cargo workspace alongside related crates like zeroize and bip32. Code Quality - The crate carries a forbid(unsafe_code) attribute and a “Safety Dance” badge, signaling a deliberate constraint against unsafe blocks; being a thin wrapper crate, its correctness rests heavily on zeroize’s tested zeroing guarantees rather than a large internal test suite of its own. API Design - The API surface is deliberately tiny - construct a SecretBox, and read it only via expose_secret() - trading flexibility for a hard-to-misuse guarantee, which is the entire point of the crate.

Used by 7 apps in this directory

TypeScript
75%
Apache 2.0

Fern

Developer Tools

3,761

Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.

View details
90
Repo Health
86
Technical
67
Dependency
Built with
TypeScript75%
Updated today
TypeScript
61%
EPL-2.0

Huly Platform

Project Management · Team Chat · Collaboration

27,384

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
90
Repo Health
86
Technical
64
Dependency
Built with
TypeScript61%
Svelte34%
Updated 1 weeks ago
TypeScript
79%
LGPL 3.0

Latitude

AI Agents · Monitoring

4,593

Open-source AI agent monitoring that catches what will break next before your users do.

View details
86
Repo Health
88
Technical
67
Dependency
Built with
TypeScript79%
Python11%
Updated today
Rust
100%
Other

Meilisearch

Search

59,012

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
90
Repo Health
88
Technical
68
Dependency
Built with
Rust100%
Updated 5 days ago
Go
80%
AGPL 3.0

PeerDB

Data Engineering · Databases

3,241

Postgres-native ETL that streams change data capture in real time to Snowflake, BigQuery, ClickHouse, S3, and Kafka — up to 10x faster than general-purpose pipelines, managed through a familiar Postgres SQL interface.

View details
88
Repo Health
76
Technical
68
Dependency
Built with
Go80%
TypeScript13%
Updated today
Rust
93%
Other

Tabby

AI Code Assistants

33,828

Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.

View details
61
Repo Health
78
Technical
63
Dependency
Built with
Rust93%
Updated 1 months ago
Rust
50%
Apache 2.0

Vibe Kanban

AI Agents · AI Code Assistants · Project Management

27,849

A kanban board for planning work and dispatching Claude Code, Codex, Gemini CLI, and eight other coding agents into isolated git worktrees, then reviewing and merging their diffs from one UI.

View details
53
Repo Health
75
Technical
65
Dependency
Built with
Rust50%
TypeScript46%
Updated 3 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search